Skip to content

Conversation

@michelroegl-brunner
Copy link
Member

🎯 Feature: Filter Persistence System

This PR introduces a comprehensive filter persistence system that allows users to save and restore their script filter preferences across sessions.

✨ Key Features

🔧 Settings Integration

  • New toggle in General Settings to enable/disable filter persistence
  • Visual indicator when filters are being saved automatically
  • Settings modal shows current saved filter status and details

💾 Persistent Storage

  • Saves complete filter state to FILTERS variable in .env file
  • Includes search query, type filters, sort order, and updatable status
  • JSON-based storage for easy parsing and validation

⚡ Smart Auto-Save

  • Automatically saves filters when changed (with 500ms debounce)
  • Only saves when persistence is enabled
  • Graceful error handling and user feedback

🔄 Seamless Restoration

  • Loads saved filters on page load when persistence is enabled
  • Falls back to defaults when persistence is disabled
  • Loading states during filter restoration

📱 Enhanced UX

  • Loading spinner while restoring filters
  • Status indicator showing auto-save is active
  • Clear saved filters option in settings
  • Works across all script tabs (Available, Downloaded, Installed)

🛠️ Technical Implementation

API Endpoints

  • POST /api/settings/filters - Save current filters
  • GET /api/settings/filters - Retrieve saved filters
  • DELETE /api/settings/filters - Clear saved filters

Components Updated

  • FilterBar - Added persistence props and loading states
  • ScriptsGrid - Integrated filter loading/saving logic
  • DownloadedScriptsTab - Added persistence support
  • GeneralSettingsModal - Added filter management UI

Data Flow

  1. User toggles persistence in settings
  2. Filters auto-save to .env when changed
  3. Page loads restore saved filters if enabled
  4. Settings show current filter status

🎨 User Experience

  • When enabled: Filters persist across page reloads and sessions
  • When disabled: Uses default filters, no persistence
  • Visual feedback: Clear indicators for loading and auto-save status
  • Settings management: Easy toggle and filter clearing

This enhancement significantly improves user experience by maintaining their preferred filter settings, reducing the need to reconfigure filters on each visit.

- Add GeneralSettingsModal with General and GitHub tabs
- Create GitHub PAT input field that saves to .env as GITHUB_TOKEN
- Add animated toggle component for SAVE_FILTER setting
- Create API endpoints for settings management
- Add Input and Toggle UI components
- Implement smooth animations for toggle interactions
- Add proper error handling and user feedback
- Add filter persistence system that saves user filter preferences to .env
- Create FILTERS variable in .env to store complete filter state as JSON
- Add SAVE_FILTER toggle in settings to enable/disable persistence
- Implement auto-save functionality with 500ms debounce
- Add loading states and visual feedback for filter restoration
- Create API endpoints for managing saved filters
- Add filter management UI in settings modal
- Support for search query, type filters, sort order, and updatable status
- Seamless integration across all script tabs (Available, Downloaded, Installed)
- Auto-clear saved filters when persistence is disabled
@michelroegl-brunner michelroegl-brunner requested a review from a team as a code owner October 8, 2025 13:35
@michelroegl-brunner michelroegl-brunner linked an issue Oct 8, 2025 that may be closed by this pull request
@michelroegl-brunner michelroegl-brunner merged commit 5eaafbd into main Oct 8, 2025
4 checks passed
@michelroegl-brunner michelroegl-brunner deleted the feat/settings_menue branch October 14, 2025 06:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sort of cookie saving?

2 participants