Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions packages/dashboard/src/components/run-list.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Badge } from "@/components/ui/badge";
import { Card } from "@/components/ui/card";
import { STATUS_CONFIG } from "@/lib/status";
import { cn } from "@/lib/utils";
import { computeDuration, formatRelativeTime } from "@/utils";
import { CaretRightIcon } from "@phosphor-icons/react";
import { Link } from "@tanstack/react-router";
Expand Down Expand Up @@ -57,7 +58,11 @@ export function RunList({ runs, title = "Workflow Runs" }: RunListProps) {
<div className="flex items-center justify-between">
<div className="flex flex-1 items-center gap-4">
<StatusIcon
className={`size-5 ${config.color} ${run.status === "running" ? "animate-spin" : ""}`}
className={cn(
"size-5",
config.color,
run.status === "running" && "animate-spin",
)}
/>

<div className="min-w-0 flex-1">
Expand All @@ -78,7 +83,10 @@ export function RunList({ runs, title = "Workflow Runs" }: RunListProps) {
<div className="text-muted-foreground flex items-center gap-4 text-xs">
<Badge
variant="outline"
className={`text-xs capitalize ${config.badgeClass}`}
className={cn(
"text-xs capitalize",
config.badgeClass,
)}
>
{config.label}
</Badge>
Expand Down
33 changes: 16 additions & 17 deletions packages/dashboard/src/lib/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,46 +22,46 @@ export const STATUS_CONFIG: Record<
> = {
completed: {
icon: CheckCircleIcon,
color: "text-green-500",
color: "text-success",
label: "Completed",
badgeClass: "bg-green-500/10 text-green-500 border-green-500/20",
badgeClass: "bg-success/10 border-success/20 text-success",
},
succeeded: {
icon: CheckCircleIcon,
color: "text-green-500",
color: "text-success",
label: "Completed",
badgeClass: "bg-green-500/10 text-green-500 border-green-500/20",
badgeClass: "bg-success/10 border-success/20 text-success",
},
running: {
// use the spinning notch for running states to match existing UI patterns
icon: CircleNotchIcon,
color: "text-blue-500",
color: "text-info",
label: "Running",
badgeClass: "bg-blue-500/10 text-blue-500 border-blue-500/20",
badgeClass: "bg-info/10 border-info/20 text-info",
},
failed: {
icon: XCircleIcon,
color: "text-red-500",
color: "text-destructive",
label: "Failed",
badgeClass: "bg-red-500/10 text-red-500 border-red-500/20",
badgeClass: "bg-destructive/10 border-destructive/20 text-destructive",
},
pending: {
icon: ClockIcon,
color: "text-yellow-500",
color: "text-warning",
label: "Pending",
badgeClass: "bg-yellow-500/10 text-yellow-500 border-yellow-500/20",
badgeClass: "bg-warning/10 border-warning/20 text-warning",
},
sleeping: {
icon: HourglassIcon,
color: "text-purple-500",
color: "text-sleeping",
label: "Sleeping",
badgeClass: "bg-purple-500/10 text-purple-500 border-purple-500/20",
badgeClass: "bg-sleeping/10 border-sleeping/20 text-sleeping",
},
canceled: {
icon: ProhibitIcon,
color: "text-gray-500",
color: "text-neutral",
label: "Canceled",
badgeClass: "bg-gray-500/10 text-gray-500 border-gray-500/20",
badgeClass: "bg-neutral/10 border-neutral/20 text-neutral",
},
};

Expand Down Expand Up @@ -95,9 +95,8 @@ export const TERMINAL_RUN_STATUSES: ReadonlySet<WorkflowRunStatus> = new Set([
"canceled",
]);

const fallbackStatusColor = "text-yellow-500";
const fallbackStatusBadgeClass =
"bg-yellow-500/10 text-yellow-500 border-yellow-500/20";
const fallbackStatusColor = "text-warning";
const fallbackStatusBadgeClass = "bg-warning/10 border-warning/20 text-warning";

function getStatusConfig(status: string) {
if (!(status in STATUS_CONFIG)) {
Expand Down
25 changes: 17 additions & 8 deletions packages/dashboard/src/routes/runs/$runId.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ function RunDetailsPage() {
)}
<Badge
variant="outline"
className={`border-border capitalize ${getStatusBadgeClass(run.status)}`}
className={cn(
"border-border capitalize",
getStatusBadgeClass(run.status),
)}
>
{run.status}
</Badge>
Expand Down Expand Up @@ -140,11 +143,11 @@ function RunDetailsPage() {
<div className="flex flex-1 items-center gap-3">
<div className="flex flex-col items-center gap-2">
<StatusIcon
className={`size-5 ${iconColor} ${
step.status === "running"
? "animate-spin"
: ""
}`}
className={cn(
"size-5",
iconColor,
step.status === "running" && "animate-spin",
)}
/>
{index < steps.length - 1 && (
<div className="bg-border h-8 w-0.5" />
Expand All @@ -158,7 +161,10 @@ function RunDetailsPage() {
</span>
<Badge
variant="outline"
className={`border-border text-xs capitalize ${getStatusBadgeClass(step.status)}`}
className={cn(
"border-border text-xs capitalize",
getStatusBadgeClass(step.status),
)}
>
{step.status}
</Badge>
Expand All @@ -179,7 +185,10 @@ function RunDetailsPage() {
</div>

<CaretDownIcon
className={`text-muted-foreground size-5 transition-transform ${isExpanded ? "rotate-180" : ""}`}
className={cn(
"text-muted-foreground size-5 transition-transform",
isExpanded && "rotate-180",
)}
/>
</button>

Expand Down
15 changes: 15 additions & 0 deletions packages/dashboard/src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
--accent: oklch(0.967 0.001 286.375);
--accent-foreground: oklch(0.21 0.006 285.885);
--destructive: oklch(0.577 0.245 27.325);
--success: oklch(0.723 0.219 149.579);
--info: oklch(0.623 0.214 259.815);
--warning: oklch(0.795 0.184 86.047);
--sleeping: oklch(0.627 0.265 303.9);
--neutral: oklch(0.551 0.027 264.364);
--border: oklch(0.92 0.004 286.32);
--input: oklch(0.92 0.004 286.32);
--ring: oklch(0.705 0.015 286.067);
Expand Down Expand Up @@ -56,6 +61,11 @@
--accent: oklch(0.274 0.006 286.033);
--accent-foreground: oklch(0.985 0 0);
--destructive: oklch(0.704 0.191 22.216);
--success: oklch(0.723 0.219 149.579);
--info: oklch(0.623 0.214 259.815);
--warning: oklch(0.795 0.184 86.047);
--sleeping: oklch(0.627 0.265 303.9);
--neutral: oklch(0.705 0.015 286.067);
--border: oklch(1 0 0 / 10%);
--input: oklch(1 0 0 / 15%);
--ring: oklch(0.552 0.016 285.938);
Expand Down Expand Up @@ -93,6 +103,11 @@
--color-input: var(--input);
--color-border: var(--border);
--color-destructive: var(--destructive);
--color-success: var(--success);
--color-info: var(--info);
--color-warning: var(--warning);
--color-sleeping: var(--sleeping);
--color-neutral: var(--neutral);
--color-accent-foreground: var(--accent-foreground);
--color-accent: var(--accent);
--color-muted-foreground: var(--muted-foreground);
Expand Down