CORE-2710: Compose render-callback style in react-aria-components wrappers - #137
Open
OpenStaxClaude wants to merge 1 commit into
Open
CORE-2710: Compose render-callback style in react-aria-components wrappers#137OpenStaxClaude wants to merge 1 commit into
OpenStaxClaude wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes render-callback style handling in React Aria component wrappers while preserving caller override precedence.
Changes:
- Composes callback and object styles for three wrappers.
- Adds regression and override-precedence tests.
- Corrects Jira secret references and documents the fix.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/components/Tree/TreeCheckbox.tsx |
Composes checkbox styles safely. |
src/components/Tree/TreeCheckbox.spec.tsx |
Tests callback and object styles. |
src/components/NavBarMenuButtons.tsx |
Composes menu item and popover styles. |
src/components/NavBarMenuButtons.spec.tsx |
Adds style regression tests. |
CHANGELOG.md |
Documents the corrected behavior. |
.github/workflows/checks.yml |
Corrects Jira secret names. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…ppers NavBarMenuItem, NavBarPopover and TreeCheckbox merged the caller's `style` into their own CSS-variable object with a spread. RAC types `style` as `CSSProperties | ((renderProps) => CSSProperties)`, and spreading a function into an object literal copies no enumerable own properties, so a render-callback `style` was silently discarded — with no type error to catch it. Each wrapper now builds its CSS variables inside a `composeRenderProps` callback, so the caller's declarations land on the element in both forms. The caller still spreads last and keeps its ability to override the wrapper's variables, and the emitted inline styles for the object form are unchanged (snapshots pass untouched). TreeCheckbox's `as unknown as RACCheckboxProps['style']` double cast is replaced by a `CSSPropertiesWithVariables` return-type annotation, which types the custom properties properly instead of casting them away.
RoyEJohnson
force-pushed
the
CORE-2710-compose-render-props-style
branch
from
August 27, 2026 19:46
a35fb0f to
61e5db8
Compare
RoyEJohnson
marked this pull request as ready for review
August 27, 2026 19:51
OpenStaxClaude
added a commit
that referenced
this pull request
Aug 31, 2026
Addresses review: the four wrappers that bind CSS custom properties merged the caller's style with an object spread. react-aria-components types style as `CSSProperties | ((renderProps) => CSSProperties)`, and spreading a function copies nothing, so a render-callback style was silently dropped and replaced by the wrapper's static object. ProfileMenuButton, ProfileMenuItem, HelpMenuButton and HelpMenuItem now build their variables inside a composeRenderProps callback, the same fix applied to NavBarMenuItem/NavBarPopover/TreeCheckbox in CORE-2710 (#137). The caller still spreads last, so its ability to override the wrapper's variables is preserved, and the object form is unchanged (all 116 snapshots pass untouched). ProfileMenuItem and HelpMenuItem pass style down to NavBarMenuItem, so they need the CORE-2710 fix underneath to reach the DOM; this branch is stacked on that PR rather than duplicating it. Each wrapper gets a callback test, an override test and an object-form test. Confirmed failing before the fix: stashing only the two component files leaves 8 failed, 33 passed across the two specs -- the 8 callback/override cases fail, the 4 object-form cases pass. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
OpenStaxClaude
added a commit
that referenced
this pull request
Aug 31, 2026
Addresses Copilot's two review comments. ProfileMenuButton and HelpMenuButton merged the caller's style into their CSS-variable object with a spread. react-aria-components types style as `CSSProperties | ((renderProps) => CSSProperties)`, and spreading a function copies nothing, so a render-callback style was silently dropped and replaced by the wrapper's static object. Both now build their variables inside composeRenderProps, the same shape CORE-2710 (#137) uses for NavBarMenuItem/NavBarPopover/TreeCheckbox. The caller still spreads last, and the object form is unchanged -- all 116 snapshots pass untouched. Their style reaches react-aria's Button directly (HelpMenuButton's by way of NavBarButton, which passes it straight through), so this works against main as it stands. ProfileMenuItem and HelpMenuItem have the same defect but are left spreading for now, with a comment saying why: they hand style to NavBarMenuItem, which spreads it as well, so composing only here would send a function into that spread and lose these variables along with the caller's style. Both levels have to compose together, which needs #137 on main first. Eight tests: three per button wrapper (render-callback merged, render-callback overriding the wrapper variables, object form merging caller-last) plus object-form coverage for each menu item. Confirmed failing before the fix: stashing only the two component files leaves 4 failed, 33 passed across the two specs -- the four callback and override cases fail, the object-form cases pass. Co-Authored-By: Claude Opus 5 (1M context) <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.
Jira: CORE-2710
The
stylehalf of the bug fixed forclassNamein CORE-2708 / #136.Problem
react-aria-componentstypesstyleon anything extendingStyleRenderPropsasCSSProperties | ((values) => CSSProperties). Three wrappers merged the caller'sstyleinto their own CSS-variable object with a spread:Spreading a function into an object literal is legal TypeScript and copies no enumerable own properties, so a caller-supplied
stylecallback was silently discarded. Unlike theclassNamecase there was no type error to catch it.Fix
NavBarMenuItem,NavBarPopoverandTreeCheckboxnow build their CSS variables inside acomposeRenderPropscallback, which resolves the callback form before the merge:The caller still spreads last, so its ability to override the wrapper's CSS variables is preserved.
TreeCheckboxalso drops itsas unknown as RACCheckboxProps['style']double cast in favour of aCSSPropertiesWithVariablesreturn-type annotation, which types the custom properties properly rather than casting them away.Acceptance criteria
styleinstead of discarding it.styletest, plus an override test and an object-form test. Confirmed failing before the fix: stashing only the two source files leaves 6 failed, 11 passed across the two specs — the 6 callback/override cases fail, the object-form cases pass.useRenderPropsresolves both forms to the same object, and none ofMenuItem/Popover/Checkboxsupply adefaultStyle).Notes
main, not from CORE-2708: Compose render-callback classNames in react-aria-components wrappers #136, so it stands alone. Both PRs touchNavBarMenuButtons.tsxandTreeCheckbox.tsxon adjacent lines (className=vsstyle=), so whichever merges second will want a small rebase.JiraEmail/JiraToken→JIRA_EMAIL/JIRA_TOKEN). The Jira check fails on any branch cut frommainwithout it — it did on this PR's first two runs, exactly as it did on CORE-2708: Compose render-callback classNames in react-aria-components wrappers #136 before that commit. Since it's byte-identical to the commit on CORE-2708: Compose render-callback classNames in react-aria-components wrappers #136, whichever lands first the other merges cleanly.ProfileMenu › opens menu on clickfail itsdocument.bodysnapshot twice on a cold jest cache, with a straydata-pressed="true"in the received output. It passed on 11 consecutive runs afterwards and does not involvestyle. Looks like a pre-existing press-state timing flake rather than anything from this change — flagging it in case CI hits it.