Skip to content

Fade a new reply in word by word, in the Read view and the lead chat - #217

Merged
yobazy merged 2 commits into
mainfrom
reply-fade-in
Nov 18, 2026
Merged

yobazy merged 2 commits into
mainfrom
reply-fade-in

Conversation

@yobazy

@yobazy yobazy commented Nov 12, 2026

Copy link
Copy Markdown
Owner

A reply that lands while you're watching now comes in the way Claude and ChatGPT show one: word by word, each word fading in, in reading order.

How it works. The log hands over a reply whole (we poll it every 2.5s), so there's no token stream to show. src/nebula/reveal.ts paces the words out the way chat apps smooth a stream: about 40 words a second, faster for a long reply so the last word starts within 1.4s. Each word fades in over 360ms, which gives the soft trailing edge.

  • Words are in their final places from the first frame, so nothing reflows and the Read view's stick-to-bottom scroll doesn't jump.
  • Text nodes React rendered keep their identity. Each one carries its first word while the reveal runs and gets its full text back when it ends, so React can still update or remove it. Markdown text gets the same treatment.
  • Code blocks, pictures, option buttons and the lead's face come in as one piece. Copy/Run and the reply tools aren't faded.
  • Only replies that arrive while the thread or chat is open fade in. Opening an old thread shows it as before. With reduced motion on, there's no fade.
  • Safe under React StrictMode's double effects: a rerun starts the fade over instead of leaving it half done.

The mock lead now sometimes answers with a card, so a card landing in the chat can be seen.

Lead chat, plain reply (frames at 0 / 250 / 500 / 800ms / done):

chat

Lead chat, card reply:

card

Checked: npm run build && npm test (621 pass, new tests/reveal.test.mjs). Watched in the browser mock with Playwright: plain and card replies fade in, and afterwards the reply's DOM is as React left it (no leftover spans). Rust is untouched.

Not checked: the Read view live. It uses the same hook on .rd-reply.is-new, but the mock never adds a reply to a thread. Draft until it's been watched on a real thread.

🤖 Generated with Claude Code

…ad view and the lead chat

Replies reach the log whole, so this paces their words out the way a
streamed answer comes in: in reading order, about 40 words a second,
capped at 1.4s for a long reply. Words sit in their final places from
the start, so nothing reflows. React's own text nodes keep their
identity and get their text back when the fade ends. Code blocks,
pictures and buttons come in as one piece. Off with reduced motion.

The mock lead now sometimes answers with a card, so a card landing in
the chat can be seen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@yobazy
yobazy marked this pull request as ready for review November 12, 2026 20:49
@yobazy

yobazy commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Fail: the code looks right and CI passes, but the PR's own description says it isn't ready to merge, and nothing on the PR says otherwise.

  • PR description ("Not checked"): it says "Draft until it's been watched on a real thread", because the Read view's fade on .rd-reply.is-new was never seen live. The PR isn't a draft and has no hold label. CLAUDE.md says a PR the user should try first is opened as a draft or labelled hold. Merging now would ship an unwatched Read-view change against the author's stated intent. Watch it on a real thread (or in the sandbox), then mark it ready.
  • src/nebula/reveal.ts:76 (not blocking): while a reveal runs, each React text node has been moved inside a new <span>. If React removes that node, or inserts something before it, in the ~1.4s window, the DOM call throws and the app's ErrorBoundary takes over the screen. I found nothing in Reader or ChatLine that does this today. Keep it in mind if reply text ever updates in place.
  • No protocol change, so types.ts doesn't need updating. Rust is untouched. Only commit to the files listed in the diff.

VERDICT: FAIL

# Conflicts:
#	src/components/ProjectChat.tsx
@yobazy
yobazy merged commit 7457a4c into main Nov 18, 2026
1 check passed
@yobazy
yobazy deleted the reply-fade-in branch November 18, 2026 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant