fix: sort thread list newest-first and differentiate status colors
- Sort threads by startedAt descending (newest first) - completed: green (dimmed) — distinct from running (green, full opacity) - active: accent color (blue) — was same muted gray as completed - failed: red — unchanged - running: green — unchanged Fixes #191
This commit is contained in:
@@ -13,7 +13,10 @@ export function ThreadList({ agent, onSelect }: Props) {
|
||||
return <p style={{ color: "var(--color-text-muted)" }}>Loading threads...</p>;
|
||||
if (status === "error") return <p style={{ color: "var(--color-error)" }}>Error: {error}</p>;
|
||||
|
||||
const threads = data.threads;
|
||||
const threads = [...data.threads].sort((a, b) => {
|
||||
if (!a.startedAt || !b.startedAt) return 0;
|
||||
return b.startedAt.localeCompare(a.startedAt);
|
||||
});
|
||||
|
||||
return (
|
||||
<div>
|
||||
@@ -43,8 +46,11 @@ export function ThreadList({ agent, onSelect }: Props) {
|
||||
? "var(--color-success)"
|
||||
: t.status === "failed"
|
||||
? "var(--color-error)"
|
||||
: "var(--color-text-muted)",
|
||||
: t.status === "completed"
|
||||
? "var(--color-success)"
|
||||
: "var(--color-accent)",
|
||||
color: "#000",
|
||||
opacity: t.status === "completed" ? 0.7 : 1,
|
||||
}}
|
||||
>
|
||||
{t.status}
|
||||
|
||||
Reference in New Issue
Block a user