Skip to content

Commit d237d20

Browse files
authored
Merge branch 'main' into fix/shortcut-pill-centering
2 parents b0bcb6f + c5a8f91 commit d237d20

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

AUDIT_LOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ The v0.5.4 window-state fix incorrectly added +/-28px compensation for a suppose
1919
In the Settings global shortcuts section, the `renderShortcutDisplay` function grouped each key cap and the `+` to its right in a wrapper `<span>`, with the outer container using `justify-content: space-evenly`. This made the `+` appear closer to the left key cap. Fixed by flattening to `<React.Fragment>` siblings in a flex row with `justify-content: center` and `gap: 4px`.
2020

2121
**Files changed:** `src/Settings.tsx`, `CHANGELOG.md`.
22+
**Change:** fix: switch autostart from LaunchAgent to LoginItem (AppleScript)
23+
24+
**Details/Why:**
25+
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.
26+
27+
**Files changed:** `src-tauri/src/lib.rs`, `CHANGELOG.md`.
2228

2329
---
2430

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111
- **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.
1212
- **Window no longer shifts down on restart on macOS**: Removed the +/-28px compensation that was incorrectly added for a macOS frameless window offset which does not exist in `tauri-plugin-window-state` v2.4.1 — the plugin correctly saves `outer_position()` and restores via `set_position()` with no titlebar offset for frameless windows.
1313
- **Shortcut key pill "+" centered between key caps**: The `+` separator in the shortcut display was grouped inside the same `<span>` as the key cap to its left with `justify-content: space-evenly`, making it appear visually attached to the left pill. Restructured to a flat flex layout with `gap` so the `+` is independently centered with equal spacing on both sides.
14+
- **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.
1415
- **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.
1516

1617
## [v0.5.3] - 2026-06-24

src-tauri/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ mod tray;
1010

1111
use commands::shortcuts::GlobalShortcutState;
1212
use commands::notifications::NotificationState;
13-
use std::sync::atomic::{AtomicBool, AtomicU64, Ordering};
13+
#[cfg(not(target_os = "macos"))]
14+
use std::sync::atomic::AtomicU64;
15+
use std::sync::atomic::{AtomicBool, Ordering};
1416
use std::sync::Arc;
1517
use tauri_plugin_window_state::{StateFlags, WindowExt};
1618

@@ -45,7 +47,7 @@ pub fn run() {
4547
)
4648
.plugin(tauri_plugin_global_shortcut::Builder::default().build())
4749
.plugin(tauri_plugin_autostart::init(
48-
tauri_plugin_autostart::MacosLauncher::LaunchAgent,
50+
tauri_plugin_autostart::MacosLauncher::AppleScript,
4951
Some(vec!["--silently"]),
5052
))
5153
.plugin(tauri_plugin_updater::Builder::new().build())

0 commit comments

Comments
 (0)