Repository navigation
fix(zero-swift): stop paging flips after a short permalink list's row goes and past short rows - #84
Merged
Merged
Conversation
… goes and past short rows Two ways the loaded window could flip between two pages, neither putting the right rows on screen, both found by a seeded randomized run over LayoutHost: - A forward page from the first row of a window already at the list's start leaves that row out. After a short list's permalink row was deleted (#80), it paged forward from its first row, losing r0, then back from its last, losing the end, forever. That page now comes from the list's start. - A page that shares no row with the last one went where the rows' estimate put it. Paging forward, the rows passed are the last page's, already laid out: with rows shorter than their estimate, the next page came in below the viewport, and the list paged back. It now comes in where they end. Amp-Thread-ID: https://ampcode.com/threads/T-c513a037-a257-45e0-b9a9-15c15edfe859 Co-authored-by: tmm <tmm@tmm.dev>
tmm
added a commit
that referenced
this pull request
Nov 3, 2026
…ttom settles there Stuck to the bottom, with the window at the end down to a few rows (as after messages near the end are deleted and the user scrolls back down), the list loaded pages without settling. The page before the window's last row leaves that row out; the space estimated in its place moved the bottom, the list followed it, paged forward to the end again, and so on. VirtualAnchor.backward's startRow is now optional: nil is the page that ends at the list's end, which a page query gets as a backward request with no start, as VirtualPageRequest already documented. A backward page from the last row of a window at the list's end is that page. Zero-virtual's backward anchor always has a start row; UPSTREAM.md records the divergence, and #84's two. Amp-Thread-ID: https://ampcode.com/threads/T-c513a037-a257-45e0-b9a9-15c15edfe859 Co-authored-by: tmm <tmm@tmm.dev>
tmm
added a commit
that referenced
this pull request
Nov 4, 2026
…ttom settles there (#85) Stuck to the bottom, with the window at the end down to a few rows (as after messages near the end are deleted and the user scrolls back down), the list loaded pages without settling. The page before the window's last row leaves that row out; the space estimated in its place moved the bottom, the list followed it, paged forward to the end again, and so on. VirtualAnchor.backward's startRow is now optional: nil is the page that ends at the list's end, which a page query gets as a backward request with no start, as VirtualPageRequest already documented. A backward page from the last row of a window at the list's end is that page. Zero-virtual's backward anchor always has a start row; UPSTREAM.md records the divergence, and #84's two. Amp-Thread-ID: https://ampcode.com/threads/T-c513a037-a257-45e0-b9a9-15c15edfe859 Co-authored-by: Amp <amp@ampcode.com>
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.
Follow-up to #80 and #81: the rare paging loop #81's randomized run found, plus a regression from #80 that the same run turned up. In both, the loaded window flips between two pages without settling.
1. A short permalinked list whose row is deleted pages forever (regression in 0.6.2). A list opened at
permalinkID, short enough that all its rows fit in one page and scrolled to its end, never settles after its permalink row is deleted. It alternates betweenr1…r14andr0…r13on every pass, running a page query on each one. 0.6.1 sent the list to the top and settled..top).2. Scrolled past the loaded rows of short rows, the next page comes in below the viewport (the loop from #81, seed 209). When rows are shorter than
estimatedRowHeightand the viewport goes past the loaded rows into estimated space, there's a blank frame and the list pages back to its start. In the worst case it flips between the two pages forever.Tests. Both new
LayoutHostTestsfail on main, and each one fails without its own half of the fix:Verified locally (Linux): all 114
ZeroVirtualTestspass, andswift format lintis clean. Over 1000 seeds of the bug hunt's randomized run, with rows kept between 10 and 200pt, failures went from 10 to 8. Seed 209 and the two short-list loops are fixed, and nothing new fails.Not fixed here: the other 8 failures. 7 are lists stuck to the bottom whose end window is short. A backward page from the window's last row leaves that row out, the space estimated after it moves the bottom, the re-pin follows it, and the list pages forward again. Upstream zero-virtual
f89c468has the same edge paging. Fixing it needs a backward page that ends at the list's end, whichVirtualAnchor.backwardcan't represent because itsstartRowisn't optional. The 8th is a jump where a row moves (seed 760).Amp-Thread-ID: https://ampcode.com/threads/T-c513a037-a257-45e0-b9a9-15c15edfe859