Skip to content

feat: persist quote filter settings with additive filter logic#49

Merged
kYem merged 14 commits into
mainfrom
feat/persist-quote-filter-settings
Jan 20, 2026
Merged

feat: persist quote filter settings with additive filter logic#49
kYem merged 14 commits into
mainfrom
feat/persist-quote-filter-settings

Conversation

@kYem
Copy link
Copy Markdown
Owner

@kYem kYem commented Jan 20, 2026

Summary

  • Persist quote filter settings (categories, custom, favorites, collections) across sessions
  • Change filter logic from exclusive (AND) to additive (OR) - quotes pass if they match ANY enabled filter
  • Rename showFavoritesOnly to showFavorites to reflect new additive behavior
  • Collections can now work standalone without requiring categories

Test plan

  • All existing tests pass
  • Type check passes
  • Lint passes
  • Manual test: Enable only favorites filter → shows favorite quotes
  • Manual test: Enable only a collection → shows quotes from that collection
  • Manual test: Enable categories + favorites → shows quotes matching either

kYem added 14 commits January 12, 2026 21:10
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
@kYem kYem merged commit dfe7a35 into main Jan 20, 2026
1 check passed
@kYem kYem deleted the feat/persist-quote-filter-settings branch January 20, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant