feat(library): remember film/series filters per instance - #92
Open
ndandan wants to merge 2 commits into
Open
Conversation
Persists each instance's last-used filter set (search, status, quality/ genre/language/network, sort) in localStorage keyed by instance + type, and restores it on return via the sidebar or Films/Series nav. A head- loaded script rehydrates the form before first paint; the reset link clears saved state; explicit query params still win.
…eep links survive filter restore
The films/series pages strip ?open={id} via history.replaceState during
body parse — before this head-loaded script's turbo:load handler runs. The
restore check then saw an empty live URL, mistook the deep link for a bare
visit, and location.replace()d onto the saved filters, killing the
quick-look modal the deep link was opening (and possibly filtering the
target item out entirely).
syncCurrentPage() now reads the query string the document was actually
navigated to from the Navigation Timing entry (which replaceState cannot
touch), trusting it only while its pathname still matches the current
document. Also corrects the changelog entry: search text/page are
deliberately excluded from the persisted set, and restoration is a
one-time redirect on bare visits, not a pre-paint form rehydration.
Co-Authored-By: Claude Fable 5 <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.
Persists each instance's last-used filter set (search, status, quality/
genre/language/network, sort) in localStorage keyed by instance + type,
and restores it on return via the sidebar or Films/Series nav. A head-
loaded script rehydrates the form before first paint; the reset link
clears saved state; explicit query params still win.