Skip to content

fix: confirmation dialog a11y (#408) + MeterStatusBadge (#409)#493

Merged
Dev-AdeTutu merged 2 commits into
Dev-AdeTutu:mainfrom
boseshittu2323-design:fix/408-confirm-dialog-a11y-409-meter-status-badge
Jun 29, 2026
Merged

fix: confirmation dialog a11y (#408) + MeterStatusBadge (#409)#493
Dev-AdeTutu merged 2 commits into
Dev-AdeTutu:mainfrom
boseshittu2323-design:fix/408-confirm-dialog-a11y-409-meter-status-badge

Conversation

@boseshittu2323-design

@boseshittu2323-design boseshittu2323-design commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Closes #408
Closes #409

Summary

This PR improves accessibility and consistency across the provider dashboard by enhancing the collaborator confirmation dialog with keyboard support and introducing a reusable MeterStatusBadge component for standardized meter status rendering.

Related Issue

Closes #408
Closes #409

Type of Change

  • Bug fix
  • Refactor / code cleanup

Changes Made

  • Added keyboard accessibility to the CollaboratorTable confirmation dialog:

    • Closes the dialog when the Escape key is pressed.
    • Implements a focus trap using useEffect and dialogRef to keep keyboard navigation within the dialog.
    • Supports Tab and Shift+Tab focus wrapping for improved accessibility.
  • Refactored MeterStatusBadge into a named export for consistent reuse.

  • Added automatic status derivation:

    • Displays expired when expiresAt * 1000 < Date.now().
  • Improved accessibility by adding:

    • aria-label="Meter status: <state>"
  • Added dedicated status styling classes:

    • .badge--active
    • .badge--inactive
    • .badge--expired
  • Updated globals.css with styles for all badge states.

  • Replaced inline status badges in MeterCard with the reusable <MeterStatusBadge> component.

  • Updated the provider dashboard meter table to use the shared MeterStatusBadge component via named import, ensuring consistent behavior and styling throughout the application.

How to Test

  1. Open the collaborator confirmation dialog.

  2. Verify that:

    • Pressing Escape closes the dialog.
    • Pressing Tab cycles focus within the dialog.
    • Pressing Shift + Tab wraps focus in the opposite direction.
  3. Open a meter with an expiration date in the past and confirm it displays the Expired badge.

  4. Verify active and inactive meters display the correct badge styling.

  5. Inspect the rendered badge to confirm it includes the appropriate aria-label.

  6. Confirm both the MeterCard and provider dashboard table render identical status badges.

Checklist

  • Code builds without errors (cargo build / npm run build)
  • No TypeScript errors (tsc --noEmit)
  • Rust code is formatted (cargo fmt) and lint-clean (cargo clippy -- -D warnings)
  • No unintended breaking changes to existing functionality
  • PR targets the main branch and is rebased on the latest upstream

Screenshots (if applicable)

N/A – changes are primarily accessibility, refactoring, and UI consistency improvements.

…ev-AdeTutu#409)

- CollaboratorTable: add Escape key listener and focus trap (Tab/Shift+Tab
  wrapping) to confirmation dialog via useEffect + dialogRef
- MeterStatusBadge: rewrite as named export; derive 'expired' when
  expiresAt*1000 < Date.now(); aria-label='Meter status: <state>';
  CSS classes badge--active/inactive/expired
- globals.css: add .badge--active, .badge--inactive, .badge--expired rules
- MeterCard: replace inline status span with <MeterStatusBadge>
- Provider dashboard meter table: replace inline status span with
  <MeterStatusBadge> (named import)

closes Dev-AdeTutu#408
closes Dev-AdeTutu#409
@drips-wave

drips-wave Bot commented Jun 28, 2026

Copy link
Copy Markdown

@boseshittu2323-design Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Dev-AdeTutu Dev-AdeTutu merged commit c2d0ba0 into Dev-AdeTutu:main Jun 29, 2026
0 of 2 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

2 participants