Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.
TypeScript adhdagent-orchestrationai-agentscanvasclaude-codecodexcoding-agentsdeveloper-toolselectrongeminilinuxmacosmultiplexeropencodeparallel-agentsterminalterminal-emulatorterminal-multiplexertmuxworkspace-manager
fix(sidebar): keep 'done' its own status, not attention (#230, user decision)
enes9f900a1bbe3a
diff --git a/src/renderer/lib/sessionList.test.ts b/src/renderer/lib/sessionList.test.tsindex a39ccafd4..866899dc6 100644--- a/src/renderer/lib/sessionList.test.ts+++ b/src/renderer/lib/sessionList.test.ts@@ -36,7 +36,8 @@ describe('sessionStatusKind', () => {expect(sessionStatusKind('working')).toBe('working')expect(sessionStatusKind('waiting')).toBe('attention')expect(sessionStatusKind('blocked')).toBe('attention')- expect(sessionStatusKind('done')).toBe('attention')+ // A done turn is its OWN kind, not attention: the unread mark already carries "new for you".+ expect(sessionStatusKind('done')).toBe('done')expect(sessionStatusKind(undefined)).toBe('unknown')})})@@ -340,7 +341,7 @@ describe('projectSignalCounts', () => {node('g1', { kind: 'group', title: 'G', color: '#abc' }),node('a'), // waiting → attentionnode('b', { parentId: 'g1' }), // blocked → attention- node('c'), // done + unread → attention (workflow state wins)+ node('c'), // done + unread → unread ('done' is not attention; unread carries the signal)node('d'), // unknown + unread → unread (state lost, unread persisted)node('e'), // working + unread → NOT counted (mirrors the row glyph precedence)node('f') // plain unknown → neither@@ -356,8 +357,9 @@ describe('projectSignalCounts', () => {}const [g] = buildSessionList(proj, null, 'p1', status, '')// `e` is the load-bearing one: it is the single working session AND carries an unread mark,- // so it must land in `working` and NOT in `unread`.- expect(projectSignalCounts(g)).toEqual({ attention: 3, unread: 1, working: 1 })+ // so it must land in `working` and NOT in `unread`. `c` (done+unread) now counts as unread,+ // not attention — the user's call: unread already signals "there's something new here".+ expect(projectSignalCounts(g)).toEqual({ attention: 2, unread: 2, working: 1 })})it('returns zeros for a quiet project', () => {@@ -415,7 +417,7 @@ describe('buildStatusList', () => {const status: Record<string, AgentNodeStatus> = {a1: { unread: false, state: 'waiting', lastEventAt: 100 }, // attention, oldesta2: { unread: false, state: 'blocked', lastEventAt: 300 }, // attention, newest- d1: { unread: false, state: 'done', lastEventAt: 200 }, // completed turn → attention+ d1: { unread: false, state: 'done', lastEventAt: 200 }, // completed turn → its own 'done' sectionw1: { unread: false, state: 'working', lastEventAt: 400 }, // workingi1: { unread: false } // unknown (no state or transition time)}@@ -435,15 +437,16 @@ describe('buildStatusList', () => {}]- it('groups by workflow status in the fixed order attention → unknown → working', () => {+ it('groups by workflow status in the fixed order attention → done → unknown → working', () => {const sections = buildStatusList(proj, null, 'p1', status, '')- expect(sections.map((s) => s.kind)).toEqual(['attention', 'unknown', 'working'])+ expect(sections.map((s) => s.kind)).toEqual(['attention', 'done', 'unknown', 'working'])})it('flattens across projects and tags each row with its project', () => {const sections = buildStatusList(proj, null, 'p1', status, '')const attention = sections.find((s) => s.kind === 'attention')!- expect(attention.rows.map((r) => r.id).sort()).toEqual(['a1', 'a2', 'd1'])+ expect(attention.rows.map((r) => r.id).sort()).toEqual(['a1', 'a2'])+ expect(sections.find((s) => s.kind === 'done')!.rows.map((r) => r.id)).toEqual(['d1'])const a1 = attention.rows.find((r) => r.id === 'a1')!expect(a1.projectId).toBe('p1')expect(a1.projectName).toBe('Alpha')@@ -455,11 +458,12 @@ describe('buildStatusList', () => {it('sorts rows within a section by descending state-change time', () => {const sections = buildStatusList(proj, null, 'p1', status, '')+ // a2 (300) before a1 (100); d1 now sits in its own 'done' section, not between them.expect(sections.find((s) => s.kind === 'attention')!.rows.map((r) => r.id)).toEqual(['a2',- 'd1','a1'])+ expect(sections.find((s) => s.kind === 'done')!.rows.map((r) => r.id)).toEqual(['d1'])})it('keeps only terminal nodes (drops stickies/editors)', () => {@@ -478,20 +482,21 @@ describe('buildStatusList', () => {it('keeps empty sections while filtering rows by title/session', () => {// 'runner' only matches w1 (working)const filtered = buildStatusList(proj, null, 'p1', status, 'runner')- expect(filtered.map((s) => s.kind)).toEqual(['attention', 'unknown', 'working'])+ expect(filtered.map((s) => s.kind)).toEqual(['attention', 'done', 'unknown', 'working'])expect(filtered.find((s) => s.kind === 'working')!.rows.map((r) => r.id)).toEqual(['w1'])expect(filtered.filter((s) => s.kind !== 'working').every((s) => s.rows.length === 0)).toBe(true)})it('returns every section even when some headers have no sessions', () => {- // Waiting + done both land in attention; unknown/working stay present and empty.+ // Waiting → attention, done → its own section; unknown/working stay present and empty.const onlyTwo: ProjectInput[] = [{ id: 'p1', name: 'Alpha', color: '#111', nodes: [node('a1'), node('d1')] }]const two: Record<string, AgentNodeStatus> = { a1: { unread: false, state: 'waiting' }, d1: { unread: false, state: 'done' } }const sections = buildStatusList(onlyTwo, null, 'p1', two, '')- expect(sections.map((s) => s.kind)).toEqual(['attention', 'unknown', 'working'])- expect(sections.find((s) => s.kind === 'attention')!.rows.map((row) => row.id).sort()).toEqual(['a1', 'd1'])+ expect(sections.map((s) => s.kind)).toEqual(['attention', 'done', 'unknown', 'working'])+ expect(sections.find((s) => s.kind === 'attention')!.rows.map((row) => row.id)).toEqual(['a1'])+ expect(sections.find((s) => s.kind === 'done')!.rows.map((row) => row.id)).toEqual(['d1'])expect(sections.find((s) => s.kind === 'unknown')!.rows).toEqual([])expect(sections.find((s) => s.kind === 'working')!.rows).toEqual([])})@@ -503,9 +508,13 @@ describe('buildStatusList', () => {w1: { unread: true, state: 'working' }}const sections = buildStatusList(proj, null, 'p1', glowing, '')- const attention = sections.find((s) => s.kind === 'attention')!- expect(attention.label).toBe('Waiting for your response')- expect(attention.rows.map((r) => r.id)).toEqual(['d1'])+ // d1 is done (+unread) → the Done section, NOT attention. Unread is carried on the row, not+ // in the workflow bucket.+ expect(sections.find((s) => s.kind === 'attention')!.rows).toEqual([])+ const done = sections.find((s) => s.kind === 'done')!+ expect(done.label).toBe('Done')+ expect(done.rows.map((r) => r.id)).toEqual(['d1'])+ expect(done.rows[0].unread).toBe(true)// Unread alone is not a workflow state; a live turn is still Running.expect(sections.find((s) => s.kind === 'unknown')!.rows.map((r) => r.id)).toContain('i1')expect(sections.find((s) => s.kind === 'working')!.rows.map((r) => r.id)).toEqual(['w1'])diff --git a/src/renderer/lib/sessionList.ts b/src/renderer/lib/sessionList.tsindex a376be2ae..8c51295a0 100644--- a/src/renderer/lib/sessionList.ts+++ b/src/renderer/lib/sessionList.ts@@ -25,7 +25,7 @@ export interface ProjectInput {nodes: SessionNodeInput[]}-export type StatusKind = 'working' | 'attention' | 'unknown'+export type StatusKind = 'working' | 'attention' | 'done' | 'unknown'/** Sessions sidebar top-level grouping mode. */export type SidebarGrouping = 'project' | 'status'@@ -33,6 +33,7 @@ export type SidebarGrouping = 'project' | 'status'const STATE_LABEL: Record<StatusKind, string> = {working: 'Running',attention: 'Waiting for your response',+ done: 'Done',unknown: 'Unknown'}@@ -51,7 +52,7 @@ export function groupCollapseKey(projectId: string, groupId: string): string {* top; working sinks to the bottom (a turn in flight is the least urgent to revisit). Unknown sits* between them: there is no current hook signal on which to infer a workflow state.*/-const STATUS_ORDER: StatusKind[] = ['attention', 'unknown', 'working']+const STATUS_ORDER: StatusKind[] = ['attention', 'done', 'unknown', 'working']/*** Whether a project row is collapsed in the sessions sidebar. `settings.sidebarAutoCollapse`@@ -155,8 +156,13 @@ export function sessionStatusKind(state: AgentNodeStatus['state']): StatusKind {return 'working'case 'waiting':case 'blocked':- case 'done':return 'attention'+ case 'done':+ // A finished turn is NOT an attention signal: the `unread` mark already carries "there is+ // something new for you here" (see SessionRow), and escalating every completed turn to the+ // red attention bell + project badge double-counts that. `done` is its own status — a+ // finished check in project mode, its own section in status mode.+ return 'done'default:return 'unknown'}diff --git a/src/renderer/styles.css b/src/renderer/styles.cssindex e5c0485dc..de0609a53 100644--- a/src/renderer/styles.css+++ b/src/renderer/styles.css@@ -6402,6 +6402,9 @@ body,.ss-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex: 0 0 auto; }.ss-dot--unknown { background: var(--muted-2); }+/* A finished turn the user has already seen: a quiet, filled success dot (the unread state+ promotes to the pulsing check instead — see SessionRow). */+.ss-dot--done { background: var(--success); }.ss-check { color: var(--success); margin-top: 2px; flex: 0 0 auto; line-height: 0; }/* Unread: the same check, accent-blue and pulsing until the user visits the node. */.ss-check--unread { color: var(--accent); animation: nt-pulse 1.1s ease-in-out infinite; }