Skip to content

feat(layout): add overflow and scroll support to layout and renderer#72

Merged
RtlZeroMemory merged 6 commits into
mainfrom
create-overflow-scroll-support
Feb 18, 2026
Merged

feat(layout): add overflow and scroll support to layout and renderer#72
RtlZeroMemory merged 6 commits into
mainfrom
create-overflow-scroll-support

Conversation

@RtlZeroMemory

Copy link
Copy Markdown
Owner

Summary

  • add optional container overflow props (visible | hidden | scroll) and validated scrollX/scrollY inputs for box/row/column
  • extend layout metadata with scrollX, scrollY, contentWidth, contentHeight, viewportWidth, and viewportHeight
  • clamp scroll offsets during layout and apply layout-time child offset shifts by (-scrollX, -scrollY)
  • integrate scroll viewport clipping and scrollbar rendering (1-column right bar, 1-row bottom bar, shared corner cell) using existing scrollbar glyph helpers
  • update hit-testing to account for overflow modes and scroll viewport clipping semantics
  • mirror runtime collection scroll state (VirtualList/Table/Tree) into layout metadata during rendering as an incremental migration path
  • document overflow/scroll behavior in docs/guide/layout.md

Tests

  • add 3 new deterministic layout test files:
    • layout.overflow-hidden.test.ts (19 tests)
    • layout.overflow-scroll.test.ts (26 tests)
    • layout.scroll-hitTest.test.ts (13 tests)
  • add extra overflow metadata assertions in layout.edgecases.test.ts

Validation

  • npm run build
  • npm run typecheck
  • node scripts/run-tests.mjs (pass: 2409/2409)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 11508394da

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/core/src/layout/constraints.ts Outdated
Comment on lines +144 to +145
contentWidth: normalizeI32NonNegative(maxX - minX),
contentHeight: normalizeI32NonNegative(maxY - minY),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Compute scrollable extent from content origin

measureContentBounds derives contentWidth/contentHeight as max - min, and resolveOverflow later clamps scrollX/scrollY from that span; this drops the offset between the viewport origin and the first child when children are laid out away from the content origin (for example via signed margins), so the computed max scroll can be too small to ever reveal the right/bottom edge (and too large when children start negative, allowing blank overscroll). In those layouts, valid content becomes permanently unreachable even though it overflows the viewport.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in f35ac21.

I changed measureContentBounds to compute content extents from the container content origin (cx/cy) instead of span (max - min), and updated row/column/box callers to pass the content origin. This fixes under-clamping when content starts at a positive offset and avoids blank overscroll when content starts negative.

Added regression coverage in layout.edgecases.test.ts (scroll clamp uses content-origin extent when children start after origin).

Validation run after the fix:

  • npm run lint
  • npm run typecheck
  • node scripts/run-tests.mjs (2410/2410 pass)

@RtlZeroMemory
RtlZeroMemory merged commit 0ffd0f4 into main Feb 18, 2026
24 of 25 checks passed
@RtlZeroMemory
RtlZeroMemory deleted the create-overflow-scroll-support branch February 19, 2026 17:45
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