Skip to content

fix(a11y): label icon buttons in dashboard modals - #1134

Merged
khaira777 merged 2 commits into
mainfrom
fm/flocafe-issue-1094-r1
Oct 14, 2026
Merged

khaira777 merged 2 commits into
mainfrom
fm/flocafe-issue-1094-r1

Conversation

@khaira777

@khaira777 khaira777 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

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 (and title where appropriate) to the unlabelled icon-only buttons in frontend/src/app/(dashboard)/products/page.tsx, frontend/src/app/(dashboard)/staff/page.tsx, and frontend/src/app/(dashboard)/customers/page.tsx. Deliver via the no-mistakes pipeline as its own PR with Fixes #1094 in the PR summary.

What Changed

  • Added localized aria-label and title attributes to icon-only edit and delete action buttons across the Products, Categories, and Addon Groups tables in frontend/src/app/(dashboard)/products/page.tsx, as well as aria-label attributes on modal close buttons and tag/addon-item removal buttons.
  • Added localized aria-label attributes to the staff form and password-reset modal close buttons in frontend/src/app/(dashboard)/staff/page.tsx.
  • Added localized aria-label (and title where missing) attributes to the filter-clear button, customer edit and ledger action buttons, and modal close buttons in frontend/src/app/(dashboard)/customers/page.tsx.

Fixes #1094

Risk Assessment

