Skip to content

feat: persist quote filter settings across sessions#48

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

feat: persist quote filter settings across sessions#48
kYem merged 7 commits into
mainfrom
feat/persist-quote-filter-settings

Conversation

@kYem
Copy link
Copy Markdown
Owner

@kYem kYem commented Jan 12, 2026

Summary

  • Remember user's quote filter selections across sessions
  • Persist enabled categories, custom quotes toggle, favorites-only mode, and active collection filters
  • Filter settings are restored when reopening the extension

Changes

  • Added 4 new settings to Settings interface for filter persistence
  • Updated DEFAULT_SETTINGS with filter defaults
  • Modified quote-store to load persisted filters on initialize
  • Made filter toggle methods persist changes to settings
  • Added logic to filter out deleted collection IDs on load
  • Updated test fixtures and mocks

Test plan

  • Build passes
  • Lint passes
  • All 184 tests pass
  • Manual testing: Toggle category filters, refresh page, verify filters persist
  • Manual testing: Enable favorites-only mode, refresh, verify it persists
  • Manual testing: Select collection filters, refresh, verify they persist
  • Manual testing: Delete a collection that was active, refresh, verify it's removed from filters

All manual tests verified via Playwright browser automation.

kYem added 7 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.
@kYem kYem merged commit c8b9d8c into main Jan 16, 2026
1 check passed
@kYem kYem deleted the feat/persist-quote-filter-settings branch January 16, 2026 11:14
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