feat: persist quote filter settings with additive filter logic#49
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.
All filters (categories, custom, favorites, collections) now use additive logic: - Quote passes if it matches ANY enabled filter criteria - Favorites filter renamed from showFavoritesOnly to showFavorites - Collections can now work standalone without categories - Updated tests to reflect new additive behavior
- add "Copy AI Prompt" button to CSV Import modal for generating new quotes - add "Copy AI Prompt" button to collection view for generating complementary quotes - prompts include CSV format, available categories, and existing quotes context - collection prompt helps AI understand existing quotes to avoid duplicates
- add tabbed interface to switch between file upload and text paste - add textarea for pasting AI-generated CSV content directly - add parse csv button to validate and preview pasted text - move copy ai prompt button to paste text tab for better UX
Source information is now shown as a hover tooltip on the author name instead of a separate visible element, keeping the UI cleaner while still making the information accessible.
Resolve naming conflicts between branches: - Rename showFavorites to showFavoritesOnly for clarity - Update all related functions and tests accordingly
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
showFavoritesOnlytoshowFavoritesto reflect new additive behaviorTest plan