Repository navigation
virtual rows: a row's hint is answered from its kept key - #71
Merged
Merged
Conversation
A layout asks every row's size. A row whose size is kept answered at once, but a subclass that reports a wider hint than the layout width (a view that scrolls sideways, widening by `row_extent`) had to override `sizeHint`, and its override built the row's key again for every row on every layout, kept size or not: 129,813 key builds while a reader scrolled back through 216 rows. `hinted(key, size)` is what the view is told a row takes; the base answers the size, and every path of `sizeHint` returns through it with the key it already holds (the kept row's own key on the fast path, `kept_row`). A subclass widens there and builds nothing. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016gZLdx92gKjvnNKianjAXG
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.
A layout asks every row's size. A row whose size is kept answers at once, but a subclass that reports a wider hint than the layout width (a view that scrolls sideways, widening by
row_extent) had to overridesizeHint, and its override built the row's key again for every row on every layout: 129,813 key builds while a reader scrolled back through 216 rows in Toad.hinted(key, size)is what the view is told a row takes; the base answers the size, and every path ofsizeHintreturns through it with the key it already holds (kept_rowon the fast path). A subclass widens there and builds nothing.Test:
test_a_layout_answers_each_rows_hint_from_its_kept_key(a wide row's hint is wider than the viewport; a second layout builds no key). The row tests pass (10, the band tests excluded as onmain).🤖 Generated with Claude Code
https://claude.ai/code/session_016gZLdx92gKjvnNKianjAXG