Add mobile navigation (burger + sidebar drawer) - #23
Open
vzert wants to merge 1 commit into
Open
Conversation
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.
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.
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 thedocs nav at all. The API reference already ships the drawer CSS and a
body.docnav-openlistener — but nothing toggles it, because there's nobutton.
Fix
A burger button in
SiteNav(shown ≤880px) that adapts to the page:shared
body.docnav-opencontract, sliding the sidebar in as a drawerwith a scrim. This also makes the API reference's already-present
drawer functional (it just needed a trigger).
listing the nav links + CTA.
The docs sidebar gets the same slide-in-drawer treatment the API
reference already had (
app/docs.css), plus adrawer-tabsrow at thetop 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):
AI, version selector, nav tree) with a scrim ✓
drawer-tabsrow on top ✓
.nav-linksvisible (noregression) ✓
npm run typecheckclean ·npm test19/19 ·npm run buildsucceedsScope note: this is nav wiring + CSS only. It intentionally leaves out
two adjacent things from the same downstream branch — a
useThemeResiliencehook 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.