perf(agent-chat): reveal message links without a second scroll

Merged
TE
4d ago
+256-57

A message deep link first positions its virtual row, then the delayed DOM marker centers it again. Keep the virtual layout's placement and highlight the mounted row without another scroll. Pending reveals now wake on replay updates and DOM mounts instead of a 100 ms polling timer.

Leo, 2026-11-03:

i also think we've done a lot of great work wrt perf and loading but i don't think we've pushed to the limit yet. things should be instant and not shift layouts AND not take many resources

The wait observer, manual-input subscription and one deadline timer stop on success, cancellation, timeout or replacement. The existing highlight removes itself after 1600 ms. No animation loop was added to the product. The benchmark's sampling loop stops after 500 ms without movement or fails after 5 seconds.

Performance

Same runner and harness, median of five rounds over a 300-turn chat with the compact rail: REVEAL=1 bun bench/chat-open.bench.ts 5 300. Both arms use this head's benchmark and app; the before arm substitutes links.ts from base 35245964aa9f47b78cbf1970ee4d4df8199fdb03 with a no-op notifier export for import compatibility. Run and artifacts.

metricbeforeafterdeltaharness
Reveal first visible85.1 ms73.1 ms-12.0 mschat-open, same run
Reveal settled113.8 ms73.1 ms-40.7 ms (-35.8%)chat-open, same run
Scroll moves after first visible10-1chat-open, same run
Maximum scroll drift47 px0 px-47 pxchat-open, same run
Delayed scrollIntoView calls10-1chat-open, same run
Full DOM row scans20-2chat-open, same run

Validation

  • Fleet reveal and scroll-intent suites: 19 pass, 0 fail.
  • Behavioral regression against the original reveal implementation fails on its second scroll.
  • Fleet lint and type check pass. Full package check has one failure: vp fmt --check in unchanged ChiefPromptBubble.gallery.ts, verified identical to base 35245964aa9f47b78cbf1970ee4d4df8199fdb03; all other check pieces completed successfully.
  • Fleet receipt tests 49a96bff3843a9a6ba97fc77f3e79fb32728290f, snapshot 6cae350b34f6cda72cb5fd493025fb733b021213, matching tree 3bb4723a995d5202d88923559d2895b9f01663f2.
  • Opus 5.5 medium SHIP at the final head. Follow-ups: #32834.
  • Inspected before/after synthetic transcript captures in the run artifact. No styling changes.
  • All eight webview test shards and all eight per-test base-comparison verdicts passed at this head (run).

Preserves #24897's link grammar and #25770's manual-scroll cancellation. Surface spec: leo-workspace/design/chat-transcript.md; this changes reveal timing, with no visual styling changes.

Changelog

Fixed message links shifting the transcript again after their target appeared.

šŸ¤– Generated with Codex

Agent session: agent session