Repository navigation
feat(admin): mobile shell with a nav drawer, header and scrolling content (#226) - #227
Conversation
…tent (#226) Phase 1 of #226, one file as scoped: frontend/src/routes/+layout.svelte. The sidebar was w-56 with no breakpoint, so a 390px phone had 224px of chrome and 166px for content; the wrapper's overflow-hidden then clipped rather than scrolled. Every route was unusable below md. - Below md the sidebar is an off-canvas drawer: fixed, w-72 capped at 85vw, with a backdrop. From md up it is the same node, static at w-56 as before. - A compact md:hidden header carries the menu button and the user's name. - The drawer closes on navigation (route effect and link clicks), on Escape, and when the viewport grows past md, so it cannot linger over the desktop layout. - The closed drawer sets "visibility: hidden" rather than only a transform, so its links stay out of the tab order; while it is open <main> is inert. - Content area: min-h-0/min-w-0 so it scrolls inside the flex column, and padding drops to px-4 py-4 on small screens (was px-8 py-8 everywhere). Verified in a real browser at 390, 800 and 1280 px: - 390: sidebar hidden, header flex, main 390 wide, document scrollWidth 390 (no horizontal overflow), drawer opens to 288px with backdrop and main inert, Escape closes, nav click navigates and closes. - 800/1280: sidebar visible, static, 224px, header hidden - desktop unchanged. - /admin/settings at 390: main scrollHeight 1730 vs clientHeight 803, scrolls to 400. Content scrolls instead of clipping. No automated viewport test: the existing visual suite mounts shadcn components in isolation with a standalone svelte() (not sveltekit()) config, so it cannot render +layout.svelte, which needs $app/stores, $app/paths and a live /v1/users/me. Real coverage needs a route-level browser test against a seeded server, which is new infra. Flagging rather than silently skipping it. Out of scope, unchanged: page-level headers still squeeze at 390 (the bookings title truncates against its buttons) - that is phases 2/3.
There was a problem hiding this comment.
Important
The drawer can't scroll, so its own footer — Report an issue and Sign out — is unreachable on short viewports (a landscape phone is enough). Two smaller notes inline, plus a doc entry that now overstates the gap.
Reviewed changes
- Off-canvas drawer below
md— the sidebar node becomesfixedwith a backdrop and-translate-x-full invisiblewhen closed, stayingstatic/w-56frommdup, so nav markup isn't duplicated. - Compact mobile header —
md:hidden, with anaria-expandedhamburger and the user's name. - Four close paths — route effect, link/button clicks, Escape, and a
matchMedialistener that closes it when the viewport crosses back abovemd. - Modal-ish semantics —
<main>isinertwhile open, andvisibility: hiddenkeeps the closed drawer out of the tab order. - Scrolling content —
min-h-0on the flex children plus responsive padding (px-4/py-4at the small end).
ℹ️ The §18 "does not lay out below ~600px" entry now overstates the gap
docs/ARCHITECTURE.md §18 still opens with "The admin SPA does not lay out below ~600px", which was true before this PR and no longer is for the shell. That doc's own rule (§24) asks for the matching section to be updated in the same PR as the behaviour change, so the next person reading it would think the shell work is unstarted.
Technical details
# §18 known-gap entry needs rescoping
## Affected sites
- `docs/ARCHITECTURE.md:981` — "The admin SPA does not lay out below ~600px. On the settings
pages the nav and the content sit in one flex row with no stacking breakpoint, so the
content column is squeezed to near-zero width..." The shell half of this is fixed by
this PR; the settings half is not.
## Required outcome
- The entry should say the outer shell stacks below `md` now (phase 1), and scope the
remaining gap to what is still true: the settings sub-nav (`frontend/src/routes/settings/+layout.svelte`,
`<div class="flex gap-8"><nav class="w-44 shrink-0">`) still doesn't stack, and the page
grids/tables are still phase 2/3 work.
## Open questions for the human (optional)
- If #226 is going to land phases 2–4 shortly, leaving the entry until then is defensible —
worth a one-line "phase 1 landed" amendment either way.deepseek-v4.1-flash | 𝕏
…cus (#226) Addresses the pullfrog review on #227. 1. The drawer could not scroll. `nav` was `flex-1` with the default `min-height: auto`, so it refused to shrink below its content and pushed the footer ("Report an issue", "Sign out") past the bottom edge on any short viewport - a landscape phone is enough. Overflow from a `fixed` element does not extend the document's scroll area, so those controls were unreachable. nav is now `min-h-0 flex-1 overflow-y-auto`, keeping the user block and footer pinned. 2. The `matchMedia` guard was specified in px (768px) while every `md:` class compiles to 48rem. They only agree at the 16px default font size; at, say, 20px `md:` starts at 960px, so the drawer could be opened in the 768-959px band with no `change` event on widening - leaving `<main>` inert and the page unclickable. The query is now `(min-width: 48rem)`, in lockstep with the classes it guards. 3. Nothing moved focus. Opening left focus on the trigger the backdrop covers; closing hid the focused element (`visibility: hidden`), dropping focus to <body>. Opening now focuses the first control inside the drawer, and closing returns focus to the menu button. Also rescopes the ARCHITECTURE §18 "does not lay out below ~600px" entry, per the repo's own rule that the matching section changes in the same PR: the shell half is done, the remaining gap is the settings sub-nav and the phase 2/3 page work. Verified at 390x620 and 390x500 with the drawer open: nav scrollable (535 > 458), "Sign out" bottom 584 inside a 620 panel, focus inside the drawer on open, focus back on the trigger after Escape. Desktop at 1280 unchanged: sidebar visible, static, 224px, header hidden, nav not scrollable.
|
Addressed all three findings in a1a470a.
Also rescoped the Re-verified desktop at 1280: sidebar visible/static/224px, header hidden, nav not scrollable. |
There was a problem hiding this comment.
✅ No new issues found. Commit
a1a470acloses out all three findings from the last review, and the follow-up code is correct as far as I can trace it.
Reviewed changes
- Drawer content now scrolls —
navismin-h-0 flex-1 overflow-y-auto, so the footer (Report an issue,Sign out) stays reachable on short viewports instead of being pushed past the panel; the desktop sidebar gets the same protection. - Focus moves with the drawer —
bind:thisrefs on the aside and the hamburger, plus an$effectthat focuses the first control in the panel on open and returns focus to the trigger on close, guarded by a plaindrawerWasOpenflag so the return only fires for an actual open→closed transition. matchMediathreshold expressed inrem—(min-width: 48rem)now matches themd:utilities exactly, so a non-default browser font size can no longer leavesidebarOpentrue (and<main>inert) in the band where the trigger is already hidden.- §18 known-gap entry re-scoped — the entry now says "does not fully lay out", records that phase 1 landed, and scopes what remains to the settings sub-nav (still
flex gap-8with aw-44 shrink-0nav) plus the phase 2/3 list and form work.
deepseek-v4.1-flash | 𝕏
|
Merged. This fixes something that was genuinely broken: 224px of fixed chrome on a 390px phone left no usable page, and Two things worth recording for whoever picks up phase 2:
The focus handling (move into the drawer on open, back to the trigger on close, |

Phase 1 of #226. One file, as scoped:
frontend/src/routes/+layout.svelte.The blocker
w-56with no breakpoint meant 224px of chrome on a 390px phone, leaving ~166px, and the wrapper'soverflow-hiddenclipped instead of scrolling. Every route was unusable belowmd.What changed
md— the sidebar becomesfixed,w-72capped at85vw, with a backdrop. Frommdup it is the same node,staticatw-56. No duplicated nav markup.md:hidden, carries the menu button and the user's name.md, so it cannot linger as an invisible overlay.visibility: hidden, so its links stay out of the tab order rather than being focusable off-screen. While open,<main>isinert.min-h-0/min-w-0on the flex children, padding drops topx-4 py-4on small screens.Verified in a real browser
flex, main 390 wide, documentscrollWidth390 — no horizontal overflowmain.inert = true,aria-expanded="true"main.inert = falsestatic, 224px, header hidden — desktop unchanged/admin/settings@ 390scrollHeight1730 vsclientHeight803, scrolls to 400 — content scrolls, no longer clipsScreenshots taken at each step.
One gap, stated plainly
I did not add an automated viewport test. The existing visual suite mounts shadcn components in isolation under a standalone
svelte()config (notsveltekit()), so it cannot render+layout.svelte— that needs$app/stores,$app/pathsand a live/v1/users/me. Real coverage means a route-level browser test against a seeded server, which is new test infra, and the issue asked for no new infra. So I verified by hand instead and am flagging it rather than quietly skipping the constraint. If you want that harness, it is worth its own issue — it would also cover phases 2–4.Deliberately untouched
Page-level headers still squeeze at 390 — on
/admin/bookingsthe title truncates against its buttons. That is the page's own layout (phases 2/3), not the shell, and fixing it here would blur the phase boundary.pnpm check: 0 errors.pnpm test:visual: 5 passed.pnpm build: clean.🤖 Generated with Claude Code