Repository navigation
fix(header): move mobile navbar closer to the top of the viewport - #221
Conversation
The Figma mobile frames are full device screens, so the navbar's 56px offset includes the status bar. The browser viewport already starts below it, which left the bar hanging about 40px too low. Use a 16px offset that steps up to 24px and 32px on wider screens before the desktop layout's 40px, falling back to the safe-area inset when the page is drawn under the status bar. Size the open menu's max height from the same offset so it keeps an equal gap at the bottom. Closes #120 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. WalkthroughThe mobile menu panel now uses a responsive, safe-area-aware top offset. Its maximum height calculation uses that offset instead of a fixed subtraction. ChangesMobile menu spacing
Change: Bug fix Merge Risk:
|
Closes #120
Problem
On mobile the navbar sat 56px below the top of the viewport, visibly lower than in the design.
The Figma mobile frames are full 402×874 device screens, so the navbar's
y=56includes the status bar and Dynamic Island. The code copied that astop-14, but a browser viewport already starts below the status bar, so the bar ended up about 40px too low.Change
Only
src/components/header/mobile-layout.tsxis touched.The top offset is now a
--nav-topvariable instead of a fixedtop-14:The 24px and 32px steps are not in Figma; they are there so the bar does not jump from 16px to the desktop's 40px at the breakpoint.
Each step is wrapped in
max(…, env(safe-area-inset-top)), so the bar stays clear of the notch if the page is ever drawn under the status bar (installed as an app, or withviewport-fit=cover).The open menu's
max-heightwas hard-coded for the old offset (100dvh - 9rem). It now derives from--nav-top, so the open panel keeps the same gap at the bottom as at the top and scrolls inside when it does not fit.Verification
Measured on a local dev server in Chrome, on
/,/about,/join,/matricoleand/groups:src;biome lintis clean on the changed file.Not tested: a real iOS device, and the safe-area fallback (desktop Chrome reports a zero inset).
Note for review
Page content keeps its existing top padding, so the gap between the navbar and the first heading on mobile is about 40px larger than before. I left it alone because the issue is only about the navbar.
🤖 Generated with Claude Code