Repository navigation
fix(core): a side nav item's built-in icon has its own theme target, side-nav-item-icon - #12450
josephfarina wants to merge 37 commits into
Conversation
…wins over that component's entries
… icon and the timestamp copy button; record the public layered outputs and the stage order with parts; docsite reads sitsOn
…tputs the CLI build reads
…check are shared-element parts; record wording
…ups are shared-element parts on the popover
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
Owner decision (engineering owner, covering this pull request): a side nav item's built-in icon gets its own theme target, |
|
/approve-spec 51feb2a |
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
Needs an owner decision before approval. The new side-nav-item-icon target, its state reflection and the SideNavItem record change are owner-approved at this head, and the default look is unchanged; one public API change has no deciding record. The owner-decision note settles the target and its states but does not mention renderIconSlot, so the open question below still needs an answer.
- An engineering owner needs to decide whether
renderIconSlot, exported from@astryxdesign/core, gains the publictarget?: ThemePropsparameter (packages/core/src/Icon/Icon.tsx:476), because no current record covers it; an owner (the author qualifies) can answer the review question, or name the parameter in a record and approve that head with/approve-spec <full head SHA>. - The description says the theme target is the only public addition, but the exported
renderIconSlotsignature also changes, so correct the description and the changeset, or keep the signature unchanged, following the owner's answer. - Add the first-load gzip deltas on the four reference pages that
architecture:component-import-boundariesINV10 asks for when a shared module such asIcon.tsxgrows; apnpm size:pagesrun gives docs +12 B / −3 B, form +12 B / +1 B, menu +12 B / −1 B and table +12 B / −1 B (minified / gzip).
Non-blocking: the target's base entry loses to icon state entries such as size:sm on the same element (see the inline note), and the owner-decision note lists a size state that the record and code leave out, since the Icon already reflects its own data-size on that element.
Claims and files checked
Review mode: same-head; reason: none
- Claim: before the change no side-nav element carried an icon-specific target — verified (the new test fails on the base).
- Claim: each built-in icon carries the new target with the row's selected or disabled state, in both rails — verified (test; rendered markup).
- Claim: a custom icon node is left untouched — verified (test; rendered markup).
- Claim: the target leaves size to the Icon's own attribute — verified (
SideNavItem.tsx:628-633). - Claim:
renderIconSlottakes an optional target that a node value never gets — verified (Icon.tsx:473-488). - Claim: the doc declares the target, the probe theme is regenerated and the record is updated — verified (
SideNav.doc.mjs:25; probe-theme check current). - Claim: no styling change, no new prop, no new data attribute name — verified for styling and attribute names; the exported
renderIconSlotgains a parameter. - Claim: the theme target is the only public addition — false (
renderIconSlotsignature,Icon.tsx:476). - Claim: built CSS of Core and the seven official themes is identical — verified (equal sha256).
- Claim: rendered markup differs only by the class and state attributes on the four built-in icons — verified with a client render of the same fixture.
- Claim: the regression test covers both rails and excludes labels, rows, chevrons, other icons and custom nodes — verified.
- Claim: the listed tests, typecheck, lint, changeset and knowledge checks pass — verified (re-run).
- Changeset: the default look does not change, and a theme can colour side-nav icons apart from labels and other icons — verified, with the base-entry caveat above.
- File
.changeset/core-side-nav-item-icon-target.md— omits therenderIconSlotchange; otherwise clear. - File
docs/specs/components/SideNav/SideNavItem.spec.md— clear; non-blocking: no AV2 verification row. - File
packages/core/src/Icon/Icon.tsx— public signature change awaiting an owner; INV10 deltas missing. - File
packages/core/src/SideNav/SideNav.doc.mjs— clear. - File
packages/core/src/SideNav/SideNavItem.iconTarget.test.tsx— clear. - File
packages/core/src/SideNav/SideNavItem.tsx— clear; non-blocking cascade note. - File
packages/themes/probe/src/probeTheme.ts— clear (regenerated; generator check current).
|
I'll run a full review to re-check this with your note. |
51feb2a to
926848b
Compare
|
/approve-spec 926848b |
There was a problem hiding this comment.
Changes requested: one record gap. The side-nav-item-icon target, its selected and disabled reflection and the component:SideNavItem change are owner-approved at this head, and the default look is unchanged. The earlier renderIconSlot question is settled, because its exported signature no longer changes.
packages/core/src/Icon/iconSlotValue.tsis a new internal module thatSideNav/SideNavItem.tsximports from outside the Icon folder, and no record names it (architecture:knowledge-contractsDEC-22), so name it (its path orisDrawnIconValue) in a record such ascomponent:Iconorcomponent:SideNavItemAV2, say whyrenderIconSlotis not enough, and approve that head with/approve-spec <full head SHA>.
Non-blocking: the target's base entry still loses to icon state entries such as size:sm on enabled, unselected icons (see the inline note); the comment at SideNavItem.tsx:635-637 can keep only its reason; and the record's verified_by could list the new test.
Claims and files checked
Review mode: full; reason: rebase
- Claim: before the change no side-nav element carries an icon-specific target — verified (the new test's placement cases fail on the base).
- Claim: each built-in icon carries the new target with the row's selected or disabled state, in both rails — verified (test; probe-theme captures).
- Claim: the target leaves size to the Icon's own attribute — verified (
SideNavItem.tsx:631-634). - Claim: it follows the Banner status-icon pattern — verified (Banner puts its target on the status Icon).
- Claim: a custom icon node is rendered as given — verified (
SideNavItem.tsx:650-652; test). - Claim: the slot check moves into a Core-internal helper that the package does not export, used by both callers — verified; no record names the helper (the blocking finding).
- Claim:
renderIconSlot's public signature and behavior are unchanged — verified (Icon.tsx:471-480; the API surface comparison lists no row for it). - Claim: the doc declares the target, the probe theme is regenerated and the record is updated — verified (
SideNav.doc.mjs:25; probe check current). - Claim: no styling change, no new prop, no new data attribute name — verified.
- Claim: the theme target is the only public addition and no exported function changes — verified (one added target, two reflection counts).
- Claim: built CSS of Core and the seven official themes is identical — verified (equal sha256).
- Claim: rendered markup differs only by the class and state attributes on the built-in icons, and a custom icon is unchanged — verified (render path and rendered DOM; the default-theme frame is pixel-identical).
- Claim: the regression test covers both rails and excludes labels, rows, the chevron, other icons and custom nodes — verified.
- Claim: the listed tests, typecheck, lint, changeset and knowledge checks pass — verified (re-run).
- Claim: first-load JavaScript per reference page grows by at most 8 B minified — verified (re-measured; gzip within a few bytes of the stated numbers).
- Changeset: the built-in icon carries the target with both states in both rails, a custom node is left as is, and the default look does not change — verified.
- Changeset: a theme can colour side-nav icons apart from labels and other icons — verified, with the base-entry caveat above.
- File
.changeset/core-side-nav-item-icon-target.md— clear. - File
docs/specs/components/SideNav/SideNavItem.spec.md— clear (owner-approved at this head); non-blocking: the new test is not inverified_by. - File
packages/core/src/Icon/Icon.tsx— clear (behavior-preserving). - File
packages/core/src/Icon/iconSlotValue.ts— blocking: no record names this internal module. - File
packages/core/src/SideNav/SideNav.doc.mjs— clear. - File
packages/core/src/SideNav/SideNavItem.iconTarget.test.tsx— clear. - File
packages/core/src/SideNav/SideNavItem.tsx— clear; non-blocking comment wording and cascade note. - File
packages/themes/probe/src/probeTheme.ts— clear (generated; generator check current).
926848b to
24b71bc
Compare
|
/approve-spec 24b71bc |
There was a problem hiding this comment.
Approved pending CI. The side-nav-item-icon target, its selected and disabled reflection and the component:SideNavItem record change are owner-approved at this head, and the record now names the internal isDrawnIconValue helper, which closes the earlier gap. CI is still running on this head, so this approval waits on it.
Non-blocking: the target's base entry still loses to Icon's own color: and size: entries on enabled, unselected icons (see the inline note); a line in AV2 on that precedence would help theme authors.
Claims and files checked
Review mode: full; reason: rebase
- Claim: on the base, no side-nav element carries an icon-specific target and the icon carries only the shared icon target — verified (the new test's placement cases fail on the base; base captures).
- Claim: each built-in icon carries the new target with the row's selected or disabled state, in both rails — verified (new test; probe captures of the expanded and collapsed rails).
- Claim: the target leaves size to the Icon's own attribute — verified (
SideNavItem.tsx:629-634; the test checksdata-size="sm"). - Claim: it follows the Banner status-icon pattern — verified (Banner's test asserts its target on the status Icon element).
- Claim: a custom icon node is rendered as given — verified (
SideNavItem.tsx:650; test). - Claim: the slot check moves into a Core-internal helper that the package does not export, used by both callers — verified (
Icon/iconSlotValue.ts; the./Iconentry does not re-export it). - Claim:
renderIconSlot's public signature and behavior are unchanged — verified (Icon.tsx:471-480; the API surface comparison lists no row for it). - Claim: the SideNav doc declares the target, the probe theme is regenerated and the record is updated — verified (
SideNav.doc.mjs:25; the probe check is current; AV2). - Claim: no styling change, no new prop and no new data attribute name — verified.
- Claim: the theme target is the only public addition and no exported function changes — verified (one added target and two reflection counts).
- Claim: the built CSS of Core and the seven official themes is identical — verified (equal sha256 for every built stylesheet).
- Claim: rendered markup differs only by the class and state attributes on the built-in icons, and a custom icon is unchanged — verified (render path and rendered DOM; the default-theme frame is pixel-identical).
- Claim: the regression test covers both rails and excludes labels, rows, the chevron, other icons and custom nodes — verified (test file).
- Claim: the listed tests, typecheck, lint, changeset and knowledge checks pass — verified (re-run).
- Claim: first-load JavaScript per reference page grows by at most 8 B minified — verified (re-measured; gzip within 1 B of the stated numbers).
- Claim: the writing rubric results are listed and the record text is in the present tense — verified (AV2 and the design-relationships paragraph).
- Changeset: the built-in icon carries the target with both states in both rails, a custom node is left as is, and the default look does not change — verified.
- Changeset: a theme can color side-nav icons apart from labels and other icons — verified, with the base-entry caveat above.
- File
.changeset/core-side-nav-item-icon-target.md— clear. - File
docs/specs/components/SideNav/SideNavItem.spec.md— clear (owner-approved at this head). - File
packages/core/src/Icon/Icon.tsx— clear (behavior-preserving). - File
packages/core/src/Icon/iconSlotValue.ts— clear (named in the approved record). - File
packages/core/src/SideNav/SideNav.doc.mjs— clear. - File
packages/core/src/SideNav/SideNavItem.iconTarget.test.tsx— clear. - File
packages/core/src/SideNav/SideNavItem.tsx— clear; non-blocking cascade note. - File
packages/themes/probe/src/probeTheme.ts— clear (generated; the generator check is current).
…side-nav-item-icon [skip ci]
…al check [skip ci]
… win over icon entries [skip ci]
…!important exception; drawsAsIcon JSDoc in shorter sentences
790c119 to
098e77f
Compare
|
Engineering owner's approval for the |
|
/approve-spec 098e77f |
There was a problem hiding this comment.
Approved pending CI for #12450: the build and test checks have not run on this head yet.
#12450 — approved pending CI
The side-nav-item-icon target lands on every built-in side-nav icon in both rails with the row's selected and disabled states, beats keyed icon entries unless an icon value is !important, and leaves the default look and the published themes' CSS unchanged; the component:SideNavItem record change has an engineering owner's approval for this head.
#12378 — needs an owner decision (its own review)
- Its review at its current head waited on an engineering owner's
/approve-specfor its record changes; that comment was posted after the review, so #12378's own re-review records it. No blocking finding.
Whole stack — passes: the two pull requests agree and merge cleanly into main. #12450 lands only when it and #12378 are both approved.
Claims and files checked
Review mode: full; reason: rebase
- #12450 claim: before the change no side-nav element carries an icon target of its own — verified (browser reading on #12378's head: every icon carries only Icon's class).
- #12450 claim: each built-in icon carries the target with the row's selected or disabled state, in both rails, and keeps its own size attribute — verified (new test; browser readings on three stories).
- #12450 claim: the target sits on the Icon element as Banner's status icon target does — verified (Banner applies its icon target to its Icon the same way).
- #12450 claim: the target is applied once for both rails, and a custom icon node is rendered as given — verified (source; test; server markup).
- #12450 claim: the slot check is shared by the slot renderer and SideNavItem, is internal, unexported and named by no record, and the slot renderer keeps its signature and behaviour — verified (Icon entry exports; source; record search).
- #12450 claim: the target sits on Icon in the compiler's parts list, so its entries beat keyed icon entries — verified (unit test; probe-theme readings on unselected rows).
- #12450 claim: the SideNav doc declares the target, the probe theme is regenerated and the SideNavItem record is updated — verified (probe-theme check passes).
- #12450 claim: no StyleX change, no new prop and no new attribute name; the theming target is the only public addition and no package export changes over #12378's head — verified (API comparison: one target row and two attribute reflection counts).
- #12450 claim: over #12378's head, Core and the seven official themes build byte-identical CSS — verified (hashes of every built stylesheet).
- #12450 claim: server markup of both rails differs only by the class and state attributes on the four built-in icons — verified (server-render comparison).
- #12450 claim: the listed tests pass (541), ESLint, changeset and knowledge checks pass, and core typechecks — verified (all run here).
- #12450 claim: first-load size deltas for the reference, Theme and toast pages — consistent: this review's own measurement finds the same few-byte changes on the four reference pages by a different build route; the Theme and toast rows were not re-measured.
- #12450 changeset (the icon target as a feature, winning over icon entries except an important icon value, custom nodes untouched, default look unchanged) — verified.
- #12378 claims and its two changesets — checked in its own review at its current head.
- #12450 files: the SideNavItem component, its target test, the SideNav doc, the Icon component, the SideNavItem record, the parts list and its test, the probe theme, the changeset — clear.
- #12378 files: the theme compiler, the parts list and its tests, the theme index and contract test, the browser precedence spec and story, the CLI build and family build and their tests, the doc type and theming-target test, the docsite generators, the theme-compilation and Pagination records, both changesets, 37 Core and 2 Lab component docs — clear in its own review; the CLI build repeats one comment (non-blocking).
- Whole stack: the cumulative change is consistent, its API rows are the two records' rows, and nothing one pull request adds is removed by the other.
Stack: #12378 → #12450
This pull request sits on #12378's head; #12378 lands first, and this one is judged on its own SideNavItem, SideNav and Icon files.
User impact
A theme can't color the icons in a side nav on their own. The icon a
SideNavItemdraws from itsiconorselectedIconprop carries only Icon's genericicontarget. So a theme that wants accent-colored sidebar icons with neutral labels has to restyle every icon in the app, or write a structural selector. With this change, a theme stylesside-nav-item-icon, and only side nav item icons change, in both the expanded and the collapsed rail.Problem and solution fit
Icon, and it delegates to Icon'sicontarget. That target is shared by every icon in the product.The fix puts one target on the built-in icon's own element, the same way
banner-iconworks on Banner's status icon. It carries the row'sselectedanddisabledstates. It doesn't carrysize, because the Icon reflects its ownsizeon that element.Expected behavior and authority
architecture:component-theming-surfaceINV4 (targets paint) and INV5 (composition keeps ownership unless the parent guarantees a distinct visual contract).component:SideNavItemnow records that contract in AV2 and in the design relationships.banner-iconincomponent:Banner.Smallest restoration
SideNavItemdraws its built-in icon withthemeProps('side-nav-item-icon', {selected, disabled})on the Icon element, once, for both rail modes. A ReactNode slot value is rendered as given, because Core doesn't inject props into consumer elements.drawsAsIconinIcon.tsx, used by bothrenderIconSlotandSideNavItem, so they read a slot value the same way. It is Core-internal: the package entry does not export it, and no record names it.renderIconSlot's public signature and behavior are unchanged.sitsOn: 'icon'and is listed among the compiler's shared-element parts, so a theme'sside-nav-item-iconentry is written in the later parts sub-layer and wins over itsiconentries on that element, keyed ones included (a test covers a keyediconentry). This builds on the shared-element parts change in fix(core): a theme's entry for a part on another component's element wins over that component's entries #12378, which lands first; this branch sits on it.SideNavdoc declares the target. The probe theme is regenerated, and theSideNavItemrecord is updated.Evidence
SideNavmatches.astryx-side-nav-item-icon. The icon carries onlyastryx-icon.astryx-side-nav-item-icon, withdata-selected="selected"ordata-disabled="disabled"when the row has that state.@astryxdesign/coreand all seven official themes (neutral, butter, chocolate, gothic, matcha, stone, y2k) is byte-identical before and after (sha256 of everydist/*.css).SideNavdiffers only by the added class and state attributes on the four built-in icons. The StyleX classes are identical, and a custom icon node is unchanged.SideNavItem.iconTarget.test.tsxchecks both rail modes. The target sits on each built-in icon with the row's states. It never sits on a label, the row, the expand chevron, an icon outside the side nav, or a custom icon node.Scope
Components: SideNavItem, SideNav (docs), Icon (internal check only)
side-nav-item-icontheming target, which is the restoration itself. It's declared in the doc and the record. Over fix(core): a theme's entry for a part on another component's element wins over that component's entries #12378's head, no package export changes (the theme-helper options,THEME_SUB_LAYER_ORDERandsitsOncome from fix(core): a theme's entry for a part on another component's element wins over that component's entries #12378).Writing rubric results
Owner review
Owner review:
component:SideNavItemis owned and approved by its design owner, so this change to its record (AV2, the design-relationships row and paragraph, the verification row, the compatibility class) needs the design owner's GitHub review. #12378 lands first.Testing
vitest run packages/core/src/SideNav packages/core/src/Icon packages/core/src/theme/sharedElementParts.test.ts: all pass (541).typecheck-sharded --project tsconfig.jsonfor core: clean.eslinton the touched files: no new findings.check:changesetsandcheck:knowledgepass.pnpm size:pages --base 1ad0fd4e(fix(core): a theme's entry for a part on another component's element wins over that component's entries #12378's head), first-load JavaScript (minified / gzip), with two added pages for INV10: the shared-element parts module this change grows is imported by the theme compiler, which the publicThemecomponent runs at render, andToastViewportrenders aTheme. (The theme and toast rows were measured with the script's module lookup pointed attheme/Theme.jsandToast/ToastViewport.js, since those components do not sit in a folder of their own name.) The +8 B on form, menu and table come from Icon'sdrawsAsIconcheck; the +28 B on the theme and toast pages are the added map entry: