Two coherent fixes for the #4346 transcript-virtualization scroll-jump cluster, shipped together (contributor-approved) because both touch static/ui.js + the same virtualization test file and interact (the cache-reset path uses the per-role default from #4367). Both only run when the default-OFF experimental "Virtualize long transcripts" setting is on. #4367 — per-role virtual scroll height estimates: Replaces the flat 140px unmeasured-row estimate with per-role fallbacks (user 120 / assistant 160 / tool_call 400 / default 140) via _messageVirtualDefaultHeightForRole + _messageVirtualRoleForEntry, so tool-call rows (which measure 500-2000px) aren't under-counted before measurement. Additive + backward-compat (opts.roleForIdx optional → flat default when absent). The two sibling offset calculators route through the per-role defaults too. #4368 — anchor-based scroll compensation during measurement: Adds _compensateScrollForMeasurementDelta (capture anchor + scrollTop → render → re-pin scrollTop by the anchor row's measured delta; null/missing/ <2px guards; programmatic-scroll flag managed) wrapping renderMessages({preserveScroll:true}) in _scheduleMessageVirtualizedRender, plus a 150ms scroll-active guard deferring measurement refresh while the user scrolls, and session-switch cleanup of the three scroll-settle globals. Maintainer note: combining the two required the test harness for test_clear_height_cache_resets_scroll_settle_globals (#4368) to also eval _messageVirtualDefaultHeightForRole + define MESSAGE_VIRTUAL_DEFAULT_ROW_HEIGHTS (#4367), since the combined _clearMessageVirtualHeightCache resets the estimate via the per-role helper. Both PRs' test sets retained. Co-authored-by: Rod Boev <rod.boev@gmail.com> |
||
|---|---|---|
| .. | ||
| vendor | ||
| apple-touch-icon.png | ||
| assistant_turn_anchors.js | ||
| boot.js | ||
| commands.js | ||
| favicon-32.png | ||
| favicon-192.png | ||
| favicon-512.png | ||
| favicon-512.svg | ||
| favicon.ico | ||
| favicon.svg | ||
| i18n.js | ||
| icons.js | ||
| index.html | ||
| login.js | ||
| manifest.json | ||
| messages.js | ||
| onboarding.js | ||
| outline.js | ||
| panels.js | ||
| pwa-startup.js | ||
| sessions.js | ||
| style.css | ||
| sw.js | ||
| terminal.js | ||
| ui.js | ||
| workspace.js | ||