Repository navigation
fix: count a script's scroll of the page as the reader's once the page has grown - #7534
Merged
Merged
Conversation
…e has grown The page's scroll watch observed only the root element, whose box stands the window's height while the content grows past it, so the page's recorded extent stayed at its arrival size. Every later single-jump scroll of the page, such as a script's scrollIntoView, then read as a layout move rather than a choice, and the next region shift restored the place the page arrived with. Since #7373 a lf-shot view switch changes its frames' width, which shifts their reading regions, so switching from Slider to Pair took the page back to its top. The page's children are now watched as a box's are, so its extent follows its content. test_each_control_archetype_holds_its_neighbours_still[shot-view] fails before and passes after. Closes #7530
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.
Switching an
lf-shotfrom Slider to Pair took the page back to its top when the page had been scrolled by a script. The cause is in the runtime's scroll bookkeeping, not in the shot.dom/scrolling.tsdecides whether a scroll was the reader's choice or layout's move by comparing the page's extent with the last one it recorded, and it watched only the root element for changes. The root stands the window's height (900 px in the test, while the body is 1517 px), so its size never changed as content grew, and the recorded extent stayed at the page's arrival size. After that, every single-jump scroll of the page, such as the test'sscrollIntoView, read as layout's, so no choice was recorded. The next reading-region shift then restored the place the page arrived with, its top.#7373 didn't introduce this bug, it exposed it. It made a slider frame the picture's width (600 px) where a Pair frame keeps its ring (602 px), so a view switch now changes the width of the frames' reading regions and announces a shift. Before #7373 both frames were 602 px, so the switch shifted nothing. #7373's sizing stays as it is.
The page's children are now watched for size the same way a scrolling box's children already are, so the page's extent follows its content. A wheel scroll was never affected, because a wheel is recorded as the reader's input either way.
Verification:
tests/journeys/test_render_controls.py::test_each_control_archetype_holds_its_neighbours_still[shot-view]fails on main (6313a6f59), with the radios moved by 617 px, and passes with the change. The archetype test's other four cases also pass.pnpm run test:runtimepasses (1237 tests).test_render_shift_watch.pyand the twotest_reading_place.pyfiles, selected with-k "clamp or script or anchor or shift or layout", pass.Closes #7530 — automated triage