fix(a11y): accessibility and ND-design audit fixes (#42-#48, #54, #80) #85

Merged
pyr0ball merged 9 commits from fix/a11y-audit into main 2026-04-15 10:21:14 -07:00
Owner

Closes #42, #43, #44, #45, #46, #47, #48, #54, #80

Summary

  • Safety (#54): Persist dietary constraints and allergy preferences to localStorage — celiac/allergy users no longer lose restrictions on page reload
  • WCAG critical (#80 C1-C6): aria-pressed on level/cuisine/filter toggles, aria-expanded on collapsibles, 32px touch targets on icon buttons, aria-busy + aria-live loading region, role=alert on error div
  • Contrast (#80 H1): Light mode muted text darkened from #a0845a to #7a5c2e (WCAG 1.4.3 AA)
  • ARIA barriers (#80 H3-H8): Tab focus management via activateTab(), openRecipeById error surface, aria-hidden emoji + sr-only labels on nutrition chips, form for/id pairs
  • ND/calm-UX (#42 #46 #47 #80-M): Deficit language removed ("You'd need" → "To complete this recipe"), wildcard section calmed, depletion framing removed, active nutrition filter count shown in summary
  • SavedRecipesPanel (#43 #44 #48): Empty state gets navigation buttons, Remove requires two-step confirmation, notes expand with Show more/less toggle
  • Undo (#45): "I cooked this" dismiss shows 12-second silent undo toast

Test plan

  • Dietary constraints/allergies persist across page reload
  • Level/cuisine buttons announce selected state to screen readers (aria-pressed)
  • Collapsible sections announce expanded/collapsed state
  • Bookmark and dismiss buttons meet 24px minimum touch target
  • Loading state is announced to screen readers
  • API errors announced via role=alert
  • Light mode muted text passes WCAG AA contrast check
  • Tab keyboard navigation moves focus to active panel
  • Nutrition chips read correctly without emoji artifacts
  • Filter form labels are linked to their inputs
  • Missing ingredient section uses neutral language and info styling
  • Wildcard section uses calm framing
  • SavedRecipesPanel empty state shows Find/Browse buttons
  • Remove button requires confirmation before deleting
  • Notes can be expanded inline
  • Cooking a recipe shows 12s undo toast; Undo restores it to suggestions
Closes #42, #43, #44, #45, #46, #47, #48, #54, #80 ## Summary - **Safety (#54):** Persist dietary constraints and allergy preferences to localStorage — celiac/allergy users no longer lose restrictions on page reload - **WCAG critical (#80 C1-C6):** aria-pressed on level/cuisine/filter toggles, aria-expanded on collapsibles, 32px touch targets on icon buttons, aria-busy + aria-live loading region, role=alert on error div - **Contrast (#80 H1):** Light mode muted text darkened from #a0845a to #7a5c2e (WCAG 1.4.3 AA) - **ARIA barriers (#80 H3-H8):** Tab focus management via activateTab(), openRecipeById error surface, aria-hidden emoji + sr-only labels on nutrition chips, form for/id pairs - **ND/calm-UX (#42 #46 #47 #80-M):** Deficit language removed ("You'd need" → "To complete this recipe"), wildcard section calmed, depletion framing removed, active nutrition filter count shown in summary - **SavedRecipesPanel (#43 #44 #48):** Empty state gets navigation buttons, Remove requires two-step confirmation, notes expand with Show more/less toggle - **Undo (#45):** "I cooked this" dismiss shows 12-second silent undo toast ## Test plan - [ ] Dietary constraints/allergies persist across page reload - [ ] Level/cuisine buttons announce selected state to screen readers (aria-pressed) - [ ] Collapsible sections announce expanded/collapsed state - [ ] Bookmark and dismiss buttons meet 24px minimum touch target - [ ] Loading state is announced to screen readers - [ ] API errors announced via role=alert - [ ] Light mode muted text passes WCAG AA contrast check - [ ] Tab keyboard navigation moves focus to active panel - [ ] Nutrition chips read correctly without emoji artifacts - [ ] Filter form labels are linked to their inputs - [ ] Missing ingredient section uses neutral language and info styling - [ ] Wildcard section uses calm framing - [ ] SavedRecipesPanel empty state shows Find/Browse buttons - [ ] Remove button requires confirmation before deleting - [ ] Notes can be expanded inline - [ ] Cooking a recipe shows 12s undo toast; Undo restores it to suggestions
pyr0ball added 9 commits 2026-04-15 10:21:04 -07:00
- #42: Replace deficit framing — "You'd need:" → "To complete this recipe:", element_gaps
  card-warning → card-secondary, missing/gap chips status-warning → status-info,
  "Your pantry is missing..." → "These would expand your options:"
- #46: Add activeNutritionFilterCount computed; show count in Advanced filters summary
  when filters are active so it's visible while collapsed
- #47: Wildcard confirmation status-warning → status-info, copy updated to calm framing;
  wildcard recipe card badge status-warning → status-info
- M1: Add re-search hint below Hard Day Mode toggle when results are already showing
- M8: Move swap candidates collapsible to after directions/steps section
- L2: Add autocomplete="off" to filter search, constraint, and allergy text inputs
- L5: Add title="This is an affiliate link" disclosure to grocery affiliate links

Items already correct (no change needed):
- M2: Level description already always visible via activeLevel computed
- M3: Rate limit copy already using calm framing
- M5: No-results copy already calm
- M6: levelLabels already uses full names
- M7: "that's part of the fun" was part of the wildcard copy fixed under #47
- L1: Neon/konami handler not present in this file
pyr0ball merged commit ab97af73f7 into main 2026-04-15 10:21:14 -07:00
Sign in to join this conversation.
No description provided.