Description
This is a UI/UX issue. The src/components/notifications/NotificationCenter.tsx panel opened from the NotificationBell needs proper dialog/menu semantics: focus trapping, return-focus to the bell on close, Escape-to-close, an accessible name, and body scroll lock on mobile. Audit and complete its accessibility and responsive behavior.
Requirements and Context
- Apply
useFocusTrap (src/hooks/useFocusTrap.ts) when the panel opens; return focus to the NotificationBell trigger on close.
- Add
role="dialog"/appropriate semantics, aria-label, and aria-expanded on the bell.
- Lock body scroll on mobile and render the panel as a full-height sheet under the mobile breakpoint.
- Provide a clear empty state ("No notifications") and a labeled "mark all read" control.
- Must be secure, tested, and documented
- Should be efficient and easy to review
Suggested Execution
- Fork the repo and create a branch
git checkout -b task/notification-center-a11y
- Implement changes
src/components/notifications/NotificationCenter.tsx + .css
src/components/notifications/NotificationBell.tsx
- Test and commit
npm run test
- Verify trap/return-focus/Escape and mobile sheet
- Include screenshots in the PR
Example commit message
task: add focus trap and mobile sheet to NotificationCenter
Acceptance Criteria
Guidelines
- WCAG 2.1 AA: 2.1.2, 2.4.3, 4.1.2; responsive
- Clear documentation and inline comments
- Timeframe: 96 hours
Description
This is a UI/UX issue. The
src/components/notifications/NotificationCenter.tsxpanel opened from theNotificationBellneeds proper dialog/menu semantics: focus trapping, return-focus to the bell on close, Escape-to-close, an accessible name, and body scroll lock on mobile. Audit and complete its accessibility and responsive behavior.Requirements and Context
useFocusTrap(src/hooks/useFocusTrap.ts) when the panel opens; return focus to theNotificationBelltrigger on close.role="dialog"/appropriate semantics,aria-label, andaria-expandedon the bell.Suggested Execution
src/components/notifications/NotificationCenter.tsx+.csssrc/components/notifications/NotificationBell.tsxnpm run testExample commit message
Acceptance Criteria
aria-expandedGuidelines