Repository navigation
Description
Problem
#2191 removed the long-session switch freeze by mounting the transcript tail first and filling earlier turns in idle chunks.
The scroller still starts without geometry for the unmounted prefix. Its scrollHeight therefore grows during the fill, visibly compressing and repositioning the native scrollbar thumb. Remounting a session also loses the sizes remembered by content-visibility, so the existing warm-up must learn the same geometry again.
Direction
Preserve #2191’s progressive mounting, but seed the missing geometry before the fill begins:
- Record each turn’s measured height in a size index keyed by turn and layout width/density.
- On a later mount, render one leading spacer whose height represents the unmounted prefix.
- As each idle chunk mounts, reduce the spacer by the corresponding estimated heights, keeping the document’s total height stable.
- Seed each turn’s
contain-intrinsic-sizefrom the same index instead of always starting from the global250pxfallback. - Keep the current fill and warm-up behavior as the fallback when no valid measurement exists.
This is deliberately not permanent DOM virtualization. Once the fill completes, the full transcript remains mounted, preserving native find-in-page, cross-turn text selection, accessibility, prompt-rail anchors, and direct target navigation. Browser content-visibility continues to own off-screen layout and paint optimization.
The implementation belongs at Maka’s existing transcript-rendering seam. It should not require an Astryx change, a second scroll container, a parallel transcript state, or a second rendering path.
Acceptance criteria
- Returning to a previously measured long session does not progressively change the scrollbar size or position while earlier turns mount.
- The visible reading anchor drifts by no more than 2px throughout the fill, including removal of the final spacer.
- A first visit or invalidated measurement safely falls back to the existing progressive fill and warm-up behavior.
- Bottom following, streaming, prompt-rail and search/revision navigation, native find, text selection, and accessibility do not regress.
References
- perf(ui): mount a switched-to transcript progressively #2191 — progressive transcript mounting
- perf(desktop): switching back to a long session mounts the whole transcript in one commit, freezing the UI ~0.35s #2052 — full-tree session-switch freeze
- fix(ui): long-session scroll geometry — endless upward scroll, and remount landing mid-document #827 — long-session placeholder geometry and warm-up
Activity
Benjamin-eecs commentedon Aug 5, 2026
Taking this one, as the follow-up to #2191. Plan matches the direction: record measured turn heights per session and layout, hold the unmounted prefix with one leading spacer, shrink it as chunks mount, seed contain-intrinsic-size from the same index, and keep today's fill plus warm-up as the fallback when there is no valid measurement.