Skip to content

feat: clip child offsets, expanded floating params, transitions, and element bounds#12

Open
rauhryan wants to merge 4 commits intothefrontside:mainfrom
rauhryan:rr/upstream-enhancements
Open

feat: clip child offsets, expanded floating params, transitions, and element bounds#12
rauhryan wants to merge 4 commits intothefrontside:mainfrom
rauhryan:rr/upstream-enhancements

Conversation

@rauhryan
Copy link
Copy Markdown
Collaborator

Summary

Clean reimplementation of the changes from #6 and #8, properly separated into focused commits with tests for each feature.

Commit 1 — Clip region child offsets

Add childOffset.x and childOffset.y to the clip configuration, allowing clipped containers to scroll their children by an arbitrary pixel offset. This is the foundation for virtual-scroll viewports.

Commit 2 — Expanded floating parameters

Restructure floating element configuration to support the full range of Clay floating options: expand dimensions, structured attachPoints (element + parent), pointerCaptureMode, and clipTo. Enables tooltip, popover, and modal positioning.

Commit 3 — Clay transition support

Full transition lifecycle: presets (enter-from-left/right, exit-to-left/right), configurable easing handlers, duration, per-property targeting, overlay color blending, has_active_transitions() query, and delta-time on reduce() for frame-accurate interpolation. Also fixes stable element hashing (constant seed instead of incrementing counter).

Commit 4 — Element bounds API and text measurement

element_bounds() WASM export to query Clay layout bounding boxes by element ID, plus pure-JS text measurement (measureCellWidth, wrapText, measureWrappedHeight) for pre-layout height estimation. Both are needed for virtual-scroll viewport support.

Testing

All existing Deno tests pass, plus new test coverage for each feature:

  • deno test --allow-read test/term.test.ts test/validate.test.ts

Notes

Add childOffset.x and childOffset.y to the clip configuration, allowing
clipped containers to scroll their children by an arbitrary pixel offset.
This is the foundation for virtual-scroll viewports where visible content
is a sliding window over a larger child.
Restructure the floating element configuration to support the full range
of Clay floating options: expand dimensions, structured attach points
(element + parent), pointer capture mode, and clip-to-parent. This enables
proper tooltip, popover, and modal positioning relative to parent elements.
Add full transition lifecycle support to the rendering pipeline:
- Transition presets (enter-from-left/right, exit-to-left/right)
- Configurable easing handlers, duration, and per-property targeting
- Overlay color blending during transitions
- has_active_transitions() query for driving animation loops
- Delta-time parameter on reduce() for frame-accurate interpolation
- Fix stable element hashing (use constant seed instead of incrementing)
Add element_bounds() WASM export to query Clay layout bounding boxes by
element ID, enabling virtual-scroll viewports to measure visible regions.

Add measure.ts with pure-JS text measurement: measureCellWidth (Unicode-
aware cell width), wrapText (word/newline/none modes), and
measureWrappedHeight for pre-layout height estimation.

Export both from mod.ts and add geometry + build-artifact test coverage.
rauhryan added a commit to rauhryan/claywright that referenced this pull request Apr 11, 2026
Point submodule at the clean PR branch (thefrontside/clayterm#12) which
includes clip childOffset, expanded floating params, transition support,
and the getElementBounds/measure APIs.
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