Agent pane: preserve scroll while loading older history

TE
6d ago
+812-20

Leo (2026-10-26): “no jitter, there's no flicker, there's no flash”. He reports the scrollbar thumb jittering as older messages load while scrolling up.

This preserves the first visible row by ID through both render-range projection and measured-height correction. Existing visible rows stay mounted while older history prepends. Ordinary streaming updates and simple prepends use constant-time ID fast paths after geometry lookup; mixed structural changes use an exact ID fallback. Page-retry timers are cancelled on close or session change and release their waiting callers.

Observed / Not run

The provisional 2,000-row run showed zero moved/missing/remounted rows and zero raw-scroll-offset reversals. That raw offset is not proof of thumb monotonicity: the corrected harness now records normalized thumb position and size, and the final before/after run is pending. Earlier detached-node baseline numbers were invalid and are excluded.

The existing top-page regression passes on base and candidate in run 40400730764; this is a regression check, not a red-to-green result. The exact final browser run, frame timings, captures, and independent review will be linked here before landing. No native builds or browser tests run locally.

Shared anchor: webviews/src/agent-session/acpmux/conversation/scrollAnchor.ts → preserveScrollAnchorTop, used by render-range projection and measured placement. Coordinate rail jumps through this mechanism rather than adding another compensator.

Review repair at fbe8f952095a6c865fc29f6b76573194d7d1b838: disconnect makes the transcript's older-page callback unavailable, invalidates its pending request and clears the 500 ms recheck. Socket loss also cancels page backoff and rejects late replies by paging epoch. Session switch and unmount retain the existing cleanup; reconnect permits one fresh request. All four executable hosted scripts now start with #!/usr/bin/env bash.

The direct disconnect regression failed before the repair; the repaired direct and mounted-transcript cases pass: 3 tests, 319 assertions. Changed-file formatting, lint, typecheck, prepush, shell syntax/mode and diff checks pass. Review (Astra xhigh): SHIP at fbe8f952095a6c865fc29f6b76573194d7d1b838. Full feature diff and the repair delta reviewed read-only; no P0–P2 findings.

Agent session: agent session