Skip to content

feat(frontend): add aria-controls and Escape focus management to NotificationDropdown - #1690

Open
aazminu wants to merge 1 commit into
LabsCrypt:mainfrom
aazminu:feat/issue-1636-notification-dropdown-a11y-focus
Open

aazminu wants to merge 1 commit into
LabsCrypt:mainfrom
aazminu:feat/issue-1636-notification-dropdown-a11y-focus

Conversation

@aazminu

@aazminu aazminu commented Oct 19, 2026

Copy link
Copy Markdown

Description

Enhances NotificationDropdown (frontend/src/components/NotificationDropdown.tsx) with aria-controls linking the bell trigger button to the dropdown menu container (id="notifications-dropdown-menu"), accurate aria-expanded state exposure, aria-live="polite" unread announcement, and keyboard focus management that returns focus to the bell trigger button when dismissed via the Escape key or close button.

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔧 Refactoring (no functional changes)
  • ⚡ Performance improvement
  • 🧪 Test addition or update

Related Issues

Closes #1636
Fixes #1636
/claim #1636

Changes Made

  • Added triggerRef (useRef<HTMLButtonElement>(null)) and aria-controls="notifications-dropdown-menu" to the notification bell trigger button in frontend/src/components/NotificationDropdown.tsx.
  • Added id="notifications-dropdown-menu" to the notification dropdown dialog container.
  • Restored keyboard focus to triggerRef.current when Escape is pressed while the dropdown is open (or when the close button is activated).
  • Added unit tests in frontend/src/components/NotificationDropdown.test.tsx verifying aria-expanded, aria-controls, aria-live announcement updates, and Escape key dismissal restoring focus to the bell trigger button.

Testing

Test Coverage

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed

Test Steps

  1. Run npx vitest run src/components/NotificationDropdown.test.tsx in frontend/ (7/7 tests pass).
  2. Run npx tsc --noEmit in frontend/ (0 errors).
  3. Run npx eslint src/components/NotificationDropdown.tsx src/components/NotificationDropdown.test.tsx in frontend/ (0 errors, 0 warnings).

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have checked for breaking changes and documented them if applicable

Additional Notes

Payout Details

  • USDT/USDC Receiving Wallet (EVM / ERC-20 / Polygon / Arbitrum / Optimism / Base / BSC): 0x9a51790aC01c54184bcFa067bC38f7F0E7C6F6B6

This branch has not been deployed

No deployments
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.

[Frontend] Add aria-live announcement and keyboard focus management to NotificationDropdown

1 participant