Repository navigation
Conversation
…menu closes The owner saw it on the TV: BACK on a Collection page's card hold menu drew every member of the row as the not-yet-loaded skeleton for the whole close, then all the art came back at once. The page is live under the menu and the collection store still holds every member, but the dismissal reaches the page as the dispatcher's Uncover, RestoreMemory (the memory the nav kept when the menu was pushed) and Enter(Restored), and the page answers that with CollectionCmd::Restore. PageCache::restore_kept_counts then replaces the directory with pages that hold no rows, so every member is a hole (Art::Poster(None), drawn as placeholder::skeleton) until the children page has been read from the server again. Since #605; card_motion is not involved. The test drives that exact event sequence, runs the store commands the page emits on the real store, and compares the page's draw census before the menu and after the dismissal. It fails: six empty-key skeletons where the six posters were. No fix here. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…d member Root cause: the dispatcher delivers Uncover, RestoreMemory and Enter(Restored) to a live page on every surface dismissal, and since #605 the Collection page answered them with CollectionCmd::Restore. The store rebuilt every page of its directory as Page { rows: None }, so closing a card's hold menu (or a sheet, or Back from Detail) turned all six members into holes, which the shared card draws as the not-yet-loaded skeleton until /children was read again. On a long, partly read list the same Restore also moved the read position to the end of the list and switched paging off. Fix, in the shared data layer only: the Restore arm does nothing when the store already holds this exact directory (same total, same kept counts), and PageCache::restore_kept_counts keeps the rows of a loaded page whose kept count equals its saved count, so only a page whose count changed becomes a hole. A store opened again since still takes the saved directory whole. Tests: the red screen test (dismissing_a_hold_menu_leaves_every_member_drawn_with_its_art) now passes; new units cover the page cache keeping its own counts' pages, and the store ignoring a restore of the directory it holds in a long, partly read list while a reopened store still takes it. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…he listing the page was saved from Review of the previous fix found that equal counts do not prove the store is the listing a page's memory was saved from. A retoken or server re-point while Detail is on top rebuilds the store; the covered page's own pump reads the header and a stretch of the frontier, so on a long unfiltered list the new store held the very total and counts the page had saved, and Back took the no-op: the store then read forward eight pages at a time from page 8 to page 50 with focus held on skeletons, where the restore with the saved counts reads only the target's pages. In the other direction (older than the previous fix) a short page landing while covered changed the store's counts, so the Back took the full path and wrote the older saved counts over the newer ones: the landed page's count went back to 60, its rows were dropped and read again, and the read position jumped to the end with paging off. The store's generation, which only a superseded listing moves (another collection opened, a close or reset, a rebuild for a changed client) and paging never does, now travels with the saved counts: Collection::generation is read at the page's sync, CardPageMemory carries it, and CollectionCmd::Restore hands it back. The Restore arm does nothing exactly when it matches, whatever the counts are by then, and a different generation takes the saved directory whole, as before. Also makes three sentences true: the Restore arm's comment no longer claims that only a reopened store takes the saved directory, restore_kept_counts says a changed page drops its rows because they no longer match its count (the later pages keep theirs), and the test doc that said the same is rewritten. Tests: a rebuilt store takes the full Restore of the target page with no read forward, and a short page landing while covered survives the restore (each failed against the previous fix). The existing restore tests model a reopened or rebuilt store on the same CollectionState, since two fresh states would share a generation, and the screen test checks the generation reaches the store. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The owner saw it on the TV: on a Collection screen, long-press a poster and dismiss the menu, and every poster in the row blanks to the empty skeleton while the menu closes, then the art comes back all at once.
Cause (traced in the simulator)
Every surface dismissal delivers
Uncover,RestoreMemory,Enter(Restored)to the page underneath (ui/src/dispatch.rspush_lifecycle). The Collection page answers it withCollectionCmd::Restore, andPageCache::restore_kept_countsrebuilt every page with no rows, so each held member becameArt::Poster(None), drawn as the skeleton until/childrenwas read from the server again: one frame in the frame dump (which waits for replies), the PMS round trip on the TV. The art returned whole because an empty card keeps no art history. It came in with #605 (174f391); the builds before and after #854 show it identically. Only the Collection store hasRestore, so the other pages' menus never did this. Back from Detail to a live Collection screen took the same path (and re-read the list).Fix (data layer; no screen code)
CollectionCmd::Restoreis a no-op when the store is still the listing the page's memory was saved from: the memory now carries the store's generation (Collection::generation(), bumped only by a supersede: Open of another id, Close, Reset, a client refresh) throughCardPageMemoryandCollectionCmd::Restore { total, counts, generation }. That is the live-page case; it no longer moves a long, partly read list's read position to its end or switches paging off, and a page that landed while the screen was covered keeps its newer count and rows. A store rebuilt or reopened since takes the full restore of the saved target page, as Every list pages to its real end: no caps on reach, bounded windows, stable focus #605 designed.PageCache::restore_kept_countskeeps a loaded page whose kept count equals its saved count; only changed pages become holes.Verification
dismissing_a_hold_menu_leaves_every_member_drawn_with_its_art(the real store and screen, the dispatcher's dismissal sequence, a draw census) failed with six empty poster keys; it passes now. New: a page-cache test (own counts keep every loaded page, a changed count drops that page and later pages keep theirs), a 5000-item partly read list whose restore changes nothing (read, more, shown, pages, revision), another listing's directory dropping only the changed pages, a store rebuilt while covered (a retoken while Detail is on top) taking the saved directory, and a short page landing while covered surviving the restore; each failed before its fix. The existing long-list return tests and Cards and captions: late art dissolves once per frame across glass walks; gliding captions fade at both edges #854's art-arrival test stay green.make checkexit 0 (cargo — ok,python — ok,rest — ok,103 steps — all ok,harness — ok; 29test result:lines, all0 failed, 18245 passed);make test-hostsimok. 926 passed; 0 failed;make check-nodefclean;make check-replay3 fixtures / 6 replays,0 failures(none of them visits a Collection page).🤖 Generated with Claude Code