Skip to content

fix: hide decorative pds-icon from assistive tech + stop suppressing harness color-contrast#757

Merged
QuintonJason merged 3 commits into
mainfrom
fix/decorative-icon-a11y
Jun 15, 2026
Merged

fix: hide decorative pds-icon from assistive tech + stop suppressing harness color-contrast#757
QuintonJason merged 3 commits into
mainfrom
fix/decorative-icon-a11y

Conversation

@QuintonJason

@QuintonJason QuintonJason commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Description

Resolves two follow-ups surfaced by the accessibility rollout (#752#754).

1. role-img-alt — fix decorative icons (was suppressed)

pds-icon (external, @pine-ds/icons) renders role="img" with no accessible name, so axe's role-img-alt fired wherever an icon is used decoratively. Rather than per-test suppressions, this marks the decorative usages aria-hidden="true" at the call sites:

  • pds-copytext (copy-button icon — button keeps its value <span> as its accessible name)
  • pds-accordion (chevron) · pds-select (dropdown chevron + error icon) · pds-sortable-item (drag handle) · pds-input (error icon)

Each is decorative reinforcement; the control/text already carries the accessible name (verified no button-name regressions). The role-img-alt suppressions in pds-input/accordion/select/sortable e2e tests are removed and now enforce.

2. color-contrast — unreliable in the e2e harness (was suppressed per-test)

Moved color-contrast into DEFAULT_DISABLED_RULES in utils/test/axe.ts with a rationale comment: the bare Stencil E2E harness renders without the theme/global stylesheet and with fonts that may fail to load, so axe measures contrast against incidental colors (flaky run-to-run). Removed the per-test suppressions in pds-filters/pds-toast. Contrast should be verified in a themed context (Storybook/visual).

Not addressed (deferred, by design)

The off-grid motion token follow-up (100/150ms) is a design-token decision and would conflict with _motion.scss in #736 — left as documented disables.

Stacked on #754. Note: pds-copytext's role-img-alt suppression lives in #753 (not in this branch); its pds-copytext.tsx icon is fixed here, so that suppression becomes a harmless no-op — drop it when #753 lands (happy to push a one-liner).

New dependencies: none.

Fixes #(no-issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • stencil test --e2e for input/accordion/select/sortable/filters/toast — all pass with suppressions removed (267 tests); confirms the aria-hidden fix clears role-img-alt with no new button-name violations.

  • stencil test --spec for the 5 changed components — all pass (2608 tests) after updating the expected toEqualHtml markup to include aria-hidden.

  • unit tests

  • e2e tests

  • accessibility tests

  • tested manually

  • other:

Test Configuration:

  • Pine versions: 3.26.x
  • OS: macOS 25.3.0
  • Browsers: Puppeteer (Stencil e2e)
  • Misc: WCAG 2.0/2.1 A+AA

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally with my changes
  • Design has QA'ed and approved this PR

Note

Low Risk
Changes are limited to decorative ARIA on icons and test expectations, with no functional or API behavior changes to the controls themselves.

Overview
Decorative pds-icon instances are now aria-hidden="true" so assistive tech ignores unnamed role="img" chevrons and error glyphs while labels and error text stay the accessible name. This is applied on pds-accordion (chevron), pds-input / pds-select (error icons), pds-select (dropdown chevron), and pds-sortable-item (drag handle).

Component e2e accessibility tests no longer disable axe’s role-img-alt for those cases; pds-filters and pds-toast likewise stop passing local color-contrast overrides (aligned with harness-level contrast handling described in the PR stack). Spec snapshots and a pds-input error-icon assertion were updated, and pds-select gained an e2e case with an error message.

Reviewed by Cursor Bugbot for commit 058967e. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions github-actions Bot added bug Something isn't working package: core Changes have been made to the Core package labels Jun 1, 2026
@QuintonJason QuintonJason added the ran-gauntlet Multi-agent review gauntlet has been run on this branch label Jun 1, 2026
@QuintonJason QuintonJason force-pushed the test/axe-composite-components branch from b25cb3a to 4e2c91a Compare June 5, 2026 14:47
Base automatically changed from test/axe-composite-components to main June 5, 2026 18:35
@QuintonJason QuintonJason force-pushed the fix/decorative-icon-a11y branch from 582a432 to 421ca40 Compare June 5, 2026 19:07
@netlify

netlify Bot commented Jun 5, 2026

Copy link
Copy Markdown

Deploy Preview for pine-design-system ready!

Name Link
🔨 Latest commit 058967e
🔍 Latest deploy log https://app.netlify.com/projects/pine-design-system/deploys/6a30059106d35d0008dff3ff
😎 Deploy Preview https://deploy-preview-757--pine-design-system.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@QuintonJason QuintonJason requested a review from pixelflips June 5, 2026 19:53
@QuintonJason QuintonJason self-assigned this Jun 5, 2026

@pixelflips pixelflips left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two non-blocking test-coverage notes inline.

{errorMessage && (
<p class="pds-input__error-message" id={messageId(componentId, 'error')}>
<pds-icon icon={danger} size="small" />
<pds-icon aria-hidden="true" icon={danger} size="small" />

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking, for consistency: the same aria-hidden="true" change on the decorative icon had its .spec.tsx snapshot updated for pds-accordion, pds-select, and pds-sortable-item, but pds-input.spec.tsx wasn't updated to assert it. The existing error-message spec only checks expect(errorMessage).not.toBeNull(), so this attribute isn't pinned by a spec snapshot here. Worth adding for parity — the e2e axe test already covers the behavior end-to-end.

Comment thread libs/core/src/components/pds-select/test/pds-select.e2e.ts

@pixelflips pixelflips left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of non-blockers, otherwise LGTM! 👍🏼

@QuintonJason QuintonJason merged commit 3f565b6 into main Jun 15, 2026
21 checks passed
@QuintonJason QuintonJason deleted the fix/decorative-icon-a11y branch June 15, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working package: core Changes have been made to the Core package ran-gauntlet Multi-agent review gauntlet has been run on this branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants