Skip to content

fix: code review improvements — event hooks, CSP, focus, lockfile drift#11

Merged
Razee4315 merged 6 commits into
mainfrom
fix/review-improvements
Jun 9, 2026
Merged

fix: code review improvements — event hooks, CSP, focus, lockfile drift#11
Razee4315 merged 6 commits into
mainfrom
fix/review-improvements

Conversation

@Razee4315

Copy link
Copy Markdown
Owner

Follow-up fixes from the code review (see also #10).

Changes (one commit each, individually revertible)

  1. Event hooks (event_hook.rs) — The EVENT_OBJECT_LOCATIONCHANGE hook was registered but its handler was a no-op, even though CLAUDE.md documents re-enforcement on it as critical for Win11 stability. It now re-applies TOPMOST when DWM/Snap Layouts strip it mid-move (cheap: only acts when the style is actually missing). The EVENT_SYSTEM_MINIMIZESTART hook had nothing to do (MINIMIZEEND covers restore) and is no longer registered.

  2. Mobile icons — Deleted untracked src-tauri/icons/android|ios (PinIt is Windows-only) and gitignored them so tauri icon regeneration stays out of the tree.

  3. Cargo.lock drift — The lockfile still said 1.0.1 while the app is at 1.0.9: the release workflow bumps Cargo.toml but not Cargo.lock. Synced the lockfile and fixed the bump step so it stays in sync going forward.

  4. CSP enabled (tauri.conf.json) — Replaced csp: null with a restrictive policy. Tauri injects script nonces automatically; inline styles stay allowed for React style props (avatar colors) and Vite-injected CSS.

  5. Foreground lock workaround (commands.rs) — SetForegroundWindow returns FALSE and silently does nothing when another process owns the foreground, so clicking a window in the pinned list could fail. On failure we attach our input queue to the foreground thread, retry, and detach.

Verification

  • cargo check passes
  • No frontend changes

The LOCATIONCHANGE hook was registered but its handler did nothing, despite CLAUDE.md documenting it as critical for Win11 stability. Now it re-applies TOPMOST when DWM/Snap Layouts strip it mid-move. The MINIMIZESTART hook had no handler and nothing to do (MINIMIZEEND covers restore), so it is no longer registered.
The bump step updated package.json, tauri.conf.json, and Cargo.toml but not Cargo.lock, so the lockfile said 1.0.1 while the app was at 1.0.9 and every local cargo build dirtied the working tree.
Replaces csp: null with a restrictive policy. Tauri injects script nonces automatically; 'unsafe-inline' styles are required for React inline style props (avatar colors) and Vite-injected CSS. connect-src allows the Tauri v2 IPC bridge.
SetForegroundWindow returns FALSE and does nothing when another process owns the foreground, so clicking a pinned window in the list could silently fail. On failure, attach our input queue to the foreground thread (which grants foreground-change permission), retry, and detach.
@Razee4315 Razee4315 merged commit 1eded7b into main Jun 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant