feat(native): bind hoverWithinGroup to a named ancestor group - #636
Merged
Merged
Conversation
hoverGroup names were parsed and then ignored: a descendant with hoverWithin always bound to the outermost marked ancestor, so a nested group couldn't be targeted independently (Tailwind's group-hover/name). Add hoverWithinGroup, which binds hoverWithin to the nearest ancestor whose hoverGroup equals that name instead of the outermost one. Unset, hoverWithin keeps following the outermost marked ancestor. A name with no matching ancestor group produces a style diagnostic. Fixes #571 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
A
hoverWithinGroupname always bound to the outermosthoverGroupancestor, so a descendant nested inside two groups couldn't target the inner one — Tailwind'sgroup-hover/sidebarhad no equivalent. Fixes #571.Add a
hoverWithinGroupname that bindshoverWithinto the nearest ancestor whosehoverGroupequals it, instead of the outermost marked ancestor:Hovering
outer's own padding leaves the span unstyled; hoveringinnerstyles it. Left unset,hoverWithinkeeps following the outermost marked ancestor as before. AhoverWithinGroupnaming no ancestorhoverGroupproduces a style diagnostic instead of silently doing nothing.packages/native/src/renderer.rs#L11474-L11487 resolves the binding each frame: unnamed picks the outermost marked ancestor (
InheritedHoverGroup::first()); named walks the accumulated ancestor list from the innermost end for the first name match. The same resolution is duplicated for the booleanhover_withinused byeffective_display, transitions, and the<virtual-list>path, and for the JS-facingTestGpuixRenderer::get_resolved_styleused by the React test suite.Risk is confined to
hoverWithin/hoverWithinGroupresolution: unnamed behavior is unchanged (verified by the existing nested-group test), and the new field is additive onStyleDesc.Harness: Claude Code
Agent: none
Model: anthropic/claude-sonnet-5
Task statements
hoverGroupnames are ignored: a descendant cannot choose which group it follows #571 on Ernxst/gpuix: make a descendant bind to a named ancestorhoverGroupvia a newhoverWithinGroupfield, matching Tailwind'sgroup-hover/namesemantics, while keeping the unnamedhoverGroupbehavior unchanged; update the README API section and add a changeset. (Working-directory and workflow instructions omitted.)🤖 Generated with Claude Code