Skip to content

Commit 52b995a

Browse files
committed
fix: center shortcut key pill '+' separator between key caps
The renderShortcutDisplay function grouped each key cap and the '+' to its right in a wrapper <span> with justify-content: space-evenly, making the '+' appear closer to the left key cap. Flattened to React.Fragment siblings in a flex row with justify-content: center and gap: 4px so the '+' sits independently centered. Also adds CHANGELOG and AUDIT_LOG entries for this fix and the previously merged macOS window shift compensation removal.
1 parent c5a8f91 commit 52b995a

3 files changed

Lines changed: 27 additions & 7 deletions

File tree

AUDIT_LOG.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,25 @@ The app was registered via `MacosLauncher::LaunchAgent`, creating a hidden `.pli
1212

1313
---
1414

15-
## 2026-06-25 - (Uncommitted)
16-
**Change:** fix: window state persistence and login-item toggle desync (v0.5.4)
15+
### 2026-06-25 - fix: remove macOS frameless window 28px shift compensation (PR #62)
16+
17+
**Details/Why:**
18+
The v0.5.4 window-state fix incorrectly added +/-28px compensation for a supposed macOS frameless window titlebar offset in `tauri-plugin-window-state`. Tracing through the full stack (`tauri-plugin-window-state` v2.4.1 → `tauri-runtime-wry``tao` 0.35.3) confirmed no such offset exists for `decorations: false` windows — `outer_position()` returns the window frame origin and `set_position()` sets it correctly. Removed all compensation from save and restore paths.
19+
20+
**Files changed:** `src-tauri/src/commands/system.rs`, `src-tauri/src/lib.rs`, `CHANGELOG.md`.
21+
22+
---
23+
24+
### 2026-06-25 - fix: shortcut key pill "+" centered between key caps
25+
26+
**Details/Why:**
27+
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 `<Fragment>` siblings in a flex row with `justify-content: center` and `gap: 4px`.
28+
29+
**Files changed:** `src/Settings.tsx`, `CHANGELOG.md`.
30+
31+
---
32+
33+
### 2026-06-25 - fix: window state persistence and login-item toggle desync (v0.5.4)
1734

1835
**Details/Why:**
1936
Two bug fixes for window state and settings reliability:

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Fixed
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
- **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.
13+
- **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.
14+
- **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.
1315
- **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.
1416

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

src/Settings.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useState, useEffect } from 'react'
1+
import { useState, useEffect, Fragment } from 'react'
22
import { SETTINGS_KEYS } from './lib/settingsKeys'
33
import { useAppStore } from './store/useAppStore'
44
import { useSettingsStore } from './store/useSettingsStore'
@@ -390,8 +390,9 @@ function ShortcutInput({ value, onChange }: { value: string; onChange: (val: str
390390
style={{
391391
display: 'flex',
392392
alignItems: 'center',
393+
gap: '4px',
393394
width: '100%',
394-
justifyContent: 'space-evenly',
395+
justifyContent: 'center',
395396
}}
396397
>
397398
{parts.map((part, index) => {
@@ -428,7 +429,7 @@ function ShortcutInput({ value, onChange }: { value: string; onChange: (val: str
428429
break
429430
}
430431
return (
431-
<span key={index} style={{ display: 'flex', alignItems: 'center' }}>
432+
<Fragment key={index}>
432433
<span
433434
style={{
434435
display: 'inline-flex',
@@ -448,9 +449,9 @@ function ShortcutInput({ value, onChange }: { value: string; onChange: (val: str
448449
{display}
449450
</span>
450451
{index < parts.length - 1 && (
451-
<span style={{ margin: '0 4px', opacity: 0.5, fontSize: '14px' }}>+</span>
452+
<span style={{ opacity: 0.5, fontSize: '14px' }}>+</span>
452453
)}
453-
</span>
454+
</Fragment>
454455
)
455456
})}
456457
</div>

0 commit comments

Comments
 (0)