E0d/fix actionrow a11y#4270
Conversation
✅ Deploy Preview for paragon-openedx-v23 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
8e8f365 to
e108851
Compare
The spacer is a purely decorative flex-grow element with no semantic meaning; hiding it from the accessibility tree is more precise than relying on AT heuristics for empty spans. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
e108851 to
a49114b
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## release-23.x #4270 +/- ##
=============================================
Coverage 94.40% 94.40%
=============================================
Files 242 242
Lines 4309 4309
Branches 1020 1021 +1
=============================================
Hits 4068 4068
+ Misses 237 233 -4
- Partials 4 8 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
a49114b to
a5f1ac2
Compare
| & > * + * { | ||
| margin-inline-start: var(--pgn-spacing-action-row-gap-x); | ||
| margin-inline-start: var(--pgn-spacing-action-row-gap-x, .5rem); | ||
| } | ||
| } | ||
|
|
||
| .pgn__action-row-stacked { | ||
| display: flex; | ||
| flex-grow: 1; | ||
| align-items: center; | ||
| flex-direction: column-reverse; | ||
| justify-content: center; | ||
|
|
||
| & > * { | ||
| margin: 0; | ||
| } | ||
|
|
||
| & > * + * { | ||
| margin-bottom: var(--pgn-spacing-action-row-gap-y); | ||
| margin-bottom: var(--pgn-spacing-action-row-gap-y, .5rem); | ||
| } | ||
| } |
There was a problem hiding this comment.
The commit message on 5f41035 says
fix(ActionRow): add fallback values to spacing tokens
Without fallbacks, both gap tokens resolve to 0 if design tokens are
not compiled and loaded, collapsing actions flush with no visual
separation. .5rem matches the intent of the token and maintains
grouping cues for cognitive accessibility (WCAG 1.4.12 advisory).
Without values from tokens nothing in Paragon would be WCAG compliant. Paragon ships with these defined.
Using fallbacks here puts us in a position of needing to update this in 2 places (both the default in the token json, and the fallback here) if we want to make a change.
I also fed Claude this comment and got:
Your reasoning checks out, and there's a sharper point you can make using prior art in the repo.
Token IS defined with the same value:
- tokens/src/core/components/ActionRow.json:6-7 — both gap tokens default to .5rem
- styles/css/core/variables.css:150-151 — compiles to --pgn-spacing-action-row-gap-x: 0.5rem
So the PR's var(..., .5rem) is literally duplicating the value that already ships, which is your dual-source-of-truth concern.
Existing fallback patterns in Paragon are different:
There are 28 fallbacks across Button/Alert/Badge/PageBanner/Bubble, but a spot-check shows they're all for tokens that don't have a base value in variables.css — variant/state-scoped tokens like --pgn-btn-bg, --pgn-alert-border-color, --pgn-badge-focus-bg. Those tokens are only set inside .btn-primary { ... }, etc., and the fallback represents the unset/default state.
--pgn-spacing-action-row-gap-x is fundamentally different: it's a base token with a shipped value. Adding a fallback here would be the first instance in this directory of a fallback duplicating a base-token value — i.e., it diverges from the established pattern, not aligns with it.
On the WCAG framing: if "tokens not loaded" is the failure mode being defended against, every Paragon component fails — spacing, typography, color contrast, focus rings. Patching one component's gap doesn't materially improve the no-tokens experience; it just creates a maintenance trap for that one component.
There was a problem hiding this comment.
I've rebased and dropped the commit. I'm not sure why Claude created the branch from the release branch rather than master.
…usage Without guidance, consumers using ActionRow to group interactive controls have no nudge to add ARIA grouping semantics. Adds a README Accessibility section with the recommended pattern (role="group" + aria-label) and a live code example. Also adds interface-level JSDoc in index.tsx pointing TypeScript consumers to the same pattern. Addresses WCAG 4.1.2 Name, Role, Value and 1.3.1 Info and Relationships. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
a5f1ac2 to
c15a33d
Compare
Description
Include a description of your changes here, along with a link to any relevant Jira tickets and/or Github issues.
Deploy Preview
Include a direct link to your changes in this PR's deploy preview here (e.g., a specific component page).
Merge Checklist
exampleapp?Post-merge Checklist