Skip to content

fix(library): restore breadcrumb 'All' navigation broken by next-view-transitions#3829

Merged
chrox merged 1 commit intomainfrom
fix/3782-bookshelf-all-breadcrumb
Apr 11, 2026
Merged

fix(library): restore breadcrumb 'All' navigation broken by next-view-transitions#3829
chrox merged 1 commit intomainfrom
fix/3782-bookshelf-all-breadcrumb

Conversation

@chrox
Copy link
Copy Markdown
Collaborator

@chrox chrox commented Apr 11, 2026

Summary

Test plan

  • pnpm test — 3141 passed (7 unit tests added for useLibraryNavigation covering forward, back-to-root, sibling-swap, multi-param preservation, direction attribute, and onBeforeNavigate ordering)
  • pnpm lint — clean (tsgo --noEmit && biome check .)
  • Bug reproduced on production build with the unmodified code: clicked "Literature" group → URL became /library?group=f1506b6 → clicked "All" → URL stayed at /library?group=f1506b6 for 5+ seconds (user perceives "nothing happens").
  • Fix verified on production build with the same steps: clicked "All" → URL navigated to /library within ~1s, bookshelf re-rendered with all groups.
  • Verified fresh page reload + first click works (the user-reported failure mode).
  • Verified multiple round-trips (group → All → group → All) all work.
  • Sanity check on Tauri desktop builds (Windows/macOS) — not blocking, the fix lives entirely in the Next.js layer and the unit tests cover the navigation contract.

Closes #3782.

🤖 Generated with Claude Code

…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>
@chrox chrox merged commit 7bf4822 into main Apr 11, 2026
7 checks passed
@chrox chrox deleted the fix/3782-bookshelf-all-breadcrumb branch April 11, 2026 14:04
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>
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.

On Windows in Readest 0.10.4 going back from a stack into the main dashboard does not work

1 participant