fix(account): keep section changes in /dashboard and /settings from looking like a reload - #912
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/settingsand/dashboardare 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.viewTransitioncross-faded the whole document on every navigation.This PR:
app/plugins/account-shell-navigation.client.ts, which setsviewTransition: falseandscrollToTop: falseonto.metainbeforeEach, for a section change inside one shell only (isAccountShellSectionChange). Other navigations keep the fade.<AccountShell>bring the new section's start into view only when the visitor had scrolled past it.scroll-mt-24clears the sticky header.definePageMetadoes 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.startViewTransitioncalls), keeps the scroll position and keeps the same hero element./aboutstill fades.🤖 Generated with Claude Code