From 393569290e434f0ce31f7a78f090101348f807ae Mon Sep 17 00:00:00 2001 From: dimakis Date: Tue, 5 May 2026 22:19:16 +0100 Subject: [PATCH 1/2] feat(ui): task board redesign with state-colored cards and attention sorting Contextual loop controls, attend-tier sorting, progressive fade for completed tasks, token usage display, and show-all toggle. Co-Authored-By: Claude Opus 4.6 --- frontend/src/components/LoopControls.tsx | 143 +++++++---- frontend/src/components/SessionOverview.tsx | 15 +- frontend/src/components/TaskNode.tsx | 81 +++++- frontend/src/hooks/useTaskBoard.ts | 175 ++++++++++++- frontend/src/lib/formatTime.ts | 9 + frontend/src/pages/TaskBoard.tsx | 16 +- frontend/src/styles/global.css | 260 +++++++++++++++----- 7 files changed, 557 insertions(+), 142 deletions(-) diff --git a/frontend/src/components/LoopControls.tsx b/frontend/src/components/LoopControls.tsx index 0ada829f..d005d80a 100644 --- a/frontend/src/components/LoopControls.tsx +++ b/frontend/src/components/LoopControls.tsx @@ -1,10 +1,12 @@ import { useState } from 'react'; import type { LoopStatus } from '../types/task'; import type { Task } from '../types/task'; +import { formatTokens } from '../lib/formatTokens'; interface LoopControlsProps { loopStatus: LoopStatus; goals: Task[]; + totalTokenUsage: number; onStart: (goalId: string, specMode?: boolean) => void; onPause: () => void; onResume: () => void; @@ -13,15 +15,10 @@ interface LoopControlsProps { onRejectSpec: () => void; } -const STATE_LABELS: Record = { - idle: 'Idle', - running: 'Running', - paused: 'Paused', -}; - export function LoopControls({ loopStatus, goals, + totalTokenUsage, onStart, onPause, onResume, @@ -29,26 +26,27 @@ export function LoopControls({ onApproveSpec, onRejectSpec, }: LoopControlsProps) { + const [pickerOpen, setPickerOpen] = useState(false); const [selectedGoalId, setSelectedGoalId] = useState(''); const [specMode, setSpecMode] = useState(false); const { state, progress, awaitingApproval } = loopStatus; - return ( -
-
- - {STATE_LABELS[state]} - - {progress && ( - - {progress.done}/{progress.total} - - )} -
+ // ── Idle: compact trigger / expanded picker ── + if (state === 'idle') { + if (!pickerOpen) { + return ( +
+ +
+ ); + } - {state === 'idle' && ( -
+ return ( +
+