Skip to content

Commit 46a08b3

Browse files
committed
replaced hardcoded status colors with token classes
1 parent 7e051bc commit 46a08b3

2 files changed

Lines changed: 11 additions & 18 deletions

File tree

apps/desktop-ui/components/board/batch-progress.tsx

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ interface BatchProgressProps {
2323
onViewActivity?: (taskId: string) => void
2424
}
2525

26-
const statusConfig: Record<string, { color: string; bg: string; icon: typeof Check; label: string; inlineColor?: string; inlineBg?: string }> = {
26+
const statusConfig: Record<string, { color: string; bg: string; icon: typeof Check; label: string; dot?: string }> = {
2727
queued: { color: BATCH_STATUS_COLORS.queued.text, bg: BATCH_STATUS_COLORS.queued.bg, icon: Clock, label: 'Queued' },
2828
running: { color: BATCH_STATUS_COLORS.running.text, bg: BATCH_STATUS_COLORS.running.bg, icon: Loader2, label: 'Running' },
29-
completed: { color: '', bg: '', inlineColor: BATCH_STATUS_COLORS.completed.text, inlineBg: BATCH_STATUS_COLORS.completed.bg, icon: Check, label: 'Done' },
30-
failed: { color: '', bg: '', inlineColor: BATCH_STATUS_COLORS.failed.text, inlineBg: BATCH_STATUS_COLORS.failed.bg, icon: AlertCircle, label: 'Failed' },
31-
skipped: { color: '', bg: '', inlineColor: BATCH_STATUS_COLORS.skipped.text, inlineBg: BATCH_STATUS_COLORS.skipped.bg, icon: SkipForward, label: 'Skipped' },
29+
completed: { color: BATCH_STATUS_COLORS.completed.text, bg: BATCH_STATUS_COLORS.completed.bg, icon: Check, label: 'Done', dot: BATCH_STATUS_COLORS.completed.dot },
30+
failed: { color: BATCH_STATUS_COLORS.failed.text, bg: BATCH_STATUS_COLORS.failed.bg, icon: AlertCircle, label: 'Failed', dot: BATCH_STATUS_COLORS.failed.dot },
31+
skipped: { color: BATCH_STATUS_COLORS.skipped.text, bg: BATCH_STATUS_COLORS.skipped.bg, icon: SkipForward, label: 'Skipped' },
3232
cancelled: { color: BATCH_STATUS_COLORS.cancelled.text, bg: BATCH_STATUS_COLORS.cancelled.bg, icon: Ban, label: 'Cancelled' },
3333
}
3434

@@ -54,20 +54,15 @@ export function BatchProgress({ batchId, status, mode, tasks, prUrl, onCancel, o
5454
<div
5555
className={cn(
5656
"w-2 h-2 rounded-full",
57-
status !== 'completed' && status !== 'failed' && 'bg-linear-border-hover'
57+
status === 'completed' ? statusConfig.completed.dot
58+
: status === 'failed' ? statusConfig.failed.dot
59+
: 'bg-linear-border-hover'
5860
)}
59-
style={
60-
status === 'completed'
61-
? { backgroundColor: BATCH_STATUS_COLORS.completed.dot }
62-
: status === 'failed'
63-
? { backgroundColor: BATCH_STATUS_COLORS.failed.dot }
64-
: undefined
65-
}
6661
/>
6762
)}
6863
<span className="text-sm text-linear-text">
6964
{mode === 'queue' ? 'Queue' : 'Parallel'} Issues: {completed}/{total} complete
70-
{failed > 0 && <span className="ml-1" style={{ color: BATCH_STATUS_COLORS.failed.text }}>({failed} failed)</span>}
65+
{failed > 0 && <span className={cn("ml-1", BATCH_STATUS_COLORS.failed.text)}>({failed} failed)</span>}
7166
</span>
7267
{expanded ? (
7368
<ChevronUp className="w-3.5 h-3.5 text-linear-text-tertiary" />
@@ -139,7 +134,6 @@ export function BatchProgress({ batchId, status, mode, tasks, prUrl, onCancel, o
139134
<div
140135
key={task.taskId}
141136
className={cn("h-1.5 flex-1 rounded-full", cfg.bg)}
142-
style={cfg.inlineBg ? { backgroundColor: cfg.inlineBg } : undefined}
143137
/>
144138
)
145139
})}
@@ -159,7 +153,6 @@ export function BatchProgress({ batchId, status, mode, tasks, prUrl, onCancel, o
159153
<div className="flex items-center gap-3">
160154
<Icon
161155
className={cn("w-4 h-4 flex-shrink-0", cfg.color, task.status === 'running' && 'animate-spin')}
162-
style={cfg.inlineColor ? { color: cfg.inlineColor } : undefined}
163156
/>
164157
<span className="text-sm text-linear-text truncate flex-1">{task.title}</span>
165158
<button

apps/desktop-ui/lib/design-tokens.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ export const BRAND_COLORS = {
130130
export const BATCH_STATUS_COLORS = {
131131
queued: { text: "text-linear-text-tertiary", bg: "bg-linear-border" },
132132
running: { text: "text-linear-accent", bg: "bg-linear-accent" },
133-
completed: { text: "#4a7c5c", bg: "#1f3a2a", dot: "#2d5a3d" },
134-
failed: { text: "#8b5a5a", bg: "#3d2626", dot: "#5a2d2d" },
135-
skipped: { text: "#7c6a4a", bg: "#3d3526" },
133+
completed: { text: "text-green-400", bg: "bg-green-500/10", dot: "bg-green-500" },
134+
failed: { text: "text-red-400", bg: "bg-red-500/10", dot: "bg-red-500" },
135+
skipped: { text: "text-amber-400", bg: "bg-amber-500/10" },
136136
cancelled: { text: "text-linear-text-tertiary", bg: "bg-linear-border-hover" },
137137
} as const

0 commit comments

Comments
 (0)