Skip to content

feat: add slide-in mobile menu with focus-trap to landing nav bar - #1145

Open
ifygreg01-best wants to merge 1 commit into
Stellopay:mainfrom
ifygreg01-best:feature/landing-nav-mobile-menu
Open

feat: add slide-in mobile menu with focus-trap to landing nav bar#1145
ifygreg01-best wants to merge 1 commit into
Stellopay:mainfrom
ifygreg01-best:feature/landing-nav-mobile-menu

Conversation

@ifygreg01-best

Copy link
Copy Markdown

Summary

Closes #876

Replaces the non-functional inline mobile overflow on components/landing/landing-page-nav-bar.tsx with a proper slide-in drawer below the md (768 px) breakpoint.


What changed

components/landing/landing-page-nav-bar.tsx

  • Hamburger trigger — Lucide Menu/X icons swap on toggle; exposes aria-expanded, aria-controls="mobile-nav-panel", aria-haspopup="dialog"
  • Slide-in panel — right-edge drawer via CSS translate-x-full → translate-x-0 (300 ms); no JS animation so prefers-reduced-motion is respected automatically
  • Focus trapTab/Shift+Tab cycle within the panel's focusable elements; aria-hidden set on the closed panel so background links are unreachable
  • Four close paths — Escape key, hamburger re-click, panel close button, backdrop click — all return focus to the hamburger trigger
  • Route-change auto-close via usePathname effect
  • Body scroll lock (overflow: hidden) while the panel is open
  • ARIArole=dialog, aria-modal=true, aria-label="Mobile navigation menu" on the panel; aria-current=page on active nav links

components/landing/landing-page-nav-bar.test.tsx (new)

30 unit tests — all passing:

  • Initial render, hamburger ARIA attributes
  • Open / close via all four paths
  • Panel ARIA semantics (role, aria-modal, accessible name)
  • Escape key + focus return
  • Tab and Shift+Tab focus trap wrapping
  • Route-change close
  • Nav link content, aria-current, Log in / Sign Up links, NetworkSwitcher
  • Body scroll lock and restore
  • Backdrop overlay click

design/a11y-checklist.md

New section documenting all 13 WCAG criteria addressed, keyboard-nav test results, colour-contrast table, and responsive breakpoint behaviour. Resolves P1-03 (focus trap in mobile nav drawer).


WCAG 2.1 AA

Criterion Addressed by
2.1.1 Keyboard Native <button>, Tab/Shift+Tab trap, all close paths keyboard-operable
2.1.2 No Keyboard Trap Escape always exits
2.4.3 Focus Order Focus moves into panel on open; returns to trigger on close
4.1.2 Name/Role/Value aria-expanded, aria-controls, aria-haspopup, role=dialog, aria-modal, aria-label
1.4.1 Use of Color aria-current=page + blue text colour for active links
1.4.3 Contrast All text ≥ 4.5:1 on #0a0a0a background
2.4.7 Focus Visible focus-visible:ring-2 focus-visible:ring-[#598EFF] on all interactive elements

Testing

npx vitest run components/landing/landing-page-nav-bar.test.tsx --coverage.enabled=false

All 30 tests pass.

- Add hamburger toggle (Lucide Menu/X icons) with aria-expanded,
  aria-controls, aria-haspopup=dialog below the md (768px) breakpoint
- Slide-in panel from right via CSS transform transition (no JS animation,
  prefers-reduced-motion respected automatically)
- Full focus trap: Tab/Shift+Tab cycle within panel; Escape, hamburger
  re-click, close button, and backdrop click all close and return focus
  to the trigger
- Route-change auto-close via usePathname effect
- Body scroll lock while panel is open
- role=dialog, aria-modal=true, aria-hidden toggle on the panel
- aria-current=page on active nav links in both desktop and mobile nav
- 30 unit tests covering all behaviours (all passing)
- design/a11y-checklist.md updated; resolves P1-03

Closes Stellopay#876
@vercel

vercel Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

@ifygreg01-best is attempting to deploy a commit to the Jagadeesh B's projects Team on Vercel.

A member of the Team first needs to authorize it.

@ifygreg01-best

Copy link
Copy Markdown
Author

Hi maintainer I have completed the implementation for this issue.could you please approve the workflow so the vercel checks can run? Thank you

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.

Add a slide-in mobile menu with focus-trap to components/landing/landing-page-nav-bar.tsx below 768px

1 participant