feat(a11y,mobile): implement mobile nav drawer and a11y improvements - #143
Merged
therealjhay merged 2 commits intoJun 29, 2026
Merged
Conversation
- Betta-Pay#18: Add MobileNavDrawer with framer-motion slide animation, backdrop, Escape key, close button, body scroll lock, and ARIA dialog attributes. Wire to existing mobileMenuOpen state in merchant layout. - Betta-Pay#17: Add aria-current="page" on active sidebar links; fix unreadNotificationCount destructure in Topbar; use dynamic notificationLabel on bell button aria-label; mark visual notification dot aria-hidden. - Betta-Pay#16: Add global aria-live polite announcer div in root layout; create announce utility; wire useNotify to announce toasts; add role="status" result count in transactions page. - Betta-Pay#15: Add autoFocus to payment link dialog label input; @base-ui/react Dialog handles focus trap, Escape, and focus-return natively. - Fix TransactionDetail syntax error (useNotify inside param list). - Fix PaymentsPage missing notify initialization. Resolves Betta-Pay#15, Resolves Betta-Pay#16, Resolves Betta-Pay#17, Resolves Betta-Pay#18
|
@privexlabs is attempting to deploy a commit to the therealjhay's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@privexlabs 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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
aria-liveregion for dynamic content announcements (Addaria-liveregion for dynamic content updates #16)useNotifycalled inside parameter list inTransactionDetail.tsx, andmissing
notifyinitialization inPaymentsPageChanges
#18 — Mobile navigation drawer
components/layout/MobileNavDrawer.tsx: framer-motion slide-in from left, semi-transparentbackdrop, visible close (X) button, Escape key, body scroll lock,
role="dialog",aria-modal="true",aria-label="Navigation",aria-current="page"on active linkapp/(merchant)/layout.tsx: wired drawer to existingmobileMenuOpenstate withuseCallbackto preventstale closure in Escape handler
components/layout/MerchantSidebar.tsx: exportednavItemsso the drawer reuses the same nav structurecomponents/layout/Topbar.tsx: addedaria-controls="mobile-nav"to hamburger button#17 — Color not sole means of conveying information
components/layout/MerchantSidebar.tsx: addedaria-current="page"on the active nav link (screen readersannounce this natively)
components/layout/Topbar.tsx: fixedunreadNotificationCountprop not being destructured; notificationbutton
aria-labelnow uses the computednotificationLabel(e.g. "Notifications (3 unread)"); visual reddot marked
aria-hidden="true"components/shared/StatusBadge.tsx: already compliant — icon + text label for all states, no change needed#16 —
aria-liveregion for dynamic contentlib/utils/announce.ts: minimal DOM-write utility (clears then sets with 100ms delay so AT canre-announce)
app/layout.tsx: added<div id="announcer" aria-live="polite" aria-atomic="true" className="sr-only" />—always in DOM, never conditionally mounted
lib/hooks/useNotify.ts: callsannounce(message)alongside eachtoast.*callapp/(merchant)/transactions/page.tsx: added<p role="status" className="sr-only">with live result countthat updates as the search term changes
#15 — Focus trap in payment link dialog
app/(merchant)/payments/page.tsx: addedautoFocusto the label input so initial focus is explicit whenthe dialog opens
@base-ui/reactDialog v1.5 handles focus trapping, Tab cycling, Escape to close, and focus-return totrigger natively — verified
<Dialog.Close>is already rendered insideDialogContentTest Plan
press Escape → closes; tap any nav link → navigates and drawer closes; page does not scroll behind drawer
search → result count announced; active sidebar link reads "current page"
closes and returns focus to "New Payment Link" button
aria-current="page"; notification button aria-label reflectsunread count; red dot has
aria-hidden="true"Resolves #15
Resolves #16
Resolves #17
Resolves #18