fix(web): let the view decide the blink, not the CSS colour class
A dot's animation was keyed on its colour class plus a component wrapper: `html[data-pi-blink-fast="dim"] .tree-row .dot--ok` made green blink only inside the session tree, `.dot--busy`/`.dot--err` blazed everywhere they appeared, and `dot--steady` existed only to subtract what that selector had just added. Two consequences the matrix in docs/session-dot.md already forbids: a failed task's red blinked forever with no gesture to acknowledge it, and the same session could blink in the list and sit solid in the stream head. `DotView` now carries the rate (`blink: "fast" | "slow"`, omitted = solid) next to the colour, and `<StatusDot>` renders it as `dot--blink-fast` / `dot--blink-slow`. `dot--steady` is gone — to make a dot solid you omit `blink`. app.css keeps exactly two dim rules, with no colour or component scoping and no knowledge of *whether* anything blinks, only of when the shared clock dims it. Filling in the matrix this exposed: parent `err`/`ok`/`busy` blink fast and `compacting` slow; a viewed child or subagent failure is solid while an unviewed one blinks; `interrupted` is the same solid dead red as `exited` (the plugin has no interrupted, and in the plugin `exited` outranks its own unread flags — `sessionDot(active)` is now rendered `viewed: true` for the stream head, so one session can never show two different rates); task dots follow `:PiTasks` (`taskDotView`, shared by the tray and the output modal) where only `running` blinks, `completed` is solid green and `stopped` is amber attention. The `/status` task card renders the same colours, solid, since nothing there acknowledges anything.
This commit is contained in:
1 parent
604fec5ea0
commit
e7ce064817
16 files changed
+658
-139
No files matched your search
+11
-2
@@ -126,6 +126,10 @@ function ChatExperience({ sessionId }: { sessionId?: string }) {
|
||||
if (!viewedSessionId || (!viewedDone && !viewedError)) return;
|
||||
useSessionsStore.getState().markSeen(viewedSessionId);
|
||||
}, [viewedSessionId, viewedDone, viewedError]);
|
||||
// The stream head shows the same session the selected tree row does, so it
|
||||
// renders that row's `DotView` (`viewed: true`) rather than re-deriving a
|
||||
// colour: one session must never show two different blink rates.
|
||||
const headDot = active ? sessionDot(active, { viewed: true }) : null;
|
||||
const history = useSessionHistory(
|
||||
active?.sessionId,
|
||||
active?.entries ?? NO_ENTRIES,
|
||||
@@ -544,8 +548,13 @@ function ChatExperience({ sessionId }: { sessionId?: string }) {
|
||||
</button>
|
||||
) : null}
|
||||
<div className="stream-title">
|
||||
{active ? (
|
||||
<StatusDot status={sessionDot(active).status} title={t(`state.${sessionStatusKey(active)}`)} />
|
||||
{active && headDot ? (
|
||||
<StatusDot
|
||||
status={headDot.status}
|
||||
blink={headDot.blink}
|
||||
current={headDot.current}
|
||||
title={t(`state.${sessionStatusKey(active)}`)}
|
||||
/>
|
||||
) : null}
|
||||
<h2 className="stream-name truncate" tabIndex={-1} ref={streamNameRef}>
|
||||
{active ? activeTitle?.text : (workspace?.name ?? t("nav.chat"))}
|
||||
|
||||
Reference in new issue
Block a user