Commit Graph
3 Commits
Author SHA1 Message Date
yuez 00c81a56f4 feat(web): persist session-dot acknowledgements across reloads
`flags.done`/`flags.error` are unread markers: the plugin keeps raising them
until nvim's own TabEnter, while `markSeen` only cleared them in the in-memory
store. The next snapshot — a reload, or a reconnect's resync — replayed the
flag, so a notification the user had already consumed blinked again and the
dot looked stuck on unread.

The acknowledgement is now durable in `localStorage` (`pi2-seen-sessions`, per
browser), recorded under the occurrence it was given for: the id of the
transcript's newest entry. A replayed snapshot ends on the same entry, so
ingress clears the flag; the next completed turn appends entries first, so its
token differs and that new notification blinks again. A row with no entries
cannot be scoped and keeps the in-memory-only behaviour. `removeSession`
forgets the ledger row and the `tmp-N` → real-id migration moves it. This stays
a client-side view concern — the wire, the reducer and `fixtures/` are
untouched.
2026-10-30 16:19:40 +08:00
yuez 2c44a19d57 docs: rewrite the session dot contract around DotView.blink
The old page documented the matrices but not the rule that kept breaking them:
blinking looked like a property of the colour, so a dim rule scoped to a
component was a valid reading of it. It now says outright that the rate is part
of the view — `{status, blink?, current?}` — that omitting `blink` means solid,
that `dot--steady` is gone, and that CSS may only decide when the shared clock
dims a blinking dot.

Adds what the code now covers and the page was missing: the task matrix
(`:PiTasks` parity, only `running` blinks), the head dot rendering the selected
row's `DotView` so one session cannot show two rates, a viewed failure being
solid, and a manifest-only `active` subagent being amber but steady because
nothing would ever acknowledge its blink.
2026-10-28 08:14:29 +08:00
yuez dcbda60165 docs: write down the session dot contract
The dot is a view of the plugin, and it drifted once already because the rule
lived only in code. docs/session-dot.md now records the parent/sub-session/
subagent matrices, the current marker, the unread-flag lifetime and the single
blink clock, with the pi2.nvim functions each rule mirrors.
2026-10-27 19:18:07 +08:00