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.

perf(canvas): bound working-edge flow and status dots; make Reduce Motion stop every loop

enesad29140baa74
diff --git a/src/renderer/styles.animation-gate.test.ts b/src/renderer/styles.animation-gate.test.ts
index cf51e42d1..39742f1a9 100644
--- a/src/renderer/styles.animation-gate.test.ts
+++ b/src/renderer/styles.animation-gate.test.ts
@@ -202,6 +202,49 @@ describe('idle-window animation gate', () => {
expect(keyframesBody(css, 'nt-pulse')).toMatch(/0%,\s*100%\s*\{\s*opacity:\s*1;\s*transform:\s*scale\(1\)/)
})
+ it('the subagent and loop card dots and the sidebar unread check are bounded (issue #1454)', () => {
+ // A FOCUSED window has no gate. Issue #1454 measured a canvas whose only running animations
+ // were these, the sessions sidebar's unread checks and four working-subagent edges: renderer
+ // 108 % and GPU 38 % with the window focused, 64 % / 3 % with them stopped. The cards still
+ // say "working" in text with a running timer; the sidebar row keeps its check. Four pulses mark
+ // the change, like every other status indicator. (The needs-you bell keeps pulsing on purpose:
+ // needs-you is the one state that must keep pulling the eye.)
+ for (const sel of [
+ '.subagent-node.working .subagent-node__dot',
+ '.loop-node.working .loop-node__dot',
+ '.ss-check--unread'
+ ]) {
+ const rule = ruleBody(css, sel)
+ expect(rule, sel).toMatch(/animation:\s*nt-pulse\s+1\.1s\s+ease-in-out\s+4\b/)
+ expect(rule, sel).not.toMatch(/infinite/)
+ }
+ })
+
+ it('working edges flow for a few seconds, then hold the dash (issue #1454)', () => {
+ // React Flow's `dashdraw` (0.5 s, infinite in its own sheet) ran for as long as a subagent or
+ // loop worked, and held a focused window's frame loop open by itself. The edge keeps its dash
+ // (xyflow's `stroke-dasharray`, untouched), so "dashed = working, solid = done" still reads;
+ // only the flow stops. Same specificity as xyflow's rule and later, so the longhand wins.
+ const stripped = css.replace(/\/\*[\s\S]*?\*\//g, '')
+ const importAt = stripped.indexOf("@import '@xyflow/react/dist/style.css'")
+ const bounded = [...stripped.matchAll(/([^{}]+)\{([^{}]*)\}/g)].find(
+ (m) =>
+ (m.index ?? 0) > importAt &&
+ m[1].split(',').map((s) => s.trim()).includes('.react-flow__edge.animated path') &&
+ /animation-iteration-count:/.test(m[2])
+ )
+ expect(bounded, 'no rule bounds .react-flow__edge.animated path').toBeDefined()
+ const count = Number(bounded![2].match(/animation-iteration-count:\s*(\d+)/)?.[1])
+ const vendor = fs
+ .readFileSync(createRequire(__filename).resolve('@xyflow/react/dist/style.css'), 'utf8')
+ .replace(/\r\n/g, '\n')
+ const seconds = Number(vendor.match(/\.react-flow__edge\.animated path\s*\{[^}]*animation:\s*dashdraw\s+([\d.]+)s/)?.[1])
+ expect(seconds).toBeGreaterThan(0)
+ expect(count * seconds).toBeGreaterThanOrEqual(2)
+ expect(count * seconds).toBeLessThanOrEqual(5)
+ expect(bounded![2]).not.toMatch(/stroke-dasharray/)
+ })
+
it('never pauses the notch HUD, whose window is never focused', () => {
// hud.css belongs to a separate always-on-top panel window that by design never takes focus,
// so the shared gate would freeze it permanently rather than while nobody is looking.
diff --git a/src/renderer/styles.css b/src/renderer/styles.css
index f60953cdc..9829864e5 100644
--- a/src/renderer/styles.css
+++ b/src/renderer/styles.css
@@ -218,14 +218,24 @@
untouched. `styles.animation-gate.test.ts` scans xyflow's sheet too, and fails if an upgrade adds
an infinite animation under a selector not listed here.
- This covers idle and covered only. A FOCUSED window still pays the full per-edge cost for as
- long as an edge works; a cheaper working-edge style is a separate design call, and the driven
- rope keeps flowing while focused by decision (see CLAUDE.md § Idle energy). */
+ That covers idle and covered. A FOCUSED window is the rule below. */
.react-flow__edge.animated path,
.react-flow__connection .animated {
animation-play-state: var(--nt-anim-state);
}
+/* Working edges flow for ~4 s (8 × xyflow's 0.5 s), then hold the dash (issue #1454). A focused
+ window has no gate, and a working subagent or loop edge — or the driven-browser rope — kept the
+ frame loop open by itself for as long as its work ran (measured in the issue: four edges, two
+ sidebar checks and four subagent dots held a focused window at 120 frames/s, renderer 108 % and
+ GPU 38 %; 64 % / 3 % with them stopped). Only the FLOW is bounded: xyflow's `stroke-dasharray`
+ stays, so dashed still means working and solid means done, and the driven rope keeps its clay
+ colour and weight. An edge that turns `animated` again flows again. Same selector as xyflow's rule,
+ later in order, so this longhand wins. The connection line a person is dragging keeps flowing. */
+.react-flow__edge.animated path {
+ animation-iteration-count: 8;
+}
+
/* ---- Light appearance ----------------------------------------------------------------------
Set by App.tsx from `settings.appTheme` (see lib/appTheme.ts); absent = dark, so an install
that never picks one is byte-for-byte unchanged.
@@ -8708,8 +8718,11 @@ button.group-node__setup:disabled {
background: #d97757;
}
+/* Bounded like every status indicator (issue #1454): looping, these dots held a FOCUSED window's
+ frame loop open for as long as a subagent worked. The card already says "working" in text with
+ a running timer; four pulses mark the change. nt-pulse ends at the dot's own look. */
.subagent-node.working .subagent-node__dot {
- animation: nt-pulse 1.1s ease-in-out infinite;
+ animation: nt-pulse 1.1s ease-in-out 4;
animation-play-state: var(--nt-anim-state);
}
@@ -8824,8 +8837,9 @@ button.group-node__setup:disabled {
background: var(--state-automation);
}
+/* Bounded for the same reason as the subagent dot above (issue #1454). */
.loop-node.working .loop-node__dot {
- animation: nt-pulse 1.1s ease-in-out infinite;
+ animation: nt-pulse 1.1s ease-in-out 4;
animation-play-state: var(--nt-anim-state);
}
@@ -10256,7 +10270,9 @@ button.group-node__setup:disabled {
.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(--state-unread); animation: nt-pulse 1.1s ease-in-out infinite; animation-play-state: var(--nt-anim-state); }
+/* Bounded like the node's own unread glow (issue #1454): a row stays unread until someone looks,
+ so a looping check held a focused window's frame loop open indefinitely. The check stays. */
+.ss-check--unread { color: var(--state-unread); animation: nt-pulse 1.1s ease-in-out 4; animation-play-state: var(--nt-anim-state); }
.ss-check svg { width: 13px; height: 13px; }
/* attention renders as a red bell (ss-bell) — "it's ringing for you". Gentle pulse,
same cadence as the header badge dot. */
@@ -18190,6 +18206,27 @@ body.focus-mode .dock:hover {
.minimap .mm-unread {
animation: none;
}
+ /* Issue #1454: these kept moving for a Reduce Motion user — the working-edge flow (xyflow's
+ sheet, so no block of ours ever named it), the subagent / loop dots, the sessions sidebar's
+ unread check and needs-you bell, the RAM panel's working dot, the board card's RUNNING chip,
+ the walking mascots and the "···" loading pulses. Each rests on its own static look: edges
+ stay dashed, dots and chips lit, the mascot on its first frame. Every selector here is later
+ than the rule it stops at the same specificity, so it wins on order. Enforced by
+ styles.reduced-motion.test.ts: a new repeating animation that is not stopped here (or
+ exempted there with a reason) fails it. */
+ .react-flow__edge.animated path,
+ .subagent-node.working .subagent-node__dot,
+ .loop-node.working .loop-node__dot,
+ .ss-check--unread,
+ .ss-bell,
+ .sessmem-row__dot--working,
+ .kanban-badge--running,
+ .term-node__mascot--claude,
+ .term-node__mascot--codex,
+ .usage-pill__pulse,
+ .sysres-pill__pulse {
+ animation: none;
+ }
}
/* ---- Needs-you under Liquid Glass: an inner light, not an outer pulse -------------------------
diff --git a/src/renderer/styles.reduced-motion.test.ts b/src/renderer/styles.reduced-motion.test.ts
new file mode 100644
index 000000000..d33386013
--- /dev/null
+++ b/src/renderer/styles.reduced-motion.test.ts
@@ -0,0 +1,155 @@
+import fs from 'node:fs'
+import { createRequire } from 'node:module'
+import path from 'node:path'
+import { describe, expect, it } from 'vitest'
+
+/**
+ * Reduce Motion is enforced by scan, for the same reason the idle gate is: it was added one
+ * selector at a time, so every new animation was one forgotten line away from ignoring it — and
+ * nothing fails when it does. Issue #1454: a Reduce Motion user's canvas still flowed four edges,
+ * pulsed four subagent dots and two sidebar checks, keeping a FOCUSED window at 120 frames/s
+ * (renderer 110 %, GPU 42 % with the OS setting on; 64 % / 3 % with those stopped).
+ *
+ * The rule: every REPEATING animation (`infinite`, or an iteration count of 2 or more) in
+ * styles.css must be turned off (`animation: none`) by a `@media (prefers-reduced-motion: reduce)`
+ * rule that names its selector — or be listed below with the reason it is not. A one-shot
+ * entrance animation is out of scope, and so is anything already inside a `no-preference` block.
+ */
+
+const css = fs
+ .readFileSync(path.join(__dirname, 'styles.css'), 'utf8')
+ .replace(/\r\n/g, '\n')
+ .replace(/\/\*[\s\S]*?\*\//g, '')
+
+/**
+ * Selectors whose reduce-motion rule is spelled differently, mapped to the selector that IS in a
+ * reduce block. Each mapping is checked: the covering selector must really be stopped there.
+ */
+const COVERED_BY: Record<string, string> = {
+ // Styled at (0,2,0); a bare `.term-node__status-dot` lost on specificity (see the comment in
+ // the reduce block), so the block names the parent class instead.
+ '.term-node__status--busy .term-node__status-dot': '.term-node__status .term-node__status-dot',
+ '.term-node__status--attention .term-node__status-dot': '.term-node__status .term-node__status-dot'
+}
+
+/** Repeating animations that deliberately keep moving under Reduce Motion, with the reason. */
+const EXEMPT: Record<string, string> = {
+ // Progress indicators exist only while a task the user started is running, and stopped they read
+ // as a hang. HIG: reduce motion, keep the meaning; a spinner IS the meaning.
+ '.ui-spinner': 'progress spinner',
+ '.dictation__spinner': 'progress spinner (transcribing)',
+ '.dictation__mic--active': 'live recording indicator while the user holds the mic',
+ '.term-node__upload-spin': 'progress spinner (upload)',
+ '.update-card__spinner': 'progress spinner (update download)',
+ '.scm-gen.is-generating': 'progress indicator (commit message being generated)',
+ '.ex-dl__spin': 'progress spinner (download)',
+ '.ex-dls__spin': 'progress spinner (download)',
+ '.usage-refresh.spin svg': 'progress spinner (refresh the user clicked)',
+ '.sessmem-panel__refresh.spin svg': 'progress spinner (refresh the user clicked)',
+ // Dead: the SDK chat node was removed (2026-07) and nothing renders these classes any more.
+ '.chat-node__badge--working': 'dead CSS (chat node removed)',
+ '.chat-node__badge--needs': 'dead CSS (chat node removed)',
+ '.chat-node__typing span': 'dead CSS (chat node removed)',
+ // KNOWN GAP: four setup-tour scenes the tour's own reduce block does not freeze yet. A transient
+ // tour, not a status, but they owe a readable final frame like the rest of the block.
+ '.ctx-menu.onb-menu': 'known gap: setup-tour scene',
+ '.onb-capsule': 'known gap: setup-tour scene',
+ '.onb-capsule__blob': 'known gap: setup-tour scene',
+ '.onb-notchpanel': 'known gap: setup-tour scene'
+}
+
+function blocks(marker: string): Array<[number, number]> {
+ const out: Array<[number, number]> = []
+ let i = 0
+ while ((i = css.indexOf(marker, i)) >= 0) {
+ const open = css.indexOf('{', i)
+ let depth = 0
+ let j = open
+ for (; j < css.length; j++) {
+ if (css[j] === '{') depth++
+ else if (css[j] === '}' && --depth === 0) break
+ }
+ out.push([open, j])
+ i = j
+ }
+ return out
+}
+
+const reduce = blocks('@media (prefers-reduced-motion: reduce)')
+const noPreference = blocks('@media (prefers-reduced-motion: no-preference)')
+const inside = (at: number, ranges: Array<[number, number]>): boolean => ranges.some(([a, b]) => at > a && at < b)
+const selectorsOf = (head: string): string[] => head.split(',').map((s) => s.trim().replace(/\s+/g, ' '))
+
+/** Every selector a reduce-motion block turns the animation off for. */
+function stoppedUnderReduce(): Set<string> {
+ const out = new Set<string>()
+ for (const [a, b] of reduce) {
+ for (const m of css.slice(a + 1, b).matchAll(/([^{}]+)\{([^{}]*)\}/g)) {
+ if (/animation(-name)?:\s*none/.test(m[2])) for (const s of selectorsOf(m[1])) out.add(s)
+ }
+ }
+ return out
+}
+
+/** `infinite`, or a bare iteration count of 2+ (parenthesised arguments such as steps(12) aside). */
+function repeats(body: string): boolean {
+ const value = body.match(/animation:\s*([^;]+)/)?.[1]
+ if (!value) return false
+ return value
+ .replace(/\([^)]*\)/g, '')
+ .split(/[\s,]+/)
+ .some((t) => t === 'infinite' || (/^\d+$/.test(t) && Number(t) >= 2))
+}
+
+function repeatingSelectors(): string[] {
+ const out: string[] = []
+ for (const m of css.matchAll(/([^{}]+)\{([^{}]*)\}/g)) {
+ const at = m.index ?? 0
+ if (!repeats(m[2]) || inside(at, reduce) || inside(at, noPreference)) continue
+ out.push(...selectorsOf(m[1]))
+ }
+ return out
+}
+
+describe('Reduce Motion stops every repeating animation', () => {
+ const stopped = stoppedUnderReduce()
+ const repeating = repeatingSelectors()
+
+ it('finds the repeating animations and the reduce blocks at all (non-vacuous)', () => {
+ expect(repeating.length).toBeGreaterThan(30)
+ expect(stopped.size).toBeGreaterThan(20)
+ // The ones issue #1454 measured are in the scanned set.
+ expect(repeating).toContain('.subagent-node.working .subagent-node__dot')
+ expect(repeating).toContain('.ss-check--unread')
+ })
+
+ it('names every repeating animation in a reduce rule, or exempts it with a reason', () => {
+ const missing = repeating.filter((sel) => {
+ if (sel in EXEMPT) return false
+ return !stopped.has(COVERED_BY[sel] ?? sel)
+ })
+ expect(
+ missing,
+ 'These animations keep moving for a Reduce Motion user. Add the selector to a\n' +
+ '`@media (prefers-reduced-motion: reduce)` rule with `animation: none` (and a static look if\n' +
+ 'the resting frame is not readable), or list it in EXEMPT with the reason.\n'
+ ).toEqual([])
+ })
+
+ it("stops React Flow's working-edge flow, which lives in xyflow's sheet", () => {
+ const vendor = fs.readFileSync(createRequire(__filename).resolve('@xyflow/react/dist/style.css'), 'utf8')
+ expect(vendor).toMatch(/\.react-flow__edge\.animated path\s*\{[^}]*animation:\s*dashdraw/)
+ expect(stopped.has('.react-flow__edge.animated path')).toBe(true)
+ })
+
+ it('keeps the exemption and alias lists honest', () => {
+ for (const sel of Object.keys(EXEMPT)) {
+ expect(repeating, `EXEMPT lists ${sel}, which no longer repeats`).toContain(sel)
+ expect(stopped.has(sel), `${sel} is stopped under Reduce Motion now — drop it from EXEMPT`).toBe(false)
+ }
+ for (const [sel, cover] of Object.entries(COVERED_BY)) {
+ expect(repeating, `COVERED_BY lists ${sel}, which no longer repeats`).toContain(sel)
+ expect(stopped.has(cover), `${sel} is said to be covered by ${cover}, which is not stopped`).toBe(true)
+ }
+ })
+})