Repository navigation
fix(#4421): add non-color indicator to current breadcrumb item - #4605
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…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
…RTL separator guidance (#5332) * fix(breadcrumbs): hit target, theme targets, focus ring and the supporting 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 * fix(breadcrumbs): mirror the chevron in the custom-separator story 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 * fix(breadcrumbs): correct the RTL separator advice, drop the colour-only 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
0ba84e7 to
5edc039
Compare
5edc039 to
55541c6
Compare
|
Rebased + scope cleaned. This PR now contains only the fix for #4421. Context on the scope change: the branch previously carried commits from the color-contrast work (#3654, which lives in its own open PR #4022). That was my mistake - unrelated changes leaked into this PR. I've rebased On the fix itself: the Breadcrumbs audit (#5332) identified the same issue as open finding B8 and explicitly deferred it to this PR (and to #4421), rather than landing a colour-only change that would conflict with this fix:
The fix lands
Ready for review. Thanks. |
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 |
cixzhang
left a comment
There was a problem hiding this comment.
Thanks, this is the fix the Breadcrumbs audit pointed at — the supporting variant now reads as current without colour. Nit: semibold runs ~4px wider, so long labels wrap sooner.
[Reviewed by Robohands]
- add the PR reference to all 45 pending changesets, in prose rather than on the handle line (a bare @handle line is what check-changesets requires) - credit @rubyycheung, not @RubyCheung, for the Dialog responsive work in #5352; those are two different real GitHub accounts - add two missing changesets for merged work that changes published behaviour: #4605 (Breadcrumbs current-item weight) and #5259 (CLI unified search includes integration components)
- add the PR reference to all 45 pending changesets, in prose rather than on the handle line (a bare @handle line is what check-changesets requires) - credit @rubyycheung, not @RubyCheung, for the Dialog responsive work in #5352; those are two different real GitHub accounts - add two missing changesets for merged work that changes published behaviour: #4605 (Breadcrumbs current-item weight) and #5259 (CLI unified search includes integration components)
* docs: consolidate + credit changesets for v0.5.0 - add the PR reference to all 45 pending changesets, in prose rather than on the handle line (a bare @handle line is what check-changesets requires) - credit @rubyycheung, not @RubyCheung, for the Dialog responsive work in #5352; those are two different real GitHub accounts - add two missing changesets for merged work that changes published behaviour: #4605 (Breadcrumbs current-item weight) and #5259 (CLI unified search includes integration components) * docs: add the PR reference to the PowerSearch operator-menu changeset #5242 landed while this PR was open. * docs: add the PR reference to the merged-refs stability changeset #5429 landed while this PR was open.
What
Fixes #4421 — the current page breadcrumb item relied solely on color (
--color-text-primaryvs--color-text-secondary) to distinguish it from links, failing WCAG 2.1 SC 1.4.1 (Use of Color).Changes
Added
--font-weight-semibold(600) to the current item's style so it is visually distinguishable by weight in addition to color. Thearia-current="page"attribute was already present for screen readers.Validation
pnpm test -- --run packages/core/src/Breadcrumbs/Breadcrumbs.test.tsx: 25/25 tests passpnpm lint: cleanpnpm check:sync: cleanpnpm check:package-boundaries: cleanFixes #4421