Skip to content

Responsive Navigation Sidebar with Collapse Toggle #514

Description

@Kingsman-99

Description

The top navigation bar becomes crowded with links on medium-width screens and is inaccessible at all on screens where a hamburger menu should be shown. A collapsible sidebar navigation for tablet and mobile viewports must replace the overflow-prone horizontal nav links.

Technical Context

src/app/layout.tsx switches between a horizontal <nav> on lg and above and a slide-in sidebar below lg managed by src/components/layout/MobileSidebar.tsx (new). A hamburger MenuIcon button from lucide-react in the top bar toggles isOpen state. The sidebar uses Tailwind translate-x-0 / -translate-x-full transitions and an overlay backdrop that closes it on click. Focus is trapped inside the sidebar when open, following the same pattern as modals (Issue 2).

Acceptance Criteria

  • On screens narrower than lg, navigation links move into a sidebar triggered by a hamburger button
  • The sidebar slides in from the left with a CSS transition of approximately 200 ms
  • Clicking the backdrop or pressing Escape closes the sidebar and returns focus to the hamburger button
  • All navigation links in the sidebar work correctly and close the sidebar after navigation
  • On lg and wider screens, the sidebar is hidden and the horizontal nav is visible regardless of sidebar state
  • All CI checks (npm test, npm run build, ESLint/TypeScript) pass and the branch has no merge conflicts

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions