feat(www): merge mobile nav into the search drawer - #699
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The mobile nav drawer duplicated the search dialog's empty state (nav links, docs tree, GitHub, theme toggle) in bigger type. Below lg the navbar now shows a single menu trigger that opens the search drawer: same Dialog, two triggers (search icon on lg+, hamburger below). The drawer opens without autofocus on mobile so browsing doesn't summon the keyboard; desktop cmd-K still autofocuses. A Home link joins the Navigation section for parity with the deleted menu. GitHub and theme toggle icons are desktop-only — both remain reachable in the drawer's General section.
5fb327d to
0dc5747
Compare
Two-bar menu icon (Linear's marketing-site trigger), no hover/press fill on the mobile menu button, and a vertical separator before the desktop Open studio CTA.
Adds a backdropClassName prop to Drawer.
This reverts commit f69c8c0.
Code review1 issue found. Breakpoint mismatch: mobile menu trigger vs. drawer breakpoint www/src/components/layout/header.tsx L104-L109 gates the hamburger trigger on But www/src/components/search-command.tsx L96-L102 picks the Drawer-vs-Modal branch and So in the 768–1023px band, tapping this hamburger renders the desktop Suggested fix: align the two breakpoints — e.g. gate the header trigger/chrome on Note: two other candidate findings (a registry-drift claim tied to an alleged |
At 768-1023px the hamburger is the only trigger but the drawer/modal split flipped at 768px, handing tablets an autofocused desktop modal. The split now happens at lg to match the header chrome.
What
Below
lgthe navbar now shows a single Menu trigger (hamburger) that opens the search drawer. The separate mobile nav drawer is deleted, and the "Open studio" CTA is desktop-only.header.tsx— oneSearchCommandcarries two triggers via RAC DialogTrigger context: search icon onlg+, hamburger below. GitHub, theme-toggle and the "Open studio" CTA are desktop-only (nav, GitHub and theme stay reachable in the drawer; Studio via its Navigation section). The /studio Export action portaled intoHeaderActionsSlotis untouched and stays visible on mobile.search-command.tsx/search-dialog.tsx—autoFocus={!isMobile}: the mobile drawer opens with the keyboard closed (browse intent); desktop ⌘K still autofocuses. Added a Home link to the Navigation section for parity with the deleted menu.mobile-nav.tsx.Why
The mobile nav drawer duplicated the search drawer's empty state — nav links, the full docs tree, GitHub, and theme toggle — in bigger type. Two navbar triggers opened near-identical drawers; merging them leaves one surface that covers both browse and search intent. The studio CTA is a conversion path to a desktop-first tool and crowded the 375px navbar; contextual actions (Export on /studio) keep their mobile slot.
Notes for review
touchstart.