✅ Low: The production changes are strictly additive aria-label and title attributes using existing common and customer translation keys on icon-only buttons in Products, Staff, and Customers, with only a newly added source-regex test block in tests/ui-regressions-621-623-626.test.ts needing 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 against tests/e2e-server.cjs covering /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_phones clear 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.

  • Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Products page icon-only row Edit/Delete buttons (Products, Categories, Addon Groups), tag/addon-item Remove buttons, and modal Close buttons (Product form, Category form, Category Delete confirmation,… ✅ pass live ~/.no-mistakes/evidence/01M4VN56PJFE1JV9AVWKW0YRDN/products-edit-modal-and-tag-en.png, ~/.no-mistakes/evidence/01M4VN56PJFE1JV9AVWKW0YRDN/products-addon-group-m…
Staff page Add/Edit Staff modal and Reset Password modal header close buttons expose aria-label="Close" and dismiss their respective modals when clicked via their accessible name ✅ pass live ~/.no-mistakes/evidence/01M4VN56PJFE1JV9AVWKW0YRDN/staff-edit-modal-en.png, ~/.no-mistakes/evidence/01M4VN56PJFE1JV9AVWKW0YRDN/staff-reset-password-modal-en.png
Customers page invalid_phones filter chip Clear button, row Edit and View loyalty ledger icon buttons, and Add/Edit Customer and Loyalty Ledger modal Close buttons expose localized aria-label/title at… ✅ pass live ~/.no-mistakes/evidence/01M4VN56PJFE1JV9AVWKW0YRDN/customers-filter-chip-en.png, ~/.no-mistakes/evidence/01M4VN56PJFE1JV9AVWKW0YRDN/customers-ledger-modal-en.pn…
Adversarial locale switch and DOM button audit: switching UI language to Spanish (es) updates icon-only button aria-label/title attributes to localized translations (Editar, Eliminar, Cerrar, Borrar,… ✅ pass live ~/.no-mistakes/evidence/01M4VN56PJFE1JV9AVWKW0YRDN/customers-localized-es.png, ~/.no-mistakes/evidence/01M4VN56PJFE1JV9AVWKW0YRDN/issue-1094-live-verification.j…

Products Edit Product modal and tag removal button (EN)
Products Edit Addon Group modal with remove item and close buttons (EN)
Staff Edit Staff modal with accessible Close button (EN)
Staff Reset Password modal with accessible Close button (EN)
Customers Action Required filter chip with accessible Clear button (EN)
Customers Loyalty Ledger modal with accessible Close button (EN)
Customers page with Spanish (es) localized icon-only action buttons

Evidence: Live accessibility & localization verification summary JSON

{ "scenarios": { "products": "PASS", "staff": "PASS", "customers": "PASS", "adversarialLocaleAndButtonAudit": "PASS" } }

{
  "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.

⚠️ **Review** - 1 warning
  • ⚠️ tests/ui-regressions-621-623-626.test.ts:143 - tests/ui-regressions-621-623-626.test.ts:143-202 adds source-content-only regex assertions (assert.match at lines 146-150, 151-155, 156-160, 161-165, 166-170, 171-175, 176-180 and the pageSource.matchAll loop at lines 182-200) that read .tsx implementation files with readFileSync and grep raw JSX source text, violating the test-quality rule. Concretely, the attribute matcher in tests/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> in frontend/src/app/(dashboard)/products/page.tsx:1723-1735 whose onClick has two nested {} levels (() => setForm((prev) => ({ ...prev, tags: prev.tags.filter((t) => t !== tag) }))) and passes even if that button's aria-label is removed; meanwhile lines 146-180 hardcode onClick before aria-label and 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 in tests/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-202 adds source-content-only regex assertions (assert.match at lines 146-150, 151-155, 156-160, 161-165, 166-170, 171-175, 176-180 and the pageSource.matchAll loop at lines 182-200) that read .tsx implementation files with readFileSync and grep raw JSX source text, violating the test-quality rule. Concretely, the attribute matcher in tests/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> in frontend/src/app/(dashboard)/products/page.tsx:1723-1735 whose onClick has two nested {} levels (() => setForm((prev) => ({ ...prev, tags: prev.tags.filter((t) => t !== tag) }))) and passes even if that button's aria-label is removed; meanwhile lines 146-180 hardcode onClick before aria-label and 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 in tests/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-202 adds source-content-only regex assertions (assert.match at lines 146-150, 151-155, 156-160, 161-165, 166-170, 171-175, 176-180 and the pageSource.matchAll loop at lines 182-200) that read .tsx implementation files with readFileSync and grep raw JSX source text, violating the test-quality rule. Concretely, the attribute matcher in tests/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> in frontend/src/app/(dashboard)/products/page.tsx:1723-1735 whose onClick has two nested {} levels (() => setForm((prev) => ({ ...prev, tags: prev.tags.filter((t) => t !== tag) }))) and passes even if that button's aria-label is removed; meanwhile lines 146-180 hardcode onClick before aria-label and 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 in tests/ui-regressions-621-623-626.test.ts:143-202.
✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 4 of 4 scenarios driven live against the product
Scenario Result Live Evidence
Products page icon-only row Edit/Delete buttons (Products, Categories, Addon Groups), tag/addon-item Remove buttons, and modal Close buttons (Product form, Category form, Category Delete confirmation,… ✅ pass live ~/.no-mistakes/evidence/01M4VN56PJFE1JV9AVWKW0YRDN/products-edit-modal-and-tag-en.png, ~/.no-mistakes/evidence/01M4VN56PJFE1JV9AVWKW0YRDN/products-addon-group-m…
Staff page Add/Edit Staff modal and Reset Password modal header close buttons expose aria-label="Close" and dismiss their respective modals when clicked via their accessible name ✅ pass live ~/.no-mistakes/evidence/01M4VN56PJFE1JV9AVWKW0YRDN/staff-edit-modal-en.png, ~/.no-mistakes/evidence/01M4VN56PJFE1JV9AVWKW0YRDN/staff-reset-password-modal-en.png
Customers page invalid_phones filter chip Clear button, row Edit and View loyalty ledger icon buttons, and Add/Edit Customer and Loyalty Ledger modal Close buttons expose localized aria-label/title at… ✅ pass live ~/.no-mistakes/evidence/01M4VN56PJFE1JV9AVWKW0YRDN/customers-filter-chip-en.png, ~/.no-mistakes/evidence/01M4VN56PJFE1JV9AVWKW0YRDN/customers-ledger-modal-en.pn…
Adversarial locale switch and DOM button audit: switching UI language to Spanish (es) updates icon-only button aria-label/title attributes to localized translations (Editar, Eliminar, Cerrar, Borrar,… ✅ pass live ~/.no-mistakes/evidence/01M4VN56PJFE1JV9AVWKW0YRDN/customers-localized-es.png, ~/.no-mistakes/evidence/01M4VN56PJFE1JV9AVWKW0YRDN/issue-1094-live-verification.j…
  • npm run test:translations
  • npm run test:ui-regressions-621-623-626
  • npm run build && npm run build:frontend
  • EVIDENCE_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

  • Accessibility
    • Added accessible labels and localized titles to customer, product, category, add-on, and staff controls, including edit, delete, close, and ledger actions.

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: FreeOpenSourcePOS/FloCafe/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8421f354-b816-4047-ae42-d6d83cf87b19

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: FreeOpenSourcePOS/FloCafe/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6b0e4a79-f653-4585-ba96-23671140243b
📥 Commits

Reviewing files that changed from the base of the PR and between 0b3d909 and 670186d.

📒 Files selected for processing: 3
  • frontend/src/app/(dashboard)/customers/page.tsx
  • frontend/src/app/(dashboard)/products/page.tsx
  • frontend/src/app/(dashboard)/staff/page.tsx

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

Walkthrough

Customer, product, and staff dashboard pages add translated accessible names to icon-only action, removal, and close buttons. Some action buttons also receive translated title attributes. Button click handlers and visual presentation remain unchanged.

Changes

Dashboard control accessibility labels

Layer / File(s) Summary
Add accessible names to dashboard controls
frontend/src/app/(dashboard)/customers/page.tsx, frontend/src/app/(dashboard)/products/page.tsx, frontend/src/app/(dashboard)/staff/page.tsx
Customer, product, and staff pages add translated accessible names to action, removal, and close buttons. Product and customer action buttons also receive translated titles. Button behavior and appearance are unchanged.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 67018

The localized labels make dashboard controls identifiable to screen-reader users. The required renderer lint passed, and no concrete regression is established; this change is ready to merge.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary accessibility change: adding labels to icon buttons in dashboard modals.
Description check Passed The description is detailed and covers the issue, implementation scope, verification commands, results, screenshots, risk, and pipeline status. It does not follow every template heading, and it omits …
Linked Issues check Passed Issue #1094 requires accessible names for icon-only controls in Products, Staff, and Customers. The reviewed changes add localized aria-label attributes, and appropriate title attributes, to the s…
Out of Scope Changes check Passed The reviewed changes are limited to frontend/src/app/(dashboard)/products/page.tsx, staff/page.tsx, and customers/page.tsx. Each change supports issue #1094 by naming an icon-only control. No un…
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@khaira777 khaira777 changed the title fix(frontend): add accessible labels to icon-only dashboard buttons fix(a11y): label icon buttons in dashboard modals Oct 13, 2026
@khaira777

Copy link
Copy Markdown
Contributor Author

Reviewed the changes across Products, Staff, and Customers.

The fix looks correct and follows the existing localization approach. The added aria-label and title attributes give previously unlabeled icon buttons accessible names without changing their actions or visual behavior.

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
@khaira777
khaira777 force-pushed the fm/flocafe-issue-1094-r1 branch from 670186d to f72b731 Compare October 14, 2026 00:13
@khaira777
khaira777 enabled auto-merge (squash) October 14, 2026 00:13
@khaira777
khaira777 merged commit ac93db4 into main Oct 14, 2026
23 checks passed
@khaira777
khaira777 deleted the fm/flocafe-issue-1094-r1 branch October 14, 2026 00:24
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.

fix(a11y): add accessible aria-labels to icon-only action and close buttons

1 participant