Skip to content

fix(nav): soft-nav cross-route mobile drawer links - #273

Merged
yigitdot merged 2 commits into
mainfrom
claude/mobile-drawer-soft-nav-c5b382
Oct 9, 2026
Merged

yigitdot merged 2 commits into
mainfrom
claude/mobile-drawer-soft-nav-c5b382

Conversation

@yigitdot

@yigitdot yigitdot commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Before this change, tapping a mobile drawer section from another page (/blog/*, /legal/*) reloaded the whole page with window.location.assign(...). That reload was a workaround for the Next 16 hash-appending bug (#116). Next 16.3.8 fixes that bug, and #270 already removed the same workaround from the desktop nav. The drawer now navigates the same way the desktop nav does.

  • MobileMenu.tsx: the drawer's close cleanup calls router.push(isHome ? "/" : \/#${anchor}`)fromnext/navigation. It still runs after the body-style restore, so the body is no longer pinned (position: fixed`) when the navigation starts.
  • The comment no longer calls the soft-nav path unreliable, and router is added to the effect's dependency list (the router instance is stable).
  • Same-page drawer taps work as before.

Closes #272

Verification

pnpm lint, pnpm typecheck, pnpm test (521/521) and pnpm build all pass.

Tested in headless Chrome at 375×812 against the static export: open the drawer, tap a link, then check the result.

From → tap URL after Reload Body unpinned Lands on
/blog/ → method /#method no yes section at viewport top
/blog/why-now/ → faq /#faq no yes section at viewport top
/legal/privacy/ → contact /#contact no yes section at viewport top
/blog/, /legal/privacy/ → home / (no hash) no yes page top
/ → method / home unchanged no yes unchanged (focus moves into section)

Reviewer notes

  • After a tap from another page, keyboard focus goes back to the menu button. Same-page taps move focus into the section. Moving focus into the section across pages would be a separate follow-up.
  • Don't verify this in a hidden browser pane. A hidden pane pauses requestAnimationFrame, so neither this nor the fix(deps): clear dependabot alerts and unblock monthly dependabot prs #270 desktop nav scrolls there. Use a visible or headless browser.

🤖 Generated with Claude Code

Closes #272

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 9, 2026 01:21

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Deploying website with  Cloudflare Pages  Cloudflare Pages

Latest commit: 55933ea
Status: ✅  Deploy successful!
Preview URL: https://0bb4c306.website-70y.pages.dev
Branch Preview URL: https://claude-mobile-drawer-soft-na.website-70y.pages.dev

View logs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@yigitdot
yigitdot merged commit adfca60 into main Oct 9, 2026
6 checks passed
@yigitdot
yigitdot deleted the claude/mobile-drawer-soft-nav-c5b382 branch October 9, 2026 02:13
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.

fix(nav): soft-nav cross-route mobile drawer links instead of a full reload

2 participants