Skip to content

fix(library): restore back button from series/author folders (#4437) - #4629

Merged
chrox merged 1 commit into
mainfrom
fix/series-folder-back-4437
Jun 17, 2026
Merged

fix(library): restore back button from series/author folders (#4437)#4629
chrox merged 1 commit into
mainfrom
fix/series-folder-back-4437

Conversation

@chrox

@chrox chrox commented Jun 17, 2026

Copy link
Copy Markdown
Member

Summary

Fixes #4437 — inside a Series/Author library folder, the back arrow does nothing; you cannot return to the main list. Reported on Android, iOS, and Windows since v0.10.1.

Root cause

It's the same Next.js 16.2 static-export regression as #3782: router.replace() to a same-pathname URL with an empty query string silently no-ops (this applies to every non-web output: 'export' build; next dev is unaffected). #3832 fixed it for the breadcrumb "All" button in handleLibraryNavigation by setting group='' instead of deleting it — but the series/author back button (GroupHeader.handleBack) never got the same workaround and still did params.delete('group').

It only reproduces after a cold start, when groupBy comes from settings (not the URL) and sort/order/view are at defaults — so group ends up the only query param, and deleting it yields /library (empty search → no-op). Within a session the View menu also puts groupBy=author in the URL, which keeps the query non-empty, so back works — that's why it couldn't be reproduced in-session.

Fix

GroupHeader.handleBack now sets group='' (mirroring handleLibraryNavigation). The resulting /library?group= commits, and the existing cleanup effect in page.tsx strips the trailing empty group= cosmetically.

Testing

  • New src/__tests__/app/library/group-header.test.tsx — fails on the old behavior (empty query / deleted param), passes with the fix.
  • pnpm test (full suite) and pnpm lint (tsgo + biome) green.
  • Verified on-device (Xiaomi, Android 16, WebView 148, static-export build): tapping back inside an author folder takes ?group=…/library and restores the folder list.

🤖 Generated with Claude Code

Inside a Series/Author library folder, the back arrow was a no-op after a
cold start. `GroupHeader.handleBack` deleted the `group` query param, leaving
an empty search string; `router.replace('/library')` with an empty search
silently no-ops under the Next.js 16.2 static export (every non-web build).
This is the same root cause as #3782, which was fixed for the breadcrumb
"All" button in #3832 — but the series/author back button never got the
workaround.

It only reproduces after a cold start, when `groupBy` comes from settings
(not the URL) and sort/order/view are at defaults, so `group` is the only
query param; that is why it could not be reproduced within a session.

Fix: set `group=''` instead of deleting it (mirroring
`handleLibraryNavigation`). The resulting `/library?group=` commits, and the
existing cleanup effect in page.tsx strips the trailing empty `group=`.

Verified on-device (Android, WebView 148, static export): tapping back inside
an author folder now returns to the main list.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@chrox
chrox merged commit b31699d into main Jun 17, 2026
10 checks passed
@chrox
chrox deleted the fix/series-folder-back-4437 branch June 17, 2026 05:50
dalzyu added a commit to dalzyu/readest-hermes that referenced this pull request Jun 18, 2026
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.

Cannot navigate back from series folder

1 participant