Merge pull request 'fix: sort thread list newest-first and differentiate status colors' (#192) from fix/191-dashboard-thread-sort into main

This commit is contained in:
2026-05-11 12:16:19 +00:00
@@ -13,7 +13,12 @@ export function ThreadList({ agent, onSelect }: Props) {
return <p style={{ color: "var(--color-text-muted)" }}>Loading threads...</p>; return <p style={{ color: "var(--color-text-muted)" }}>Loading threads...</p>;
if (status === "error") return <p style={{ color: "var(--color-error)" }}>Error: {error}</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;
if (!a.startedAt) return 1;
if (!b.startedAt) return -1;
return b.startedAt.localeCompare(a.startedAt);
});
return ( return (
<div> <div>
@@ -39,11 +44,11 @@ export function ThreadList({ agent, onSelect }: Props) {
className="text-xs px-2 py-0.5 rounded" className="text-xs px-2 py-0.5 rounded"
style={{ style={{
background: background:
t.status === "running" t.status === "completed"
? "var(--color-success)" ? "var(--color-success)"
: t.status === "failed" : t.status === "failed"
? "var(--color-error)" ? "var(--color-error)"
: "var(--color-text-muted)", : "var(--color-accent)",
color: "#000", color: "#000",
}} }}
> >