Keep compact Codex history loading

Restart the history observer after every successful page so a collapsed tool page cannot consume the only layout invalidation that would request the next one.\n\nVerified with a cold 365-event tool-heavy sandbox transcript: without scrolling or expanding a group, cache coverage advanced continuously to sequence 1. Android format, compile, lint, and JVM tests pass. Transcript bench: 26 rows/26 units loaded, transcript draw 0.72 ms per frame (debug emulator).
This commit is contained in:
iris committed 2026-09-10 18:51:29 -04:00
1 parent e3cca97cdd
commit 59965d314f
2 files changed
+14 -1

No files matched your search

@@ -1041,7 +1041,10 @@ fun SessionScreen(
// There is no correction beside this one. Following the newest message is not an effect: the
// list is reversed, so an arriving message extends the end the viewport is pinned to.
val unitSizes = remember(address) { HashMap<Any, Int>() }
LaunchedEffect(listState, moreHistory) {
// A successful page advances `oldestSeq` even when its collapsed rows add too little height to
// produce another layout after this collector returns. Restarting on that cursor makes the
// promised re-check happen; a failed page leaves it unchanged and still waits for a scroll.
LaunchedEffect(listState, moreHistory, oldestSeq) {
snapshotFlow { listState.layoutInfo }
.collect { info ->
val visible = info.visibleItemsInfo