diff --git a/AUDIT_LOG.md b/AUDIT_LOG.md index c14bb05..c1f2bd6 100644 --- a/AUDIT_LOG.md +++ b/AUDIT_LOG.md @@ -2,6 +2,16 @@ This log tracks all significant changes, updates, and versions in the PaperCache project. +## 2026-06-25 +**Change:** fix: switch autostart from LaunchAgent to LoginItem (AppleScript) + +**Details/Why:** +The app was registered via `MacosLauncher::LaunchAgent`, creating a hidden `.plist` in `~/Library/LaunchAgents/` invisible to the user. Changed to `MacosLauncher::AppleScript`, which uses AppleScript to register via System Events — the app now appears in System Settings > General > Login Items as a user-manageable entry. The `--silently` flag and `hide_dock_icon()` still work as before. + +**Files changed:** `src-tauri/src/lib.rs`, `CHANGELOG.md`. + +--- + ## 2026-06-25 - (Uncommitted) **Change:** fix: window state persistence and login-item toggle desync (v0.5.4) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f1bc80..83a4810 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - **Window position/size now persists across restarts**: The window-state plugin's `on_window_ready` fires before the macOS display server is ready, causing `available_monitors()` to return empty and the saved position to be silently discarded. Fixed by deferring window-state restoration via a background thread + `run_on_main_thread` 300ms after `setup()` completes, bypassing the plugin's monitor-intersection check with a direct file read. Both the tray "Quit" and Settings "Quit" buttons now explicitly save window state before exit. +- **Launch at Startup now registers as a proper Login Item**: Changed `MacosLauncher` from `LaunchAgent` to `AppleScript`, which registers PaperCache in System Settings > General > Login Items instead of creating a hidden `launchd` plist. Users can now see and manage the autostart entry directly from System Settings. - **Login-item toggle stays in sync with macOS System Settings**: The launch-at-startup toggle only read from `localStorage`, so removing PaperCache from System Settings left the toggle permanently stuck in the checked state. Fixed by adding a `get_launch_at_startup` Tauri command that queries the actual OS login-item state via `app.autolaunch().is_enabled()`, and syncing the toggle with the real OS state on every Settings mount. ## [v0.5.3] - 2026-06-24 diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index e1265ff..10c3da7 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -45,7 +45,7 @@ pub fn run() { ) .plugin(tauri_plugin_global_shortcut::Builder::default().build()) .plugin(tauri_plugin_autostart::init( - tauri_plugin_autostart::MacosLauncher::LaunchAgent, + tauri_plugin_autostart::MacosLauncher::AppleScript, Some(vec!["--silently"]), )) .plugin(tauri_plugin_updater::Builder::new().build())