Skip to content

feat(Grid): scroll="edge" - #95

Merged
chiefcll merged 1 commit into
mainfrom
feat/grid-edge-scroll
Nov 25, 2026
Merged

chiefcll merged 1 commit into
mainfrom
feat/grid-edge-scroll

Conversation

@chiefcll

Copy link
Copy Markdown
Contributor

Adds scroll="edge" to Grid (target: main).

Behaviour

  • The grid stays still while focus moves through the rows that fit between its unscrolled top and the bottom of its clipping parent, or the screen (stage.root.h) when the parent does not clip. At least one row always counts as fitting.
  • When focus moves past the last row that fits, the grid scrolls just enough to show the focused row.
  • When focus moves above the first row shown, that row returns to the grid's y.
  • Looping and selected changes follow the same rules. auto (the default) and none are unchanged.

Unlike Row's edge, which asks the renderer whether the next child is in the viewport, Grid works out which rows fit from its sizes. Positions are read on each move down, so a Grid inside a Column that is still animating counts its rows from that moment's position.

Tests

Three new cases in tests/contract-grid.test.tsx:

  • a clipping parent, with looping
  • no clipping parent (the screen bottom)
  • selected changes

npm test, npm run tsc and npm run lint pass.

🤖 Generated with Claude Code

The grid stays still while focus moves through the rows that fit between
its unscrolled top and the bottom of a clipping parent (or the screen).
Past the last one it scrolls just enough to show the focused row; above
the first row shown, that row returns to the grid's y.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chiefcll
chiefcll merged commit bd89df1 into main Nov 25, 2026
1 check 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