fix(library): restore breadcrumb 'All' navigation broken by next-view-transitions#3829
Merged
fix(library): restore breadcrumb 'All' navigation broken by next-view-transitions#3829
Conversation
…iew-transitions, closes #3782 The breadcrumb "All" button was broken on first click after entering a group because next-view-transitions@0.3.5's useTransitionRouter wraps router.replace() in startTransition + document.startViewTransition, and this combination is incompatible with Next.js 16.2 RSC navigation when only the search params change for the same pathname (e.g. /library?group=foo -> /library). The navigation silently never commits. Extract the library navigation logic into a useLibraryNavigation hook that uses plain useRouter from next/navigation. The data-nav-direction attribute is still set so existing directional CSS keeps working when view transitions fire via popstate. See shuding/next-view-transitions#65 for the upstream incompatibility. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
dalzyu
pushed a commit
to dalzyu/readest-hermes
that referenced
this pull request
Apr 15, 2026
…iew-transitions, closes readest#3782 (readest#3829) The breadcrumb "All" button was broken on first click after entering a group because next-view-transitions@0.3.5's useTransitionRouter wraps router.replace() in startTransition + document.startViewTransition, and this combination is incompatible with Next.js 16.2 RSC navigation when only the search params change for the same pathname (e.g. /library?group=foo -> /library). The navigation silently never commits. Extract the library navigation logic into a useLibraryNavigation hook that uses plain useRouter from next/navigation. The data-nav-direction attribute is still set so existing directional CSS keeps working when view transitions fire via popstate. See shuding/next-view-transitions#65 for the upstream incompatibility. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
next-view-transitions@0.3.5wrapsrouter.replace()instartTransition+document.startViewTransition, and that combination is incompatible with Next.js 16.2 RSC navigation when only the search params change for the same pathname (e.g./library?group=foo->/library). The navigation silently never commits. Same upstream issue is tracked in Next.js 16.2 - Monkey-patch warning shuding/next-view-transitions#65.useLibraryNavigationhook that uses the plainuseRouterfromnext/navigation(matching the pre-feat: add directional view transitions with scroll preservation in library view, closes #3357 #3362 behavior). Thedata-nav-directionattribute is still set so the existing directional CSS keeps working when view transitions fire via popstate.Test plan
pnpm test— 3141 passed (7 unit tests added foruseLibraryNavigationcovering forward, back-to-root, sibling-swap, multi-param preservation, direction attribute, andonBeforeNavigateordering)pnpm lint— clean (tsgo --noEmit && biome check .)/library?group=f1506b6→ clicked "All" → URL stayed at/library?group=f1506b6for 5+ seconds (user perceives "nothing happens")./librarywithin ~1s, bookshelf re-rendered with all groups.Closes #3782.
🤖 Generated with Claude Code