fix(library): restore back button from series/author folders (#4437) - #4629
Merged
Conversation
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>
dalzyu
added a commit
to dalzyu/readest-hermes
that referenced
this pull request
Jun 18, 2026
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
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-weboutput: 'export'build;next devis unaffected). #3832 fixed it for the breadcrumb "All" button inhandleLibraryNavigationby settinggroup=''instead of deleting it — but the series/author back button (GroupHeader.handleBack) never got the same workaround and still didparams.delete('group').It only reproduces after a cold start, when
groupBycomes from settings (not the URL) and sort/order/view are at defaults — sogroupends up the only query param, and deleting it yields/library(empty search → no-op). Within a session the View menu also putsgroupBy=authorin the URL, which keeps the query non-empty, so back works — that's why it couldn't be reproduced in-session.Fix
GroupHeader.handleBacknow setsgroup=''(mirroringhandleLibraryNavigation). The resulting/library?group=commits, and the existing cleanup effect inpage.tsxstrips the trailing emptygroup=cosmetically.Testing
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) andpnpm lint(tsgo + biome) green.?group=…→/libraryand restores the folder list.🤖 Generated with Claude Code