Keep compact transcript history loading

This commit is contained in:
iris committed 2026-09-11 01:18:45 -04:00
1 parent 22f263ccce
commit 6226a1cb43
3 files changed
+105 -41

No files matched your search

+13 -10
View File
@@ -408,16 +408,19 @@ belongs in `~/.claude/TOOLCHAIN.md` or `~/.claude/MACHINE.md` instead.
the reader hit the end of what was loaded on every swipe and stood there
for a round trip. It is `HISTORY_SCREENS` viewports now, counted from what
is actually on screen.
- **A page landing while the history observer was fetching it could spend the
layout change meant to ask for the next one.** The observer collected only
`LazyListState.layoutInfo`; while its collector was suspended in
`loadOlderPage`, a compact page could be composed and laid out without
leaving another change to observe afterward. Codex exposed it because a
page full of calls collapses into one tool group: loading stopped until
expanding that group forced a layout. The observer is also keyed on
`oldestSeq` now, so every successful page restarts it against the settled
layout. A failed page does not advance that cursor and still waits for the
next scroll instead of retrying in a loop.
- **A page landing while the history observer was fetching it must trigger its
own successor.** The observer once collected only `LazyListState.layoutInfo`;
while its collector was suspended in `loadOlderPage`, a compact page could
be composed and laid out without leaving another change to observe afterward.
Keying the effect on `oldestSeq` still missed the opening prefetch: that key
changed while `loadingHistory` was true, so the restarted effect declined to
overlap it and never noticed the flag returning to false. Codex exposes both
failures because a page full of calls collapses into one tool group: loading
stopped until expanding that group forced a layout. The observer now collects
the cursor, loading, restoring and failure state with the layout, so returning
to not-loading always rechecks the settled height. A failed page turns the
history boundary into a Try again control rather than retrying in a loop or
requiring another scroll.
- **Only `fetchTranscript` was off the main thread; the fold was not.**
`foldEvent` returns a new list per event, so a page is that many copies of
a growing list — fine at 80 events and about 300,000 element copies at 800,