Repository navigation
feat(frontend/mobile): hamburger drawer nav for narrow viewports - #991
Conversation
- Add hamburger button (#hamburger-btn) to the topbar; hidden above
768px via CSS (display: none), shown as inline-flex on mobile.
- Add sidebar overlay (#sidebar-overlay) that dims content while
the drawer is open; click closes the drawer.
- Sidebar (#sidebar) slides in from the left with a CSS transition
(transform: translateX(-100%) -> 0) when body.sidebar-open is set.
- Body scroll locked via body.sidebar-open { overflow: hidden }.
- Desktop collapse toggle (.app-sidebar-toggle) hidden on mobile
(redundant with overlay/Escape/link-click close affordances).
- Filter chips (.app-topbar-filters) wrap to a second row on narrow
viewports (flex-wrap: wrap) rather than overflowing.
- setupMobileNav() in app.ts wires: hamburger click, overlay click,
Escape-to-close, sidebar link click (unmodified left-click only).
- Focus management: open focuses first sidebar link; close returns
focus to hamburger button.
- aria-expanded on hamburger and aria-hidden on overlay toggled on
every state change.
- 15 tests in mobile-nav.test.ts cover all interaction paths.
Design decisions:
- Breakpoint: 768px (matches the project's existing mobile breakpoint
in responsive.css @media (max-width: 768px)).
- No new dependencies: no focus-trap library; focus management is a
simple querySelector on the sidebar rather than a full trap (the
sidebar is a nav, not a dialog; Tab naturally exits to the main
content which is what mobile users expect).
- The existing .app-sidebar-toggle (desktop collapse button) is hidden
on mobile rather than repurposed, to avoid coupling desktop and mobile
close semantics.
|
Warning Review limit reached
More reviews will be available in 37 minutes and 26 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
display: noneabove 768px.Design
Breakpoint: 768px (matches the existing
@media (max-width: 768px)inresponsive.css).Open:
body.sidebar-openclass added; sidebar translates fromtranslateX(-100%)totranslateX(0)with a 250ms ease transition; translucent overlay fades in behind the drawer.Close: overlay click, Escape key, or any unmodified sidebar link click removes
.sidebar-openand returns focus to the hamburger button.Scroll lock:
body.sidebar-open { overflow: hidden }prevents the page from scrolling while the drawer is open.Filter chips:
.app-topbar-filtersgainsflex-wrap: wrapon mobile so chips flow to a second row rather than overflowing or being clipped.Accessibility
<button type="button" aria-controls="sidebar" aria-expanded="false">witharia-expandedtoggled on every state change.aria-hiddentoggled.keydownlistener ondocumentfires only when the drawer is open.<nav>, not arole="dialog"; Tab naturally exits to main content, which is the expected mobile behaviour).Test plan
frontend/src/__tests__/mobile-nav.test.ts.sidebar-openaria-expandedtoggles correctlyaria-hiddenon sidebar and overlay toggled correctlyapp.test.ts(16 tests) passes without changeshtml.test.ts(97 tests) passes without changesnpx tsc --noEmitcleanOut of scope