Repository navigation
test(rtl): detect contextual decorations and coverage gaps - #5365
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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. Visual Regression222 added · 0 removed. View the report A repository maintainer can accept these exact frames: Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
067f344 to
e14db7d
Compare
e14db7d to
93a1955
Compare
rubyycheung
left a comment
There was a problem hiding this comment.
Looks good from design. The Breadcrumb separator mirrors correctly in RTL while ordinary slashes in text, dates, and paths remain unchanged. The contextual detection and coverage checks are a good safeguard against future directional-decoration regressions.
93a1955 to
d36958d
Compare
d36958d to
205a7dc
Compare



Problem
The RTL audit treated an all-N/A result as clean and only auto-detected directional SVG icons. That left contextual text decorations unmeasured: Breadcrumbs could ship an unmirrored separator while reporting
0 pass / 0 fail / all N-A.The audit roster also came only from rendered stories, so a Core or Lab component without a matching story could disappear instead of surfacing as a coverage gap.
Changes
aria-hiddendecorations in repeated-item or between-sibling contexts./,\\, arrows, angle brackets) from Unicode bidi-mirrored angle quotes, and reject double handling.core/Nameorlab/Name.Fixes #5364.
The companion monitor contract is live in Night Watch Component Auditor and Component Audit Rubric v1.8.
NOTE: Required visual acceptance is waiting on #5840. The trusted planner runs from
main; after #5840 lands and CI reruns, this PR's review contracts from 252 frames to 16 focused frames.How D6 detects a problematic glyph
D6 does not search globally for characters such as
/. A rendered element becomes a candidate only when all of these are true:aria-hidden="true". That tells us the text is decorative rather than content. This is intentional:aria-hiddenremoves the separator text from the accessibility tree, whilerole="presentation"on a<span>removes no meaningful role and still exposes/as text.li/role="listitem"items, or the decoration sits between two sibling elements.That means a Breadcrumbs separator is measured, while
and/or,08/24,/settings, and/in prose are ignored.For each candidate, D6 renders the same story LTR and RTL, follows nested wrappers to the element that carries the glyph, and composes transforms through its ancestors. It then applies one of two rules:
/,\,→,←,>, and<need explicit handling. They pass if the RTL transform is the horizontal mirror of the LTR transform, or if the DOM swaps to the paired opposite glyph. Neither handling fails; doing both fails as a double flip.›,‹,», and«have UnicodeBidi_Mirrored=Yes. They pass when the DOM glyph and transform stay unchanged because the browser mirrors the painted glyph. Swapping or transforming them again fails as double handling.D6 scans every story for the component, not only its default story. The component-level rollup then classifies each Core and Lab component as measured, verified N/A with a checked-in reason, or a coverage gap.
Visual evidence
The existing Custom Separator story now renders both D6 strategies in one focused canvas:
›relies on Unicode bidi mirroring and keeps its DOM glyph and transform unchanged;→uses one explicit horizontal mirror.The story is tagged
visual-baseline; the default Breadcrumbs story remains the representative theme surface. Against the live accepted baseline, the bounded planner produces 16 frames: 14 Default frames across seven themes and two modes, plus two neutral Custom Separator frames. Two already exist and 14 are new. All 16 captured successfully.D6 still scans every Breadcrumbs story independently of screenshot selection. The rendered mutation test below is the precise regression proof: the old component fails 13 applicable stories, while the fixed component passes all 14.
Test plan
Rendered mutation proof
Before, restored only
packages/core/src/Breadcrumbs/BreadcrumbItem.tsxfromHEAD^, rebuilt Core and Storybook, then ran:Result: exit 1; D6 reported 1 pass, 13 failures, and 2 N/A stories. The consolidated Custom Separator story passed because its two custom strategies are independent of the built-in slash; every applicable built-in-slash story failed as neither mirrored nor swapped.
After restoring
HEAD, rebuilding, and running the same audit command with/tmp/rtl-breadcrumbs-after-final.json:core/Breadcrumbs: measured, 0 coverage gaps.Missing-story coverage
Ran:
Result: exit 1 with
core/BreadcrumbItemreported as a coverage gap instead of disappearing from the audit.Automated suites
Ran:
Result: 64 planner/audit/monitor tests and 40 Breadcrumbs tests passed. Strict lint, Core build, and Storybook build passed. The trusted 16-frame plan captured 16/16 successfully.