Skip to content

virtual rows: a row's hint is answered from its kept key - #71

Merged
trissim merged 1 commit into
mainfrom
claude-a/row-hint
Nov 22, 2026
Merged

trissim merged 1 commit into
mainfrom
claude-a/row-hint

Conversation

@trissim

@trissim trissim commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

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 override sizeHint, 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 of sizeHint returns through it with the key it already holds (kept_row on 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 on main).

🤖 Generated with Claude Code

https://claude.ai/code/session_016gZLdx92gKjvnNKianjAXG

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
@trissim
trissim merged commit 6b374fb into main Nov 22, 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