test(web): pin the dot matrix, the shared blink clock and markSeen

sessionDot had no test at all, which is how its priority order drifted away
from the plugin. session-dot.test.ts locks the whole matrix: the parent
order (exited > error > attention > done > busy > compacting > idle), every
collision that used to be wrong, the viewed -> current overlay, the separate
child matrix (steady red while viewed, never green, never attention) and the
subagent table.

blink.test.ts covers the one shared clock: phase lockstep, ref counting
(two subscribers, one interval), idempotent unsubscribe, and
prefers-reduced-motion pinning the dots solid.

chat.tree.test.tsx grows up from "a .dot exists" to the actual classes;
sessions-store.test.ts covers markSeen; components.test.tsx covers the dead
status and the steady/current modifiers.

Also makes the current-tab overlay a positive check (idle | busy |
compacting), matching the plugin markable list: a session that has not
reported a status yet ("starting") no longer claims the blue marker.
This commit is contained in:
yuez committed 2026-10-27 19:00:26 +08:00
1 parent bf01fd549d
commit c4d0057b0b
6 files changed
+965 -16

No files matched your search

+3 -1
View File
@@ -466,7 +466,9 @@ export interface DotView {
function withCurrent(view: DotView, state: SessionState, viewed: boolean): DotView {
if (!viewed) return view;
if (state.flags.error || state.flags.done || attentionPending(state)) return view;
if (state.status === "exited" || state.status === "interrupted") return view;
// The plugin's `markable` is a positive list: only a live session carries the
// marker, and a `compacting` one blinks at the busy rate under it.
if (state.status !== "idle" && state.status !== "busy" && state.status !== "compacting") return view;
return { current: true, status: state.status === "compacting" ? "busy" : view.status };
}