Skip to content

feat(mobile-nav): hamburger menu + responsive screens (≤640px) - #63

Merged
rezailmi merged 2 commits into
mainfrom
worktree-mobile-nav-plan
May 24, 2026
Merged

feat(mobile-nav): hamburger menu + responsive screens (≤640px)#63
rezailmi merged 2 commits into
mainfrom
worktree-mobile-nav-plan

Conversation

@rezailmi

Copy link
Copy Markdown
Collaborator

Summary

  • Top-left circular hamburger button (≤640px) opens a left-slide Base UI Dialog drawer with the same six destinations as the desktop SideRail.
  • Sheet primitive collapses to a single stacked pane on mobile; LettersSheet switches to master/detail with a 44px back bar; ProfileSheet's 6-tab strip horizontal-scrolls.
  • Visual treatment mirrors existing in-world FABs (WorldIconButton): circular, bg-white/82 backdrop-blur-md, warm shadow, +12px inset matching WorldControlsToggle / ZoomHud.
  • New shared modules: nav-items.ts, nav-active.ts, use-nav-gate.ts, use-is-mobile.ts. Drawer primitive gains a side: 'bottom' | 'left' prop.

Plan & review

Built via /ce-plan/ce-work/ce-code-review pipeline. Plan: docs/plans/2026-05-24-001-feat-mobile-nav-hamburger-screens-plan.md. 7 safe_auto + 6 best-judgment code-review fixes applied (P1 drawer portal-escape on rotation, P2 useNavGate hook extraction, P2 useIsMobile relocation, P2 LettersSheet effect mount-gate, P2 hamburger-clearance derivation comments, P2 engine CSS placement annotation).

Test plan

  • pnpm check — zero TypeScript errors
  • pnpm test — 669 passing, 127 skipped, 10 pre-existing failures unchanged (zero new regressions)
  • Visual smoke at 375px in dev (hamburger, drawer open/close, navigation, sheet stacking, master/detail, HUD vertical clear)
  • Follow-up tests (intentionally surfaced as residual work): mobile-nav.test.tsx, drawer.test.tsx (side='left' coverage), nav-active.test.ts, letters-sheet.test.tsx matchMedia coverage

Adds a top-left circular hamburger that opens a left-slide nav drawer
(Base UI Dialog) carrying the same six destinations as the desktop
SideRail. Hides SideRail on phone-narrow widths via max-[640px]:hidden;
shows MobileNav via min-[641px]:hidden on the trigger.

Sheet primitive collapses to a single stacked pane on mobile:
SheetSidebar becomes full-width with bounded max-h-[40vh] (keeps
internal scroll), SheetSidenav becomes a horizontal scroll-tab strip.
LettersSheet switches to master/detail (list ↔ detail one at a time)
with a 44px back bar; ProfileSheet's 6-tab strip horizontal-scrolls.

Shared navigation primitives:
- nav-items.ts: SHEET_HREFS + RailItem config
- nav-active.ts: pathname → active-key helpers
- use-nav-gate.ts: onboarding-hide guard + optimistic pendingPathname
- use-is-mobile.ts: SSR-safe matchMedia hook (initializes from
  window.matchMedia on first client render)

Visual chrome matches existing in-world FAB family:
- Hamburger style mirrors WorldIconButton (rounded-full, bg-white/82,
  backdrop-blur-md, warm shadow, lift-on-hover)
- +12px inset matches WorldControlsToggle / ZoomHud convention
- Drawer primitive grows a `side: 'bottom' | 'left'` prop; bottom
  retains grabber + close, left renders position-only

Mechanical knock-ons:
- Engine media-query split: --rail-width zeros at ≤640px (matches
  Tailwind), --frame-inset/--frame-radius shrink stays at ≤520px
- studentSpaceFrameClassName reserves top gutter (4rem) instead of
  bottom strip
- Left-anchored HUDs bump down +68px on mobile to clear hamburger
- Drawer auto-closes on viewport flip to desktop (DrawerPortal escapes
  the trigger wrapper, so the trigger's :hidden alone wouldn't hide it)

LettersSheet auto-select is mount-gated via ref so rotation
mobile↔desktop doesn't retroactively trigger selection.

Plan: docs/plans/2026-05-24-001-feat-mobile-nav-hamburger-screens-plan.md
Tests: 669 passing, no new regressions (10 pre-existing failures
unchanged). 4 follow-up test files identified as residual:
mobile-nav.test.tsx, drawer.test.tsx, nav-active.test.ts, letters-sheet
matchMedia coverage.
@vercel

vercel Bot commented May 24, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sensemaking-agents Ready Ready Preview, Comment May 24, 2026 7:20am

# Conflicts:
#	src/components/student-space/navigation/SideRail.tsx
@rezailmi
rezailmi merged commit 15b519d into main May 24, 2026
3 of 4 checks passed
@rezailmi
rezailmi deleted the worktree-mobile-nav-plan branch May 24, 2026 07:20
wondopamine added a commit that referenced this pull request May 24, 2026
…tab spacing

- Kira dialogue: replace the head-anchored speech bubble with a
  centered chat-card just above the safe-area bottom (≥96px clearance
  from the Capture FAB / FirstChat chips), with a companion-name
  eyebrow read from state.profile.displayCompanionName(). Drops the
  per-frame screen-pos projection from KiraDialogueController; update()
  is now only the hold-timer + idle-invite checks. Applies to
  onboarding (FirstChat sayOnboarding), greetings, idle invites, and
  chat-more beats. Mobile readability gains from PR #61's tighter
  follow are no longer needed since the card is layout-anchored.
- ProfileSheet: move space-y-8 from <SheetBody> onto the
  <div data-tab-content> wrapper. The motion refactor (35df935) made
  the wrapper the only direct child of SheetBody, so the original
  rule had stopped reaching the sibling sections; QC-0 (70cc00b)
  just made the collapsed gap visible.
- Engine View: refresh the kiraDialogue.update() comment to reflect
  the timer-driven scope (no more screen-position read).

Mobile-nav supersession: PR #63 (15b519d) shipped a Drawer-based
hamburger + responsive Sheet primitive — same UX intent as the
Popover-based mobile nav we prototyped, with a more thorough refactor
(nav-items.ts, MobileNav.tsx, use-is-mobile.ts). Adopting PR #63's
direction wholesale; our local SideRail changes are not re-applied.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant