perf(agent-chat): reveal message links without a second scroll
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.
| metric | before | after | delta | harness |
|---|---|---|---|---|
| Reveal first visible | 85.1 ms | 73.1 ms | -12.0 ms | chat-open, same run |
| Reveal settled | 113.8 ms | 73.1 ms | -40.7 ms (-35.8%) | chat-open, same run |
| Scroll moves after first visible | 1 | 0 | -1 | chat-open, same run |
| Maximum scroll drift | 47 px | 0 px | -47 px | chat-open, same run |
| Delayed scrollIntoView calls | 1 | 0 | -1 | chat-open, same run |
| Full DOM row scans | 2 | 0 | -2 | chat-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 --checkin unchangedChiefPromptBubble.gallery.ts, verified identical to base35245964aa9f47b78cbf1970ee4d4df8199fdb03; all other check pieces completed successfully. - Fleet receipt tests
49a96bff3843a9a6ba97fc77f3e79fb32728290f, snapshot6cae350b34f6cda72cb5fd493025fb733b021213, matching tree3bb4723a995d5202d88923559d2895b9f01663f2. - 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