Mobile: guide-first layout with the app in a Try it sheet #2
Merged
fukomerged 5 commits into
main fromrefs/pull/2/head·merged by fuko Stacked on #1. This replaces the stacked app-over-guide mobile layout with the guide-first layout from the mobile layout brief. Desktop is unchanged, except that the split now starts at 768 px instead of 1024 px.
What changes#
- Phone layout (below 768 px): the guide fills the screen. A compact header holds a section chip and a single theme menu.
- Try it sheet: each hands-on section has a "Try it" button. It opens the Notes app as a near-full-screen sheet (iPhone layout) on the screen that section declares in
src/guide/content.tsx. - Closing the sheet: use Close, Escape, a tap on the dimmed guide, or a swipe down on the header. The guide comes back at the same reading position.
- Motion: opening takes about 450 ms with a slight spring and closing takes 320 ms. With
prefers-reduced-motionthe sheet fades instead. - Browser history: each history entry records whether the sheet was open, and Back and Forward restore that. A direct link to a note on a phone opens the sheet on that note. The rules are in
src/lib/app-sheet-history.ts. - One app instance: the Notes app is rendered once and portalled into the desktop browser frame or the mobile sheet. Resizing across breakpoints no longer recreates it.
- Focus: a focus trap keeps keyboard focus inside the sheet, recovers it after an app screen change, and returns it to the trigger on close.
- Inside the iPhone app: the bars behind floating buttons are blurred, and bottom padding keeps the search bar and pills off the last rows.
- Placeholders for later phases:
- The sheet's Network panel (latency chips, "fail next request", request log) is a disabled placeholder until Phase 4.
markSectionDone(id)shows a check on a section, but nothing calls it until there are real actions in Phase 2.
Known limits#
- Swipe-to-close works on the sheet header only, not on the app's scrolling content.
- Try it buttons only show on mobile, and they sit at the end of each section.
- Some intro copy still says "next to this guide", which is wrong on a phone. It will be updated in Phase 3.
Review#
- An independent Codex review asked for changes in three areas: the sheet's focus trap, keeping the sheet in sync with browser history, and the app remounting across breakpoints. All three are fixed.
vp check,vp test(52 tests) andvp buildpass.- Checked in a browser at 320, 390, 768, 800, 1024 and 1440 px, in light and dark, and with reduced motion.
🤖 Generated with Claude Code
- 1
fuko merged this765c1e0
fuko closed this
Sign in to join this conversation.