Skip to content

Add state persistence for user preferences #17

Description

@MartinPTielemans

Description

User preferences (selected package manager, monitoring state) are currently stored only in memory and reset on application restart. This provides a poor user experience.

Current behavior:

  • Package manager selection resets to default on app restart
  • Monitoring state is not persisted
  • Users need to reconfigure preferences every time

Code location:

// In command.rs - only in-memory storage
static PREFERRED_PM: Mutex<String> = Mutex::new(String::new());
static CLIPBOARD_MONITORING: Mutex<bool> = Mutex::new(false);

Proposed solution:

  1. Add persistent storage using Tauri's storage API or file-based config
  2. Save preferences automatically when changed
  3. Load preferences on startup to restore user settings
  4. Add preferences validation to handle corrupted config files

Implementation suggestions:

  • Use tauri-plugin-store for cross-platform storage
  • Create a UserPreferences struct with serialization
  • Add migration logic for future config format changes
  • Add default fallbacks for missing or invalid config

Benefits:

  • Better user experience with persistent settings
  • Reduced friction for daily usage
  • Professional application behavior
  • Foundation for additional user preferences in the future

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions