Skip to content

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.

fix(sidebar): restore working-badge test coverage, DRY the spinner color, group CSS rules

Mina Sameh599157d1999c
diff --git a/src/renderer/lib/sessionList.test.ts b/src/renderer/lib/sessionList.test.ts
index 7de94198b..e524e0cb8 100644
--- a/src/renderer/lib/sessionList.test.ts
+++ b/src/renderer/lib/sessionList.test.ts
@@ -142,7 +142,7 @@ describe('buildSessionList', () => {
})
describe('projectSignalCounts', () => {
- const group = (sessions: Partial<SessionRowVM>[]) => ({
+ const group = (sessions: Partial<SessionRowVM>[]): SessionGroup => ({
projectId: 'p1',
projectName: 'P',
projectColor: '#111',
@@ -171,8 +171,31 @@ describe('projectSignalCounts', () => {
expect(projectSignalCounts(g)).toEqual({ attention: 1, unread: 0, working: 2 })
})
- it('working is 0 when nothing is running', () => {
+ it('working is 0 when nothing is running, and unread is counted when not working', () => {
const g = group([{ statusKind: 'idle' }, { statusKind: 'done', unread: true }])
- expect(projectSignalCounts(g).working).toBe(0)
+ expect(projectSignalCounts(g)).toEqual({ attention: 0, unread: 1, working: 0 })
+ })
+
+ it('drives through buildSessionList: counts grouped sessions, attention wins over unread, working is not double-counted as unread', () => {
+ const proj: ProjectInput[] = [
+ {
+ id: 'p1',
+ name: 'Alpha',
+ color: '#111',
+ nodes: [
+ node('g1', { kind: 'group', title: 'Frontend', color: '#abc' }),
+ node('a1', { agentId: 'claude', parentId: 'g1' }), // attention + unread -> attention only
+ node('a2', { agentId: 'claude', parentId: 'g1' }), // working + unread -> working only
+ node('t1') // ungrouped, idle
+ ]
+ }
+ ]
+ const status: Record<string, AgentNodeStatus> = {
+ a1: { unread: true, state: 'blocked', agentId: 'claude', session: 'blocked task', sessionId: 'sess-a1' },
+ a2: { unread: true, state: 'working', agentId: 'claude', session: 'working task', sessionId: 'sess-a2' }
+ }
+ const [p1] = buildSessionList(proj, null, 'p1', status, '')
+ expect(p1.groups[0].sessions.map((s) => s.id)).toEqual(['a1', 'a2']) // sanity: sessions really live under group.groups
+ expect(projectSignalCounts(p1)).toEqual({ attention: 1, unread: 0, working: 1 })
})
})
diff --git a/src/renderer/styles.css b/src/renderer/styles.css
index 46853d09c..46de2d734 100644
--- a/src/renderer/styles.css
+++ b/src/renderer/styles.css
@@ -17,6 +17,10 @@
(A white that sits on a saturated ACCENT fill is a different thing and stays `#fff`.) */
--text-strong: #fff;
+ /* Working (agent mid-turn) accent: the clay spinner/glow color, shared by every "working"
+ indicator (node glow, sidebar dot, project-header badge) so it only has to be edited once. */
+ --agent-working: #d97757;
+
--bg: #1e1e1e; /* content / canvas / terminal (controlBackground) */
--panel: #282828; /* bars, panels, node chrome (underPage) */
--panel-header: #323232; /* elevated / hover (windowBackground) */
@@ -6282,17 +6286,7 @@ body,
.ss-bell svg { width: 13px; height: 13px; }
.ss-dot--working {
background: transparent;
- border: 2px solid #d97757;
- border-top-color: transparent;
- animation: nt-spin 1s steps(12, end) infinite;
-}
-.ss-group__sig--working { color: #d97757; }
-.ss-group__sig-spin {
- display: inline-block;
- width: 7px;
- height: 7px;
- border-radius: 50%;
- border: 1.5px solid #d97757;
+ border: 2px solid var(--agent-working);
border-top-color: transparent;
animation: nt-spin 1s steps(12, end) infinite;
}
@@ -6377,6 +6371,16 @@ body,
.ss-group__sig svg { width: 11px; height: 11px; }
.ss-group__sig--attention { color: var(--danger); }
.ss-group__sig--unread { color: var(--accent); }
+.ss-group__sig--working { color: var(--agent-working); }
+.ss-group__sig-spin {
+ display: inline-block;
+ width: 7px;
+ height: 7px;
+ border-radius: 50%;
+ border: 1.5px solid var(--agent-working);
+ border-top-color: transparent;
+ animation: nt-spin 1s steps(12, end) infinite;
+}
.ss-group__add { margin-left: auto; opacity: 0; border: none; background: transparent; color: var(--text); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; }
.ss-group__head:hover .ss-group__add { opacity: 0.7; }
.ss-group__add:hover { opacity: 1 !important; color: var(--accent); }