feat: clip child offsets, expanded floating params, transitions, and element bounds#12
Open
rauhryan wants to merge 4 commits intothefrontside:mainfrom
Open
feat: clip child offsets, expanded floating params, transitions, and element bounds#12rauhryan wants to merge 4 commits intothefrontside:mainfrom
rauhryan wants to merge 4 commits intothefrontside:mainfrom
Conversation
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.
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.
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.xandchildOffset.yto 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:
expanddimensions, structuredattachPoints(element + parent),pointerCaptureMode, andclipTo. 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 onreduce()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.tsNotes
v0.5.0(0a70d40). Will need a rebase onto currentmainbefore merge — happy to do that whenever.claysubmodule pointer is updated to a version that supports transitions.