Repository navigation
fix(a11y): label icon buttons in dashboard modals - #1134
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughCustomer, product, and staff dashboard pages add translated accessible names to icon-only action, removal, and close buttons. Some action buttons also receive translated ChangesDashboard control accessibility labels
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~8 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to
|
|
Reviewed the changes across Products, Staff, and Customers. The fix looks correct and follows the existing localization approach. The added The recorded English and Spanish browser validation also covers the relevant controls and modal interactions. No blocking issues found. Ready to merge once the required CI checks pass. As a future accessibility improvement, context-specific labels such as "Edit product" or "Delete category" could make repeated action buttons easier to distinguish, but this is not required for the current fix. |
Add localized aria-label (and title where appropriate) to icon-only action and modal close buttons in the Products, Staff, and Customers dashboard pages. Fixes #1094
…for icon-only button labels"}
670186d to
f72b731
Compare
Intent
Verify and implement the surgical fix for FreeOpenSourcePOS/FloCafe issue #1094 ("Icon-only action and close buttons missing accessible labels in Products, Staff, and Customers"): add localized
aria-label(andtitlewhere appropriate) to the unlabelled icon-only buttons infrontend/src/app/(dashboard)/products/page.tsx,frontend/src/app/(dashboard)/staff/page.tsx, andfrontend/src/app/(dashboard)/customers/page.tsx. Deliver via theno-mistakespipeline as its own PR withFixes #1094in the PR summary.What Changed
aria-labelandtitleattributes to icon-only edit and delete action buttons across the Products, Categories, and Addon Groups tables infrontend/src/app/(dashboard)/products/page.tsx, as well asaria-labelattributes on modal close buttons and tag/addon-item removal buttons.aria-labelattributes to the staff form and password-reset modal close buttons infrontend/src/app/(dashboard)/staff/page.tsx.aria-label(andtitlewhere missing) attributes to the filter-clear button, customer edit and ledger action buttons, and modal close buttons infrontend/src/app/(dashboard)/customers/page.tsx.Fixes #1094
Risk Assessment
✅ Low: The production changes are strictly additive
aria-labelandtitleattributes using existingcommonandcustomertranslation keys on icon-only buttons in Products, Staff, and Customers, with only a newly added source-regex test block intests/ui-regressions-621-623-626.test.tsneeding removal under the test-quality rule.Testing
Ran
npm run test:translations,npm run test:ui-regressions-621-623-626, built the backend and static frontend (npm run build && npm run build:frontend), and drove four live Playwright Chromium scenarios againsttests/e2e-server.cjscovering/products(Products, Categories, and Addon Groups tabs plus Product, Category, Category Delete, Addon Group, Bulk Tax, and CSV modals),/staff(Edit Staff and Reset Password modals),/customers(?filter=invalid_phonesclear chip, row Edit and View loyalty ledger buttons, and Edit Customer and Loyalty Ledger modals), and an adversarial Spanish (es) locale switch + full DOM unlabelled-button scan, capturing 7 screenshots and a verification summary in~/.no-mistakes/evidence/01M4VN56PJFE1JV9AVWKW0YRDN; all checks and scenarios passed.Evidence: Live accessibility & localization verification summary JSON
{ "scenarios": { "products": "PASS", "staff": "PASS", "customers": "PASS", "adversarialLocaleAndButtonAudit": "PASS" } }Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
tests/ui-regressions-621-623-626.test.ts:143-tests/ui-regressions-621-623-626.test.ts:143-202adds source-content-only regex assertions (assert.matchat lines 146-150, 151-155, 156-160, 161-165, 166-170, 171-175, 176-180 and thepageSource.matchAllloop at lines 182-200) that read.tsximplementation files withreadFileSyncand grep raw JSX source text, violating the test-quality rule. Concretely, the attribute matcher intests/ui-regressions-621-623-626.test.ts:188-190((?:[^{}>]|\{(?:[^{}]|\{[^{}]*\})*\})*) only handles one nested{}level inside a JSX attribute expression, so it silently skips the tag-removal<button>infrontend/src/app/(dashboard)/products/page.tsx:1723-1735whoseonClickhas two nested{}levels (() => setForm((prev) => ({ ...prev, tags: prev.tags.filter((t) => t !== tag) }))) and passes even if that button'saria-labelis removed; meanwhile lines 146-180 hardcodeonClickbeforearia-labeland fail on a behavior-preserving prop reorder. Because the user intent only requires adding accessible labels in the three page components and does not require adding source-grep guards here, remove the newly added source-content-only assertions intests/ui-regressions-621-623-626.test.ts:143-202.🔧 Fix applied.
1 warning still open:
tests/ui-regressions-621-623-626.test.ts:143-tests/ui-regressions-621-623-626.test.ts:143-202adds source-content-only regex assertions (assert.matchat lines 146-150, 151-155, 156-160, 161-165, 166-170, 171-175, 176-180 and thepageSource.matchAllloop at lines 182-200) that read.tsximplementation files withreadFileSyncand grep raw JSX source text, violating the test-quality rule. Concretely, the attribute matcher intests/ui-regressions-621-623-626.test.ts:188-190((?:[^{}>]|\{(?:[^{}]|\{[^{}]*\})*\})*) only handles one nested{}level inside a JSX attribute expression, so it silently skips the tag-removal<button>infrontend/src/app/(dashboard)/products/page.tsx:1723-1735whoseonClickhas two nested{}levels (() => setForm((prev) => ({ ...prev, tags: prev.tags.filter((t) => t !== tag) }))) and passes even if that button'saria-labelis removed; meanwhile lines 146-180 hardcodeonClickbeforearia-labeland fail on a behavior-preserving prop reorder. Because the user intent only requires adding accessible labels in the three page components and does not require adding source-grep guards here, remove the newly added source-content-only assertions intests/ui-regressions-621-623-626.test.ts:143-202.🔧 No changes applied.
1 warning still open:
tests/ui-regressions-621-623-626.test.ts:143-tests/ui-regressions-621-623-626.test.ts:143-202adds source-content-only regex assertions (assert.matchat lines 146-150, 151-155, 156-160, 161-165, 166-170, 171-175, 176-180 and thepageSource.matchAllloop at lines 182-200) that read.tsximplementation files withreadFileSyncand grep raw JSX source text, violating the test-quality rule. Concretely, the attribute matcher intests/ui-regressions-621-623-626.test.ts:188-190((?:[^{}>]|\{(?:[^{}]|\{[^{}]*\})*\})*) only handles one nested{}level inside a JSX attribute expression, so it silently skips the tag-removal<button>infrontend/src/app/(dashboard)/products/page.tsx:1723-1735whoseonClickhas two nested{}levels (() => setForm((prev) => ({ ...prev, tags: prev.tags.filter((t) => t !== tag) }))) and passes even if that button'saria-labelis removed; meanwhile lines 146-180 hardcodeonClickbeforearia-labeland fail on a behavior-preserving prop reorder. Because the user intent only requires adding accessible labels in the three page components and does not require adding source-grep guards here, remove the newly added source-content-only assertions intests/ui-regressions-621-623-626.test.ts:143-202.✅ **Test** - passed
✅ No issues found.
npm run test:translationsnpm run test:ui-regressions-621-623-626npm run build && npm run build:frontendEVIDENCE_DIR=~/.no-mistakes/evidence/01M4VN56PJFE1JV9AVWKW0YRDN npx playwright test --config=playwright.config.ts --project=chromium e2e/verify-issue-1094-live.spec.ts✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.
Summary by CodeRabbit