**Priority:** High (Final sprint before 27 Nov) **Source:** Peer feedback + pre-submission UX & accessibility audit ## Problem 1. **Static `<title>` violates WCAG 2.4.2 (`client/index.html:7`, `client/src/App.tsx`, `AlbumDetailPage.tsx`, `CratePage.tsx`):** `document.title` is never updated across Discover, Your crate, Album detail, or error views. 2. **Duplicate `CrateButton` accessible names & double-state announcement (`client/src/components/CrateButton.tsx:8,59-64`, `AlbumCard.tsx:73`, `AlbumDetailPage.tsx:174`):** 20 cards per page render identical `aria-label="Add to crate"` without the album title, and pairing `aria-pressed` with a state-changing label announces pressed state twice. 3. **`ReviewForm` error accessibility, raw errors, and missing delete confirmation (`client/src/components/ReviewForm.tsx:44-60,82-114,139-142,183-196,225-234`, `ReviewForm.css`, `AlbumDetailPage.tsx:80-82`):** - Validation/mutation errors have no stable `id`, no `aria-invalid`/`aria-describedby` link to controls, no focus movement on invalid submit, and no `var(--danger)` styling. - Raw Apollo/network `caught.message` strings are displayed directly to users. - Clicking `Delete review` permanently deletes immediately with no confirmation step. 4. **Undersized touch targets (<44 px), `CratePage` styling bugs, and keyboard focus edge cases (`global.css:121-124,148-155`, `App.css:33-39,146-150,164-174`, `FilterPanel.css:12-15,148-164`, `AlbumDetailPage.css:49-57`, `CratePage.tsx:97-133`, `CratePage.css:13-15`, `SearchForm.tsx:126-137`):** - `.active-filters button`, `.clear-filters`, `.show-filter-options`, `.navigation a`, `.hero-credit a`, and `.album-detail__artwork-source` are under `2.75rem` (44 px). - `CratePage` empty-state `<a className="primary-button">` misses `button`-only styles in `global.css:121-124`; light-mode `.album-card` styling is scoped only to `.discovery-main .album-card` (`App.css:165`); `.crate-page > .album-grid` (`CratePage.css:13`) is a dead selector because `<section>` wraps `.album-grid`. - Removing an item or finishing `Load more` on `CratePage` drops focus to `document.body`; `SearchForm.tsx:126-137` hijacks `Escape` even when the history dropdown is closed. 5. **No manual light/dark theme toggle (`global.css:48-94`, `App.tsx:25-37`, `App.css:164-174`, `AlbumDetailPage.css:201-219`, `client/index.html`):** Theme only follows OS `prefers-color-scheme` (cited by 3 peer reviewers). ## Suggested solution - Update `document.title` on route/album/error state changes (`Discover — Crate`, `Your crate — Crate`, `<Album Title> — Crate`, error title). - Pass `albumTitle` into `CrateButton` and use either a stable per-album name + `aria-pressed` or action labels without `aria-pressed`. - Link `ReviewForm` errors via stable `id` + `aria-invalid` + `aria-describedby`, move focus on invalid submit, style `role="alert"` with `var(--danger)`, sanitize unexpected network/Apollo errors, and add an accessible inline two-step delete confirmation (`Delete review` → `Confirm delete` / `Cancel`, Escape cancels). - Raise undersized interactive controls to `>= 2.75rem` (44 px), style `a.primary-button`, apply light-mode `.album-card` surface/border on `CratePage`, fix `.crate-page .album-grid`, restore focus on `CratePage` removals/last-page load, and only intercept `Escape` in `SearchForm` when `historyOpen` is true. - Add an accessible header light/dark theme toggle defaulting to system preference and persisted safely in `localStorage` (`try/catch`), ensuring any anti-FOUC initialization in `client/index.html` is **CSP-compatible** (external script or CSP hash, no `unsafe-inline`, so it works cleanly with the Apache CSP header issue). ## Acceptance criteria - [ ] `document.title` updates accurately per route, album title, and error state (covered by unit tests). - [ ] Every `CrateButton` exposes a unique album-specific accessible name without double-state announcements (verified with `axe` and unit tests). - [ ] `ReviewForm` associates validation/server errors via `aria-invalid` and `aria-describedby`, moves focus on invalid submit, styles errors with `var(--danger)`, shows friendly user-facing error messages instead of raw exceptions, and requires accessible confirmation before deleting a review (covered by `ReviewForm.test.tsx` + `axe`). - [ ] Interactive controls meet `>= 44 px` (`2.75rem`) touch target height; `CratePage` empty-state CTA button, light-mode card borders/surfaces, `.album-grid` spacing, and focus restoration work cleanly; `SearchForm` only intercepts `Escape` when the history popover is open. - [ ] Header includes an accessible manual light/dark theme toggle persisted safely in `localStorage` without FOUC (CSP-safe) and passes WCAG AA contrast in both themes. ### Optional stretch (if time permits) - [ ] Raise `.eyebrow` (`client/src/global.css:144`) from `0.7rem` to `>= 0.75rem`–`0.8125rem`. - [ ] Switch cover framing to `object-fit: cover` (`AlbumCover.css:10-17`) and hide/relocate the `"View album ↗"` badge overlap on touch devices (`AlbumCard.css:29-44,138-147`). - [ ] Consolidate repeated `"Not yet rated"` + `"0 reviews"` text on unrated cards (`AlbumCard.tsx:25-62`). - [ ] Align `PAGE_SIZE` (`18` or `24`) and `SKELETON_CARD_COUNT` (`6` or `9`) with the 3-column desktop grid. - [ ] Make genre/artist tags on `AlbumDetailPage` clickable links back to filtered Discover, and filter recent search suggestions client-side by typed draft (`SearchForm.tsx:31`, `RecentSearches.tsx:34`).