Skip to content

virtual rows: a row is laid out once, and its extent is kept with its height - #70

Merged
trissim merged 1 commit into
mainfrom
one-layout-per-row
Nov 21, 2026
Merged

trissim merged 1 commit into
mainfrom
one-layout-per-row

Conversation

@trissim

@trissim trissim commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

measured_height laid a row out into a document of its own and dropped it, so a row a member sized before drawing it was laid out a second time when it painted. RowDocumentDelegate.laid_out is now the one place a final row becomes a document; the measurement and final_document both read it.

laid_out also records how wide the content came out when that exceeds the layout width (content that does not wrap), kept with the height and dropped with it. row_extent(key, width) answers it without laying anything out, so a member that wants one horizontal range for its rows does not build each row's document inside sizeHint.

Tests: two new ones in tests/test_virtual_rows.py (a row measured then drawn is laid out once; the extent is recorded at layout, outlives the documents and is dropped by new formatting). The file passes (9). tests/test_virtual_rows_band.py has two tests that time out here on main as well, unchanged by this.

🤖 Generated with Claude Code

https://claude.ai/code/session_016gZLdx92gKjvnNKianjAXG

… height

measured_height laid a row out into a document of its own and dropped it, so a row a
member sized before drawing it (a pager measuring the page it is about to publish) was
laid out again when it painted: on a 235-row Toad scroll-back, 1151 documents for the
rows it loaded. RowDocumentDelegate.laid_out is now the one place a final row becomes
a document; the measurement and final_document both read it, so the paint reuses what
the measurement laid out.

laid_out also records how wide the content came out when that is more than the layout
width (content that does not wrap, such as a pre block), kept under the same key as the
height and dropped with it. row_extent answers it without laying anything out; a row
not laid out yet answers the layout width. A member that wants one horizontal range
for its rows no longer has to build each row's document inside sizeHint to ask.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016gZLdx92gKjvnNKianjAXG
@trissim
trissim merged commit 5ef5890 into main Nov 21, 2026
3 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant