Repository navigation
mobile: remember selected filters across reloads - #3567
Merged
Merged
Conversation
In the mobile view, sorting, theme, and accent color persist across reloads via webui.mobile.* settings, but selected filters were only held in memory. When clicking the reload button (or refreshing the page), active filters were lost and the list reverted to displaying all torrents. Save active filters under webui.mobile.filters when committed in filterDone, and restore them at startup via plugin.storedFilters. Validate and sanitize stored filters so unknown status options and non-string values are ignored. Guard applyFilters from dropping filters before torrents are loaded, and ensure torrent labels are registered even if the desktop category panel has not yet populated on initial paint. Includes unit test coverage for storedFilters, filterDone, and applyFilters. Assisted-by: AI (Google DeepMind / Antigravity)
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
In the mobile view, the sort order, theme, and accent color persist across reloads via
webui.mobile.*settings, but selected filters (status, label, tracker) were held only in memory. When clicking the reload button (mobile.refresh()), active filters were reset and the list reverted to displaying all torrents.Changes
webui.mobile.filterswhen committed infilterDone().plugin.storedFilters()to load, validate, and sanitize the saved filters on initialization inplugin.init(). Unknown status options, corrupted JSON, and non-string values are safely discarded.applyFilters()from dropping label/tracker filters before torrent data has been loaded.processTorrents()even if the desktop category panel has not finished populating on the initial paint.tests/plugins/mobile/settings.spec.jscoveringstoredFilters,filterDonesaving behavior, andapplyFilterspreservation.Note: This pull request was prepared with AI assistance.