From f87cb38a67e316bc62cdd38018831b2940b68e76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=A9=98?= Date: Mon, 11 May 2026 12:14:51 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20review=20=E2=80=94=20stable=20sort=20fal?= =?UTF-8?q?lback,=20cleaner=20status=20colors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Sort: threads without startedAt pushed to bottom (not random) - Colors: completed=success(green), running/active=accent(blue), failed=error(red) - Remove opacity hack, simplify ternary 小橘 --- .../workflow-dashboard/src/components/thread-list.tsx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/workflow-dashboard/src/components/thread-list.tsx b/packages/workflow-dashboard/src/components/thread-list.tsx index f14ca57..01fdf5d 100644 --- a/packages/workflow-dashboard/src/components/thread-list.tsx +++ b/packages/workflow-dashboard/src/components/thread-list.tsx @@ -14,7 +14,9 @@ export function ThreadList({ agent, onSelect }: Props) { if (status === "error") return

Error: {error}

; const threads = [...data.threads].sort((a, b) => { - if (!a.startedAt || !b.startedAt) return 0; + if (!a.startedAt && !b.startedAt) return 0; + if (!a.startedAt) return 1; + if (!b.startedAt) return -1; return b.startedAt.localeCompare(a.startedAt); }); @@ -42,15 +44,12 @@ export function ThreadList({ agent, onSelect }: Props) { className="text-xs px-2 py-0.5 rounded" style={{ background: - t.status === "running" + t.status === "completed" ? "var(--color-success)" : t.status === "failed" ? "var(--color-error)" - : t.status === "completed" - ? "var(--color-success)" - : "var(--color-accent)", + : "var(--color-accent)", color: "#000", - opacity: t.status === "completed" ? 0.7 : 1, }} > {t.status}