Skip to content

fix(nav): extend mobile drawer through tablet widths - #92

Merged
yigitdot merged 3 commits into
mainfrom
fix/91-drawer-tablet-breakpoint
May 11, 2026
Merged

yigitdot merged 3 commits into
mainfrom
fix/91-drawer-tablet-breakpoint

Conversation

@yigitdot

@yigitdot yigitdot commented May 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Lifts the drawer gate from 768px → 1280px so iPad portrait and similar tablet/small-laptop widths get the mobile drawer instead of the crowded desktop nav.
  • Scales .mm-panel width to clamp(380px, 48vw, 520px) above 768px so tablets get a proportional panel. The clamp floor matches the phone cap, so the panel never shrinks at the 768px crossover.
  • Updates matchMedia in MobileMenu.tsx and md:flex → xl:flex in Chrome.tsx so JS + Tailwind utilities track the new CSS gate.

Follow-up polish (fd745a1)

  • Chrome.tsx — Litepaper anchor moved from inline style to border-b border-current pb-[2px] so it matches Docs/Blog character-for-character (Gemini review consistency note).
  • globals.css — tightened the new tablet panel-width comment to just the WHY (floor-matching, crossover shrink prevention).
  • MobileMenu.tsx — matchMedia comment now records the ≥1280px threshold so a reader can grep it against the CSS gate.

Closes #91.

Test plan

  • DevTools responsive walk: 375 / 767 / 768 / 1024 / 1194 / 1279 / 1280 — drawer visible up to 1279, desktop nav visible at 1280+
  • Panel width: 380px at 767 and 768 (no shrink), ~491px at 1024, 520px from ~1083px through 1279
  • Open drawer at ~900px, drag window past 1280 — drawer auto-closes (matchMedia listener)
  • Open drawer mid-tablet, close — page scroll position restored
  • Tab through drawer — focus trapped to panel
  • iPad portrait/landscape simulator if available
  • pnpm lint and pnpm build clean

🤖 Generated with Claude Code

The drawer was gated to phones at 768px, which left iPad portrait
(~768–834px) and similar tablet widths showing the crowded desktop
nav. Lift the gate to 1280px so the drawer covers phones through
small laptops, and scale the panel width to clamp(380px, 48vw,
520px) above 768px so tablets get a proportional drawer without
shrinking at the 768px crossover.

- app/globals.css: gate 768px → 1280px; new tablet panel-width rule
- components/site/MobileMenu.tsx: matchMedia 768px → 1280px to keep
  the auto-close listener in lockstep with the CSS gate
- components/site/Chrome.tsx: md:flex → xl:flex on the four desktop
  nav clusters

Closes #91

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 11, 2026 22:21
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented May 11, 2026 •

Copy link
Copy Markdown

Deploying website with  Cloudflare Pages  Cloudflare Pages

Latest commit: fd745a1
Status: ✅  Deploy successful!
Preview URL: https://90357a9f.website-70y.pages.dev
Branch Preview URL: https://fix-91-drawer-tablet-breakpo.website-70y.pages.dev

View logs

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the responsive breakpoints for the mobile menu and navigation components, shifting the transition from mobile/tablet to desktop from 768px to 1280px. It also introduces a specific panel width for tablet devices using a CSS clamp. A review comment suggests improving codebase consistency in Chrome.tsx by replacing inline styles on the 'Litepaper' link with Tailwind utility classes to match the 'Docs' and 'Blog' links.

Comment thread components/site/Chrome.tsx Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the mobile drawer navigation behavior through tablet and small-laptop widths by moving the “desktop nav” cutoff from 768px to 1280px, and adjusts the drawer panel sizing so it feels proportionate on tablets.

Changes:

  • Updated the JS resize/desktop-close breakpoint in MobileMenu.tsx from 768px to 1280px so the drawer auto-closes when crossing into true desktop widths.
  • Switched desktop-nav Tailwind visibility from md:flex to xl:flex in Chrome.tsx so desktop nav elements stay hidden until 1280px.
  • Updated global CSS gating and added a tablet-width panel sizing rule (clamp(380px, 48vw, 520px)) for .mm-panel.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
components/site/MobileMenu.tsx Aligns matchMedia “close on desktop” behavior with the new 1280px desktop gate.
components/site/Chrome.tsx Defers desktop nav/link visibility to xl so tablets use the mobile drawer.
app/globals.css Moves the drawer CSS hide breakpoint to 1280px and scales drawer panel width for tablet ranges.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

yigitdot and others added 2 commits May 12, 2026 01:45
- Chrome.tsx: drop inline style on Litepaper anchor in favour of
  border-b border-current pb-[2px] so it matches the Docs and Blog
  siblings character-for-character (Gemini review consistency note).
- globals.css: tighten the tablet panel-width comment to just the
  WHY (the floor matching the phone cap, preventing crossover
  shrink). The "tablet widths get a wider panel" framing was
  restating what the media query already says.
- MobileMenu.tsx: append "(≥1280px, matches the CSS gate)" to the
  matchMedia comment so a reader cross-checking against globals.css
  can grep the threshold.

No behavior change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@yigitdot
yigitdot merged commit 4ca9a8a into main May 11, 2026
7 checks passed
@yigitdot
yigitdot deleted the fix/91-drawer-tablet-breakpoint branch May 11, 2026 22:49
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.

Mobile drawer breaks at tablet/iPad widths (≥768px)

2 participants