Repository navigation
fix(breadcrumbs): audit pass, hit target, theme targets, focus ring, RTL separator guidance - #5332
Merged
cixzhang merged 3 commits intoAug 22, 2026
Conversation
…rting current state Findings from the nightly component audit, all measured in Chromium against a locally built Storybook. A10: the menu-trigger and onClick-only crumbs rendered a 20px-tall button next to 28px links, under the 24px WCAG 2.5.8 floor and 8px out of vertical alignment inside the same trail. buttonReset applied a blanket `padding: 0` after `link` set paddingBlock, so the block padding was wiped along with the inline padding it was there to reset. Now paddingInline only. T12: `breadcrumb-item-menu-trigger` is documented as a theme target but never reached the DOM. A sibling stylex.props() spread replaced the className that themeProps() built, so a theme rule for that target matched nothing. Merged through mergeProps, which is what the rule asks for. The className-clobber lint rule does not see this shape because both sides are JSX spreads rather than a literal className attribute. T6: `variant` selects between style objects on breadcrumb-item and on the menu trigger, and neither themeProps() call carried it, so .astryx-breadcrumb-item rendered with no data attribute at all and a theme could not target the supporting crumb. Both targets now reflect it, and the docs list it under visualProps. A15: the link, the onClick button and the menu trigger fell through to the browser default focus ring instead of the shared focusOutlineProps.focusVisible that Link uses, so a theme's focus accent never reached a breadcrumb. B8: with variant="supporting" the current crumb was pixel-identical to a link, because supportingCurrent and supportingLink both resolved to --color-text-secondary. It now takes --color-text-primary, matching how the default variant separates the two. I10: the shipped custom-separator block recommends a chevron and an arrow, and neither mirrored under RTL, so a directional separator pointed against the reading direction. Both now carry rtlStyles.mirror, and the docs say to do that. Also: stories for a disabled menu item (the A20 and A21 sweeps saw zero disabled elements on this component before it), a long label in a narrow container, a single-item trail, and the mirrored icon separator; menu and menuSize added to the sub-component prop list in Breadcrumbs.doc.mjs, which had drifted from BreadcrumbItem.doc.mjs; and the APG patterns named in the docs. Night Watch - Component Auditor
The story taught the same unmirrored directional glyph the block did. Measured in Chromium: the separator now resolves to matrix(-1, 0, 0, 1, 0, 0) under dir="rtl" and to none in LTR. Night Watch - Component Auditor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
github-actions
Bot
requested review from
cvkxx,
ernestt,
kentonquatman and
rubyycheung
August 22, 2026 10:38
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsBreadcrumbs (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
…nly current state Review of #5332 found four defects in the audit's own work. The RTL separator "fix" was a double flip. U+203A has Unicode Bidi_Mirrored=Yes, so Chromium already mirrors it under RTL and rtlStyles.mirror flipped it back to pointing the wrong way. The mirror now applies only where the glyph is not bidi-mirrored: the arrow in the block template keeps it, the angle-quote chevron in the template and the story does not, and an Icon separator keeps it because an SVG is never bidi-mirrored. The supporting variant's current crumb goes back to --color-text-secondary. Distinguishing the current item by colour alone is the defect in issue #4421, not the remedy, and #4605 fixes it properly with a non-colour indicator. pngjs was a dependency of the audit harness, not of the repo, so it leaves package.json and the lockfile; the harness runs from outside the tree. Night Watch - Component Auditor
cixzhang
added a commit
that referenced
this pull request
Aug 22, 2026
…ead className clobber) (#5334) * feat(eslint): catch spread-vs-spread className clobbering Widen no-classname-clobber to the shape it could not see: two JSX spreads that each carry a className, where the later one silently replaces the earlier. Adds the rule's first colocated test file. * docs(eslint): document the widened rule and hold it at warn The spread check has one violation in the repo — BreadcrumbItem, whose fix is open in #5332 — so both tiers warn until that lands rather than turning CI red.
This was referenced Aug 22, 2026
github-actions
Bot
deleted the
night-watch-component-audit/Breadcrumbs/2026-08-22
branch
August 23, 2026 06:11
This branch was successfully deployed
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.
First audit of
core/Breadcrumbsagainst Component Audit Rubric v1.7.Before: 68.6 / D, 4 open BLOCKs. After: 78.2 / C, 1 open BLOCK.
Corrected after review
A review pass over this PR found that one of its fixes was a regression and that three other claims in it were wrong. All four are corrected here, and the score is re-derived rather than patched, which moves it down from the 83.5 first posted to 78.2. The corrections are listed before the fixes because two of them undo work this PR previously claimed.
1. The RTL separator fix was a double flip, and half of it is reverted.
›(U+203A) has UnicodeBidi_Mirrored=Yes, so Chromium mirrors it under RTL on its own. AddingrtlStyles.mirrorflipped it a second time, which pointed the recommended separator against the reading direction. Measured from the raster at 4x rather than from a transform string: a bare›rendered indir="rtl"is pixel-identical (0 differing pixels) to‹rendered in LTR, and the same glyph underscaleX(-1)matches›in LTR, which is the wrong way round. The mirror is removed from the chevron in both the story and the shipped block template. It stays where the glyph is not auto-mirrored:→(U+2192) isBidi_Mirrored=Noand measures pixel-identical in RTL and LTR unmirrored, so the arrow in the template keeps it, and anIconseparator is an SVG that the bidi algorithm never touches, so theMirrored Icon Separatorstory keeps it and measuresmatrix(-1, 0, 0, 1, 0, 0)under RTL againstnonein LTR. ThebestPracticesrule this PR added taught the wrong thing and now states the actual one. Both call sites carry a short comment naming the property, because the next reader will be tempted to "fix" it again.2. The screenshot harness never switched theme, so every dark capture was a light render. It drove the theme with a global named
theme, which the Storybook preview does not declare; the preview declaresastryxTheme,colorModeanddirection. A global that does not exist is ignored silently, so all 20__dark.pngfiles on the evidence branch were byte-identical to their__light.pngtwins and the two dark tables in the previous body were light renders relabelled. The harness now uses the declared names and asserts on the rendered DOM before every capture that the theme and the direction actually applied; the dark surface measuresrgb(38, 38, 38)againstrgb(255, 255, 255)light, every light/dark pair differs, and the per-capture state is published beside the images asRENDER-STATE.json. The whole set was recaptured against a Storybook built frommainfor the before pass and from this branch for the after pass. The corrected comparison is below and it supersedes the "25 of 30 pairs at 0.00%" that was posted here.3.
pngjsis out of the repo's dependencies. It was imported only by the audit harness, which is not repo code, and it had no business in the rootpackage.jsonorpnpm-lock.yaml. Both are back to their state onmain, and the harness runs from a directory outside the repo, the way the earlier audits ran theirs.4. The B8 change is backed out, because it was the wrong fix for a known accessibility bug. Making the supporting variant's current crumb
--color-text-primarydistinguishes the current item by colour alone. That is precisely #4421, an open WCAG 2.1 SC 1.4.1 use-of-colour failure against this component, and #4605 by @gonzoblasco has been open since 31 July fixing it properly with a non-colour indicator (semibold weight on the sharedcurrentstyle, which covers both variants) on the same style object. The finding is real: measured after the revert, a supporting-variant current crumb isrgb(82, 82, 82)at 12px weight 400 and so is a link beside it. This audit deliberately does not touch it. #4605 is the fix, and landing a colour-only change on those lines would either conflict with three weeks of a contributor's waiting or quietly moot it. Thevariantprop doc says supporting is "smaller with secondary text styling"; that is true again once the change is out (12px against 14px, secondary throughout), so it is left alone.5. A20 and A21 are recorded as N/A for this component, not as coverage. The audit added a story rendering a disabled
DropdownMenuItemso the two new sweeps had something to measure, then recorded the result as Breadcrumbs coverage. It is not: it measuresDropdownMenuItem, whose passing behaviour landed yesterday in #5323.BreadcrumbItemhas no disabled state of its own. The story is kept, because a disabled menu item is a real documented state worth a story, and the scorecard now records both checks as N/A.§9 keeps half of the I10 credit, since half the change was a regression. §5b is not scored above the pre-fix 3.5, because its evidence only became true after review caught it. §1 loses the A20/A21 attribution and §4 loses the B8 credit. The remaining BLOCK still caps the grade at C, but the cap is no longer what holds it there: the arithmetic is a C on its own, where the first pass would have been a B without the cap.
Pre-fix ledger row: 596920b4ea, recorded before any code changed, and left as it was measured. The post-fix score is not recorded yet: it is held on the M5 and goes in once this lands, so the ledger never claims a fix that is not on
main.Fixed
Every one of these was measured in real Chromium against a locally built Storybook, with
@astryxdesign/corerebuilt between the two passes.A10 (BLOCK): a 20px interactive target, 8px out of line with its neighbours
BreadcrumbItem.tsx:171buttonResetapplied a blanketpadding: 0afteritemStyles.linksetpaddingBlock, so the block padding was wiped along with the inline padding it was there to reset. Both button paths were affected: the menu trigger and theonClick-only crumb.Under the 24px WCAG 2.5.8 floor, and visibly misaligned inside a single trail. Now
paddingInline: 0only, solinkkeeps its block padding.T12 (BLOCK): a documented theme target that rendered on nothing
astryx-breadcrumb-item-menu-triggeris listed intheming.targets[]and never reached the DOM. A siblingstylex.props()spread replaced theclassNamethatthemeProps()had built, so a theme rule written for that target matched no element.Merged through
mergeProps, which is what T12 asks for. Two notes worth carrying forward:themingTargets.test.tscannot catch this because its policy is subset (docs may list more than source renders), and@astryx/no-classname-clobbercannot either, because both sides are JSX spreads rather than a literalclassNameattribute. This one was not in the pre-fix row; it surfaced while writing the regression test for T6, which means the recorded before state understates §2 by one BLOCK. The pre-fix row is left as it was measured rather than rewritten.T6 (BLOCK): the variant never reached the item theme targets
variantselects between StyleX style objects onbreadcrumb-item(defaultSize/supportingSize,defaultCurrent/supportingCurrent) and on the menu trigger (defaultLink/supportingLink), and neitherthemeProps()call carried it.Both targets now reflect it and the docs list it under
visualProps. Two regression tests added.A15 (FIX): the browser's focus ring instead of the system's
The link, the
onClickbutton and the menu trigger all fell through to the Chromium default ring. CoreLinkroutes through the sharedfocusOutlineProps.focusVisible; Breadcrumbs did not, so a theme's focus accent never reached a crumb.1px auto rgb(0, 95, 204)2px solid rgb(0, 100, 224)SideNavItem, for comparison2px solid rgb(0, 100, 224)Those dark rows are genuine dark renders now. They were not in the previous body.
I10 (BLOCK), in the half that was real: an
Iconseparator does not mirror itselfThe shipped
BreadcrumbsCustomSeparatorblock recommends a chevron, an arrow and a dot, and only the arrow needed anything done to it:→is not bidi-mirrored, so under RTL it kept pointing left to right. It now carriesrtlStyles.mirror. The chevron does not, per the correction above. AMirrored Icon Separatorstory shows theIconform, which needs the mirror for the same reason: an SVG is not text and the bidi algorithm does not touch it.The trail's own RTL geometry was already correct and stays correct: direction resolves to
rtl, items run right to left, each separator sits on the leading side of its label, no horizontal scroll. The RTL captures are driven by thedirectionglobal now, rather than by settingdiron ancestors by hand.‹as the engine renders itIconseparator in RTL, mirrored explicitlyThis is not unit-testable: jsdom implements no bidi mirroring, so the evidence is the Chromium raster comparison.
V10 (FIX): stories for states that had none
Menu Crumb (disabled item)with aplay:function that opens the menu, a long label in a 320px container, and a single-item trail. The disabled row measurescursor: not-allowed,pointer-events: auto, and paints no hover, which isDropdownMenuItembehaving correctly rather than Breadcrumbs coverage, per the correction above.X5b and X16 (FIX): docs
menuandmenuSizewere documented inBreadcrumbItem.doc.mjsand missing from the duplicate prop list inBreadcrumbs.doc.mjscomponents[]; the two copies had drifted. Added.bestPracticesnow names the APG Breadcrumb pattern the component implements and the APG Menu Button pattern the menu crumb implements, which closes A2 as well, and carries the corrected RTL separator rule.Visual comparison, recaptured
30 before/after pairs, compared per pixel, both sides from a fresh build and both with real light and dark renders. 6 changed, 24 identical at 0.00%.
The menu movement is the popover repositioning under the trigger's now-padded box. Rest states did not move at all, which is exactly why the 20px hit area went unnoticed by eye. The supporting-variant pair and the RTL separator pair are back at 0.00%, because both of those changes were withdrawn.
Needs review
P8 (BLOCK, still open):
menusuppresseshrefandonClick. This is the one thing P8 forbids: each prop should be one orthogonal axis. It is deliberate, documented, warned at dev time and covered by tests, so the behaviour is predictable. But the prop surface still lets a consumer write a combination the component ignores. The rubric's own guidance is to prefer the type over a runtime guard, which means a discriminated union onBreadcrumbItemProps. That is a public API change and not a fix-pass call, so it is left open and it is what caps the grade at C.B8 (FIX, open, not this PR's to close): the supporting variant does not mark its current page. Measured, and left to #4605 for #4421. See the correction above.
T7 (FIX): paint is split across two nodes.
breadcrumb-itemcarries the type scale on the<li>while the color sits on the untargeted child link or span. T7 wants these converged onto one painting element. Converging them moves which element a theme paints, which can change what existing themes reach, so it wants a decision rather than a patch.T26: the current state is not on a theme target.
variantnow is, butcurrentis not, because auto-detection resolves after mount: an explicitly-current crumb knows at render time and an auto-detected one does not. Reflecting it on only one path would be worse than reflecting it on neither. Doing it properly means deciding whether the auto-detect effect should also write the theme surface.I17 (FIX): the RTL harness still gives this component no coverage.
rtl:audit --filter Breadcrumbsreports0 pass / 0 fail / 16 N-Aboth before and after. The harness's curated dimensions are D2 (prev/next control order) and D3 (scroll and drag direction), and a breadcrumb trail has neither, so adding atargets.jsonentry would invent coverage rather than create it. The RTL behaviour here was measured by hand instead.aria-disabledthrough...rest(NIT).BaseProps<HTMLLIElement>acceptsaria-disabled, and it lands on the<li>while the<a>inside keepscursor: pointerand still paints its hover underline, because the guard is on the anchor and the attribute is on its parent. No doc suggests this and no call site does it, so it is a NIT under the reachable-victim rule rather than an A20/A21 failure. The clean closure is anisDisabledprop, which is a spec decision.Not scored against this component
A theme cannot restyle
.astryx-breadcrumb-menu's radius or padding, and that is #5095. Injecting the rules a theme emits into@layer astryx-theme:coloron.astryx-breadcrumb-itemreaches the element andfont-sizedoes not;background-coloron.astryx-breadcrumb-menureaches it andborder-radiusandpaddingdo not.DropdownMenuwas run as a control and behaves identically, so this is the layer-ordering bug and not a Breadcrumbs defect. The two private varsBreadcrumbItemsets are already classified as cross-component inderivedVarRegistry.test.tsby deliberate decision.Whether
aria-current="page"reaches the accessibility tree is unverified rather than a finding. The current crumb is a bare<span aria-current="page">, which maps to rolegenericwith an empty accessible name. Whether Chrome surfaces the attribute is not measurable over this CDP build: a control page with<a href aria-current="page">also reported nocurrentproperty, so the method is blind to it. Settling this wants a real screen reader.Checks
vitest packages/core/src/Breadcrumbs/: 39 passedpnpm test,pnpm build,pnpm lint:strict: cleancheck:sync,check:changesets,check-use-client,check:package-boundariesand the rest ofcheck:repo: cleanassets/pr-5332(30 before, 40 after, plus the per-capture render state)Night Watch — Component Auditor