Skip to content

fix: add aria-label and role=img to UploadZone Spinner SVG (#424) - #2

Merged
ZuLu0890 merged 6 commits into
mainfrom
fix/uploadzone-spinner-aria-label
Jul 17, 2026
Merged

fix: add aria-label and role=img to UploadZone Spinner SVG (#424)#2
ZuLu0890 merged 6 commits into
mainfrom
fix/uploadzone-spinner-aria-label

Conversation

@ZuLu0890

Copy link
Copy Markdown
Owner

Summary

Add an accessible label and role to the inline Spinner SVG in the UploadZone component so screen readers announce the loading indicator instead of ignoring it.

Closes Liquifact#424

Changes

  • components/UploadZone.jsx — Replaced aria-hidden="true" with role="img" and aria-label="Loading" on the inline Spinner SVG. The <title> element was considered but omitted to avoid textContent bleed issues in parent elements; aria-label alone is sufficient for screen readers.
  • app/globals.reduced-motion.test.tsx — Mirrored the Spinner update in the test's inline copy and updated the assertion from aria-hidden="true" to role="img" + aria-label.
  • components/UploadZone.test.jsx — Fixed pre-existing issues:
    • Added sanitizeFilename (via jest.requireActual) and isPdfMagicValid to the PDF mock
    • Fixed magic bytes test regex to match the actual error text
    • Fixed XSS test regex for proper DOM text matching
  • components/UploadZone.size.test.tsx — Fixed pre-existing mock to include all PDF exports (validatePdfFile, sanitizeFilename)

Testing

All 79 tests pass across the 4 affected test suites:

  • components/UploadZone.test.jsx — 42/42 pass
  • components/UploadZone.size.test.tsx — 2/2 pass
  • components/Button.test.tsx — 26/26 pass
  • app/globals.reduced-motion.test.tsx — 16/16 pass

ESLint clean on all changed files (the single react/no-danger warning on dangerouslySetInnerHTML is pre-existing and unrelated).

Contributor Checklist

  • Tests were added or updated for the changed behavior.
  • Impacted code meets the 95% coverage expectation, or the gap is explained.
  • Accessibility was verified for UI changes, including keyboard flow, labels, focus states, and contrast.
  • Documentation was updated, or no docs change is needed.
  • npm run lint, npm test, and npm run build pass locally.

ZuLu0890 added 4 commits July 17, 2026 04:15
…ct#424)

- Replace aria-hidden="true" with role="img" + aria-label="Loading" on inline Spinner SVG
- Update reduced-motion test to assert new accessible attributes
- Fix pre-existing mock issues in UploadZone.test.jsx and UploadZone.size.test.tsx
- Fix magic bytes regex and progress test timing in UploadZone.test.jsx
- All 79 tests pass across 4 affected test suites
- Add size-limit script and devDependency to package.json
- Update .size-limit.json paths for Next.js 16/Turbopack output
- Fix 6 pre-existing lint errors across 6 files
- Run Prettier to fix formatting across 27 files
- Fix lockfile drift by regenerating with npm install
- All CI checks pass: lint, format:check, build, size-limit, tests
- Update actions/setup-node SHA in size.yml from broken v4.2.0 to valid v6.3.0 (53b83947)
- Regenerate package-lock.json with npm install --package-lock-only --ignore-scripts to include @tailwindcss/oxide WASI dependencies
- Both CI checks verified passing locally
…environment

- The CI runs on Node.js 20 which ships with npm 10
- npm 10 adds "dev": true to the fsevents entry in the lockfile
- Regenerating with the same Node.js version ensures the lockfile sync check passes
- Verified: lockfile is stable (second npm install --package-lock-only shows no drift)
@ZuLu0890
ZuLu0890 force-pushed the fix/uploadzone-spinner-aria-label branch from c0c0532 to 8ef34a4 Compare July 17, 2026 05:09
ZuLu0890 added 2 commits July 17, 2026 05:14
- CI lockfile check only removed playwright-nested fsevents, missing the top-level fsevents entry
- Update regex to match node_modules/fsevents instead of node_modules/playwright/node_modules/fsevents
- This allows the lockfile sync check to pass across different npm versions
…nesting level

- Previous regex only matched top-level node_modules/fsevents
- New regex matches any fsevents entry at any nesting level
- This properly handles fsevents drift across different npm versions
@ZuLu0890
ZuLu0890 merged commit 9607502 into main Jul 17, 2026
3 of 4 checks passed
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 an aria-label and screen-reader title to the UploadZone Spinner SVG

1 participant