Skip to content

Add mobile navigation (burger + sidebar drawer) - #23

Open
vzert wants to merge 1 commit into
markline-dev:mainfrom
vzert:feat/mobile-nav
Open

Add mobile navigation (burger + sidebar drawer)#23
vzert wants to merge 1 commit into
markline-dev:mainfrom
vzert:feat/mobile-nav

Conversation

@vzert

@vzert vzert commented Jul 18, 2026

Copy link
Copy Markdown

Problem

Below 880px there is no way to navigate. The topbar links are hidden and
the docs sidebar is display: none, so on a phone you can't reach the
docs nav at all. The API reference already ships the drawer CSS and a
body.docnav-open listener — but nothing toggles it, because there's no
button.

Fix

A burger button in SiteNav (shown ≤880px) that adapts to the page:

  • Pages with a sidebar (docs shell, API reference) — toggles the
    shared body.docnav-open contract, sliding the sidebar in as a drawer
    with a scrim. This also makes the API reference's already-present
    drawer functional (it just needed a trigger).
  • Pages without one (home, 404) — falls back to a dropdown panel
    listing the nav links + CTA.

The docs sidebar gets the same slide-in-drawer treatment the API
reference already had (app/docs.css), plus a drawer-tabs row at the
top of the drawer so the top-level tabs (Documentation / API reference)
stay reachable on mobile. The sidebar closes on navigation and on
scrim/link click. Desktop (≥881px) is unchanged.

Verification

Built and driven in a real browser at 390px (and desktop):

  • API reference — burger slides in the resource drawer (search, Ask
    AI, version selector, nav tree) with a scrim ✓
  • Docs page — burger slides in the sidebar with the drawer-tabs
    row on top ✓
  • Home (no sidebar) — burger opens the fallback dropdown panel ✓
  • Desktop 1200px — burger hidden, .nav-links visible (no
    regression) ✓
  • npm run typecheck clean · npm test 19/19 · npm run build succeeds

Scope note: this is nav wiring + CSS only. It intentionally leaves out
two adjacent things from the same downstream branch — a useThemeResilience
hook and a desktop segmented-control restyle of the tabs — so the PR stays
focused on "add mobile nav." Happy to send either separately if useful.

Below 880px there was no way to reach the nav: the topbar links are
hidden and the docs sidebar was display:none. The API reference already
shipped the drawer CSS and the body.docnav-open listener, but nothing
ever toggled it — there was no button.

Add a burger button to SiteNav that:
- toggles the shared body.docnav-open contract on pages that have a
  sidebar (docs shell, API reference), sliding it in as a drawer with a
  scrim; and
- falls back to a dropdown panel with the nav links on pages without one
  (home, 404).

The docs sidebar gets the same slide-in drawer treatment the API
reference already had, plus a row of tab links at the top of the drawer
so the top-level sections stay reachable on mobile. Desktop is unchanged.
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.

1 participant