feat: persist quote filter settings across sessions#48
Merged
Conversation
Remember user's quote filter selections (enabled categories, custom quotes toggle, favorites-only mode, and active collection filters) so they are restored when reopening the extension. - Add filter settings to Settings interface in types.ts - Add default values to DEFAULT_SETTINGS in constants.ts - Update quote-store to load filters from settings on initialize - Persist filter changes when toggle methods are called - Filter out deleted collection IDs on load - Update test fixtures and mocks for new settings
Previously, persistFilterSettings would silently catch and log errors without informing the user. Now displays a toast warning so users know their filter changes may not persist.
Add comprehensive tests for filter settings persistence: - Loading persisted filter categories from settings - Loading persisted showCustomQuotes, showFavoritesOnly - Loading persisted activeCollectionIds - Filtering out deleted collection IDs on load - Using default values when settings are null - Persisting changes for toggleCategory, toggleCustomQuotes, toggleFavoritesOnly, toggleCollection, setEnabledCategories, and setActiveCollectionIds - Error handling with toast warning when persistence fails
When a collection that was an active filter is deleted, the updated activeCollectionIds was not being persisted to settings storage. This caused data inconsistency between memory and storage. Added persistFilterSettings call after updating state in deleteCollection, and added tests to verify the persistence behavior.
- Add helper functions to reduce test setup duplication - Consolidate 4 initialize tests into 1 comprehensive test - Merge toggle method tests into single describe block - Remove redundant assertions and test cases - Reduce test file by ~100 lines while maintaining coverage
…esults in no quotes Update isFiltered check to include showFavoritesOnly and activeCollectionIds so users see helpful guidance when their filter settings result in no matching quotes.
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
Changes
Settingsinterface for filter persistenceDEFAULT_SETTINGSwith filter defaultsTest plan
All manual tests verified via Playwright browser automation.