Repository navigation
fix(shell): Stop the thinking ellipsis painting over speech, and make it a thought bubble - #146
Conversation
One #bubble in one of two modes. As two elements anchored to the same head they crossfaded over each other: a bubble's exit was keyed on `fade_ms`, the Character's presence fade, which rides every frame long after the rule that set it and outlasts the grace before the indicator arrives. The indicator is now a thought bubble — round, a trail of dots for a tail, and dots that dip rather than vanish — so it no longer reads as speech. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Review notesReviewed Nothing was changed on top of Carried in the description's Notes, and the substance of the review:
Smaller things not worth a Notes entry:
Verified by hand: |
Why
Two defects, reported together: the Thinking ellipsis painted on top of the
Speech bubble, and the ellipsis itself read as speech rather than as thought.
The overlap did not come from the decision layer.
createBubbleMachine()insrc/bubble.jsalready refuses to have both up at once. It came from the DOM:#bubbleand#thinking-bubblewere two elements anchored to the same head,and each latched
visibility: hiddenbehind asetTimeoutkeyed onlatest.fade_ms. That is the Character's presence fade fromcrates/core/src/visibility.rs— set only when presence changes, but returnedon every tick, so once any fullscreen application has come and gone it stays at
500ms for the rest of the session. A dismissed Speech bubble then stayed
painted for half a second; the grace before the indicator arrives is 250ms.
250ms of overlap.
The second element caused the look too.
.bubble::afterwas unqualified, sothe thinking bubble wore the Speech bubble's pointed tail, and its dots
animated
scale(0) → scale(1)— a dot that leaves reads as art failing toload, not as waiting.
What changed
#thinking-bubbleis gone. One#bubblein one of two modes, named bydata-mode, so the overlap is unrepresentable in the DOM rather than merelyruled out by the machine upstream of it. A hand-off is a content swap, not a
race between two fades.
positionBubble, the--tail-offsetand.flippedall now act on the one element, and both modes carry their own tail geometry.
The
fade_ms-keyedvisibility: hiddenlatch went with it — nothing butopacity gates the bubble now, and
hide()is one line.hideAllNow(), thehide hotkey's path, runs through that same
hide().The ellipsis got the thought idiom: round silhouette, a trail of two shrinking
circles where speech has a pointed tail, and dots that dip
0.35 ↔ 1with a3px lift rather than vanishing. Opacity and transform only, so it composites
without repainting — the overlay sits over whatever the user is doing.
Deliberately not done:
main.jsstill writesbubble.style.transitionfromlatest.fade_msevery frame, so the bubble's own show/hide fade is stilltimed by the presence fade. See Notes.
How to verify
Reviewer-runnable, both green on
8c68129in a clean checkout:The machine tests were remodelled around the single surface, and the new test
(
the bubble's one surface is never taken back off the wrong one) walks aturn that starts while a reply is still being read.
Mutation check on the harness, run during review — deleting the
hideThinkingNow()that precedesio.showSpeech()insrc/bubble.jsfails 2of the 23 tests. The harness bites.
By hand, for the parts no test reaches: run the app, Poke to raise the
ellipsis, let a reply land, and Poke again during the reading window. Then open
a fullscreen application and close it — that is what latches
fade_msat500ms and what used to produce the overlap.
Notes
No failing test came first. The bug is in the DOM layer and the repository
has no jsdom seam, so there was no honest red step: nothing in
node --testcan observe two elements painted at once. The machine was already correct and
its tests already passed. What the tests do now is pin the model the fix
assumes — one surface — not the pixels. The CSS was verified by eye only;
there is no regression test for the silhouette, the trail, or the dot
animation, and there is no cheap way to add one without pulling in a headless
browser.
fade_msstill reaches the bubble. Every frame,src/main.jssets thebubble's inline
transitiontoopacity <fade_ms>ms linear, and that inlinerule overrides
.bubble { transition: opacity 300ms ease }inmain.css. So the authored 300ms show/hide fade never runs: in asession with no fullscreen application
fade_msis 0 and every bubble snapsin and out, and after one fullscreen cycle it becomes a 500ms linear fade. The
overlap this PR fixes is gone either way — one element cannot overlap itself —
but the coupling the description calls out as the root cause is only half
removed. Untangling it needs two independent opacity gates on one element
(presence versus bubble), which is a design decision, not a cleanup, so it is
left here rather than taken silently.
The
show()comment reads as thoughfade_mswere gone. Given the lineabove, it is worth a sentence pointing at it.
The new test overlaps an existing one.
a new turn waits behind a displayed reply, indicator only after it hidesalready covers the same sequence viacalls; the new test differs mainly in asserting surface state. The harnessalso dropped its old
exclusive()invariant, which asserted mutual exclusionon every show across every scenario for free. Restoring it in single-surface
form was tried during review and reverted: the exhaustive
deepEqual(calls, …)assertions already catch every mutation it caught, so it was redundant.Vocabulary.
CONTEXT.mdcalls it the Thinking ellipsis; the code andcomments call it "the indicator". That predates this branch (
bubble.jsalready used it), so it was not churned here, but the two should converge.
CONTEXT.md's entry describes it as "three animated dots in a bubble", whichis still true of the new art — no doc change was required.
Related, closes neither. #119 introduced both the Speech bubble and the
Thinking ellipsis; #137 was prior work on the indicator. There is no issue for
this one — it was reported directly.
Behind
mainby one commit. Branched atc17d4c6;mainis nowdeed195, which touches no file this PR touches, so the squash is clean.