Repository navigation
fix(preview): lay out new rendered rows at their real height on the next frame - #2088
Merged
Merged
Conversation
…ext frame A rendered row is built from its map handler while GTK is laying it out. The resize queued by adding the text view is dropped there, so the row kept its one-line estimate until the idle pass, which runs below redraw priority and waits behind frames on a loaded machine. Fast forward scrolling then painted line-high rows that later grew and moved the text. The row now queues a resize from the next frame's tick, so it is laid out at its real height without waiting for idle work. Part of lgse#2068
… loop The new test copied settle_layout's loop without its scroll value check and without its panic, so a layout that never settled was sampled mid-change and reported as moved text. settle_layout now takes the paint step, letting the test paint without draining the starving idle source. Part of lgse#2068
Contributor
Review and cleanupMerged Review against the description and #2068.
Fixes pushed
Validation
Follow-ups outside this PR
|
wmfeht
pushed a commit
to wmfeht/strata-feature-map
that referenced
this pull request
Nov 9, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RQ23ADLhhcsMQ5fRCT8Evz
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.
Description
Rendered preview rows are built from their
maphandler, which GTK runs while it lays the row out. The resize queued by adding the text view there is dropped, so a new row kept its estimated one-line height until the idle sizing pass ran. Idle callbacks run below redraw priority, so on a loaded machine several frames were painted first, and a fast forward scroll then showed line-high rows that grew and moved the text.The row now queues a resize from the next frame's tick (the update phase runs before layout, so the resize is kept), and is laid out at its real height without waiting for idle work. The idle pass stays as the final correction.
The new test keeps idle work behind frames, as on a loaded machine, jumps the scroll position, lets the layout settle, then releases the idle work. The visible text must not move. It fails without the tick.
Part of #2068, not closing it: I could not check it on a loaded machine with a real GPU, or with jumps that land at the very end of a document. A row that GTK rebinds is still rebuilt on the following frame, as before.
Visual evidence
N/A. The fix is about timing; the symptom (rows briefly line-high, then text jumping back) is described above.
How to test
./scripts/test-headless.py rows_scrolled_into_view_do_not_move.Expected result: Rows appear at their real height and the text only moves forward. The test passes; with the tick in
src/ui/virtual_preview/factory.rsremoved, it fails with "the text moved once the idle work ran".Related issue
Part of #2068