Skip to content

feat: add color-blind safe patterns on StatusBadge status chips (Closes #685) - #798

Merged
greatest0fallt1me merged 1 commit into
CalloraOrg:mainfrom
legalienn:fix/685-statusbadge-patterns
Jul 28, 2026
Merged

feat: add color-blind safe patterns on StatusBadge status chips (Closes #685)#798
greatest0fallt1me merged 1 commit into
CalloraOrg:mainfrom
legalienn:fix/685-statusbadge-patterns

Conversation

@legalienn

Copy link
Copy Markdown
Contributor

Overview

This PR augments StatusBadge status chips with unique SVG texture patterns so each status is distinguishable by shape/texture as well as color — satisfying WCAG 1.4.1 (Use of Color). Patterns are grouped by severity so users learn the relationship between textures and meaning.

Related Issue

Closes #685

Changes

src/components/StatusBadge.tsx

  • Added data-pattern-description attribute exposing the human-readable texture name (e.g., "diagonal stripes", "dot pattern", "crosshatch pattern") for enhanced screen reader support
  • Enhanced JSDoc with pattern-group documentation explaining which variants share textures and why
  • Updated Prop documentation

src/components/StatusBadge.test.tsx

  • Added test: showPattern=false hides pattern data and applies sb-pattern--disabled class
  • Added test: patternStyle="dense" modifier applies sb-pattern--dense class
  • Added test: patternStyle="high-contrast" modifier applies sb-pattern--high-contrast class
  • Added test: down variant renders sb-pattern-down class with correct data attributes
  • Added test: all 8 variants expose data-pattern-description
  • Increased from 27 to 35 tests (+8 new tests)

src/styles/patterns.css

Verification Results

npm test -- src/components/StatusBadge.test.tsx
✅ 35/35 passed

npm test -- src/styles/patterns.test.tsx
✅ 6/6 passed
Acceptance Criteria Status
Each variant has unique texture ✅ 5 distinct pattern groups
WCAG 1.4.1 Use of Color satisfied ✅ Pattern + color + aria-description
Pattern semantics exposed to AT data-pattern, data-pattern-description, aria-description
showPattern toggle works ✅ Verified for all variants
patternStyle modifiers work ✅ dense, high-contrast, default
Dark mode / design tokens consistent ✅ All colours use --sb-*-bg/fg/border tokens

CalloraOrg#685)

Augment StatusBadge status chips with unique SVG texture patterns so each status is distinguishable by shape/texture alone, satisfying WCAG 1.4.1 (Use of Color).
@greatest0fallt1me
greatest0fallt1me merged commit 4fbea4e into CalloraOrg:main Jul 28, 2026
0 of 6 checks passed
@greatest0fallt1me

Copy link
Copy Markdown
Contributor

Great work, this looks good. Thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add color-blind safe patterns on StatusBadge status chips [b#008]

2 participants