From 0fdfd8aaff92f8a4421e0014896501d73dbda772 Mon Sep 17 00:00:00 2001
From: Joshen Lim
Date: Thu, 12 Mar 2026 09:59:28 +0700
Subject: [PATCH] Small QoL improvemnets for branch management (#43633)
## Context
Couple of small QoL improvements for branch management from internal
feedback
- Use `TimestampInfo` component for branch rows here
- Workflow logs dialog will show branch name + use `TimestampInfo`
component as well for workflow runs created at
- Selecting a workflow run will then show the run created at in the
header description + use `TimestampInfo` component
---
.../BranchManagement/ActionStatusBadge.tsx | 10 +--
.../BranchManagement/BranchPanels.tsx | 21 +++---
.../BranchManagement/WorkflowLogs.tsx | 66 ++++++++++++-------
3 files changed, 57 insertions(+), 40 deletions(-)
diff --git a/apps/studio/components/interfaces/BranchManagement/ActionStatusBadge.tsx b/apps/studio/components/interfaces/BranchManagement/ActionStatusBadge.tsx
index 36cfe1cf8ad..96d17728269 100644
--- a/apps/studio/components/interfaces/BranchManagement/ActionStatusBadge.tsx
+++ b/apps/studio/components/interfaces/BranchManagement/ActionStatusBadge.tsx
@@ -1,6 +1,5 @@
-import type { PropsWithChildren } from 'react'
-
import { ActionName, ActionStatus, type ActionRunStep } from 'data/actions/action-runs-query'
+import type { PropsWithChildren } from 'react'
import { Badge, StatusIcon, Tooltip, TooltipContent, TooltipTrigger } from 'ui'
export interface ActionStatusBadgeProps {
@@ -44,15 +43,12 @@ export const ActionStatusBadgeCondensed = ({
}
const isUnhealthy = UNHEALTHY_STATUES.includes(status)
- const isWaiting = WAITING_STATUSES.includes(status)
return (
-
+
- {(isUnhealthy || isWaiting) && (
-
- )}
+ {isUnhealthy && }
{children}
diff --git a/apps/studio/components/interfaces/BranchManagement/BranchPanels.tsx b/apps/studio/components/interfaces/BranchManagement/BranchPanels.tsx
index c9f752df7aa..f2f3e450219 100644
--- a/apps/studio/components/interfaces/BranchManagement/BranchPanels.tsx
+++ b/apps/studio/components/interfaces/BranchManagement/BranchPanels.tsx
@@ -1,13 +1,14 @@
-import dayjs from 'dayjs'
-import { Github } from 'lucide-react'
-import { useRouter } from 'next/router'
-import { PropsWithChildren, ReactNode } from 'react'
-
import { ButtonTooltip } from 'components/ui/ButtonTooltip'
import type { Branch } from 'data/branches/branches-query'
+import dayjs from 'dayjs'
+import { Github } from 'lucide-react'
import Link from 'next/link'
+import { useRouter } from 'next/router'
+import { PropsWithChildren, ReactNode } from 'react'
import { Tooltip, TooltipContent, TooltipTrigger } from 'ui'
+import { TimestampInfo } from 'ui-patterns'
import { ShimmeringLoader } from 'ui-patterns/ShimmeringLoader'
+
import { WorkflowLogs } from './WorkflowLogs'
interface BranchManagementSectionProps {
@@ -137,12 +138,14 @@ export const BranchRow = ({
) : (
- {daysFromNow > 1
- ? `Updated on ${formattedUpdatedAt}`
- : `Updated ${formattedTimeFromNow}`}
+ {daysFromNow > 1 ? 'Updated on' : 'Updated'}{' '}
+
)}
-
+
{rowActions}
diff --git a/apps/studio/components/interfaces/BranchManagement/WorkflowLogs.tsx b/apps/studio/components/interfaces/BranchManagement/WorkflowLogs.tsx
index 93019356fa7..4db9cbaaeee 100644
--- a/apps/studio/components/interfaces/BranchManagement/WorkflowLogs.tsx
+++ b/apps/studio/components/interfaces/BranchManagement/WorkflowLogs.tsx
@@ -1,8 +1,3 @@
-import dayjs from 'dayjs'
-import { groupBy } from 'lodash'
-import { ArrowLeft, ArrowRight } from 'lucide-react'
-import { useState } from 'react'
-
import AlertError from 'components/ui/AlertError'
import { ActionRunData } from 'data/actions/action-detail-query'
import { useActionRunLogsQuery } from 'data/actions/action-logs-query'
@@ -12,6 +7,10 @@ import {
type ActionStatus,
} from 'data/actions/action-runs-query'
import type { Branch } from 'data/branches/branches-query'
+import dayjs from 'dayjs'
+import { groupBy } from 'lodash'
+import { ArrowLeft, ArrowRight } from 'lucide-react'
+import { useState } from 'react'
import {
Button,
cn,
@@ -25,13 +24,13 @@ import {
DialogTrigger,
StatusIcon,
} from 'ui'
-import { GenericSkeletonLoader } from 'ui-patterns'
+import { GenericSkeletonLoader, TimestampInfo } from 'ui-patterns'
+
import { ActionStatusBadge, ActionStatusBadgeCondensed, STATUS_TO_LABEL } from './ActionStatusBadge'
import BranchStatusBadge from './BranchStatusBadge'
interface WorkflowLogsProps {
- projectRef: string
- status: Branch['status']
+ branch: Branch
}
type StatusType = Branch['status']
@@ -39,7 +38,8 @@ type StatusType = Branch['status']
const HEALTHY_STATUSES: StatusType[] = ['FUNCTIONS_DEPLOYED', 'MIGRATIONS_PASSED']
const UNHEALTHY_STATUSES: StatusType[] = ['MIGRATIONS_FAILED', 'FUNCTIONS_FAILED']
-export const WorkflowLogs = ({ projectRef, status }: WorkflowLogsProps) => {
+export const WorkflowLogs = ({ branch }: WorkflowLogsProps) => {
+ const { project_ref: projectRef, status, name } = branch
const [isOpen, setIsOpen] = useState(false)
const {
@@ -84,13 +84,22 @@ export const WorkflowLogs = ({ projectRef, status }: WorkflowLogsProps) => {
- Workflow Logs
- Select a workflow run to view logs
+ Workflow logs for {name}
+
+ {!selectedWorkflowRun ? (
+ 'Select a workflow run to view logs'
+ ) : (
+ <>
+ Run created at{' '}
+
+ >
+ )}
+
-
+
{!selectedWorkflowRun ? (
<>
{isWorkflowRunsLoading && }
@@ -103,7 +112,7 @@ export const WorkflowLogs = ({ projectRef, status }: WorkflowLogsProps) => {
(workflowRuns.length > 0 ? (
{workflowRuns.map((workflowRun) => (
- -
+
-
@@ -132,7 +143,7 @@ export const WorkflowLogs = ({ projectRef, status }: WorkflowLogsProps) => {
))}
>
) : (
-
+