Skip to content

feat(useMouse): opt-in respectClipping (1.6) - #100

Open
chiefcll wants to merge 1 commit into
1.6from
feat/usemouse-respect-clipping-1.6
Open

chiefcll wants to merge 1 commit into
1.6from
feat/usemouse-respect-clipping-1.6

Conversation

@chiefcll

Copy link
Copy Markdown
Contributor

Backport of #98 to 1.6 (cherry-picked with -x; applied cleanly — useMouse.ts, its tests and docs were identical to pre-merge main).

Adds an opt-in respectClipping option to useMouse:

useMouse(App, 100, { respectClipping: true });

With it on, the mouse hit test prunes a subtree only where a node sets clipping, so children drawn outside a non-clipping parent can be hovered and clicked with the LG Magic Remote. Off by default; the existing search is unchanged. See #98 for the design and the perf tradeoff (searches most of the tree per pointer move, not yet measured on LG hardware).

Tests

Same five useMouse respectClipping cases as #98. On 1.6's own dependencies: npm test (691 passed, 23 skipped, 1 todo), npm run tsc and npm run lint pass.

🤖 Generated with Claude Code

…parent (#98)

The mouse hit test stops descending at any node the pointer misses, so a
child drawn outside a non-clipping parent (clipping is off by default in
the renderer) can't be hovered or clicked with the LG Magic Remote.

With `respectClipping: true`, a subtree is cut off only where a node sets
`clipping`; the search otherwise keeps descending, recording only nodes
the pointer is over. Topmost wins by zIndex, then later sibling, with an
index tiebreak since old webOS engines lack a stable sort. Off by default,
so the existing single-path search is unchanged.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit fe393b6)

This branch has not been deployed

No deployments
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