Skip to content

fix(account): keep section changes in /dashboard and /settings from looking like a reload - #912

Merged
SomethingNew71 merged 2 commits into
mainfrom
fix/account-shell-scroll
Sep 29, 2026
Merged

SomethingNew71 merged 2 commits into
mainfrom
fix/account-shell-scroll

Conversation

@SomethingNew71

Copy link
Copy Markdown
Collaborator

Summary

/settings and /dashboard are nested routes: the hero and the sidebar stay mounted, and only the section content swaps. Two site-wide defaults still made a section change look like a full reload:

  • experimental.viewTransition cross-faded the whole document on every navigation.
  • Nuxt's default scroll behaviour jumped back to the hero.

This PR:

  • adds app/plugins/account-shell-navigation.client.ts, which sets viewTransition: false and scrollToTop: false on to.meta in beforeEach, for a section change inside one shell only (isAccountShellSectionChange). Other navigations keep the fade.
  • makes <AccountShell> bring the new section's start into view only when the visitor had scrolled past it. scroll-mt-24 clears the sticky header.
  • records in the rules and invariants why definePageMeta does not work here: the macro has no auto-imports, so the helper was undefined and Nuxt hard-reloaded.

Test plan

  • bun run test: 6426 pass. New tests cover the helper, the plugin and the shell scroll.
  • Typecheck matches the baseline. The format check and the shadowed auto-import sweep are clean.
  • Dev server, signed out:
    • A section change runs no view transition (0 startViewTransition calls), keeps the scroll position and keeps the same hero element.
    • Scrolled past the section start, a section change lands on the section start.
    • Leaving to /about still fades.
  • Signed in: switch between the settings and dashboard sections in a real browser.

🤖 Generated with Claude Code

…ooking like a reload

The site-wide view transition cross-faded the whole document and Nuxt's default
scroll behaviour jumped back to the hero on every section change. A client
plugin turns both off for navigations inside one account shell, and
AccountShell brings the section start into view only when the visitor had
scrolled past it.
@SomethingNew71
SomethingNew71 merged commit efb3f4c into main Sep 29, 2026
6 checks passed
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