Repository navigation
Improve Windows downloads, account switching, and notification activation - #26
matheuscardosoj wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
There is at least one likely compile-breaking issue (missing tauri::Manager import for app.config() in aumid.rs) that should be fixed before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR addresses Windows toast notification failures and several multi-account startup/locking edge cases by tightening Tauri ACL permissions, surfacing bridge IPC failures, and adjusting window-creation sequencing to avoid WebView2 deadlocks.
Changes:
- Add explicit custom command permissions/capabilities for the WhatsApp bridge, Settings, and lock windows; log bridge IPC failures without leaking message contents.
- Serialize account mutations and adjust window creation/focus flows (Settings + lock) to reduce WebView2 deadlock risk and enforce lock gating.
- Persist and expose a “default startup account” selection in Settings UI, plus small UX fixes (select option theming, idempotent autostart disable).
File summaries
| File | Description |
|---|---|
| src-tauri/src/window.rs | Gate account showing behind lock; serialize Settings window creation and improve error logging/visibility behavior. |
| src-tauri/src/settings.rs | Make autostart disable idempotent to avoid Windows “NotFound” failures when already off. |
| src-tauri/src/lock.rs | Serialize lock window creation off synchronous callbacks; avoid stale lock window if unlock races creation. |
| src-tauri/src/lib.rs | Add --settings single-instance behavior; prioritize startup account window visibility; defer some tray/settings work off setup. |
| src-tauri/src/commands.rs | Add persisted startup default selection plumbing; serialize account mutations; move account commands to async. |
| src-tauri/src/aumid.rs | Minor cleanup around Windows AUMID registration setup. |
| src-tauri/src/accounts.rs | Persist startup_account preference with validation + tests; add global mutation mutex. |
| src-tauri/resources/notifications.test.mjs | New Node tests covering notification/unread routing and IPC failure logging behavior. |
| src-tauri/resources/bridge.js | Log IPC failures (without payload), forward SW notifications, and ensure unread updates are invoked. |
| src-tauri/permissions/app.toml | Define custom command permissions for bridge/settings/lock to participate in ACL checks. |
| src-tauri/capabilities/settings.json | Grant Settings window capability the new settings-command permission. |
| src-tauri/capabilities/main-remote.json | Assign the WhatsApp remote capability to the new bridge permission set. |
| src-tauri/capabilities/lock.json | Grant lock window capability the new lock-command permission. |
| settings-ui/style.css | Force readable native <option> colors across themes; improve account row wrapping. |
| settings-ui/main.js | Add “default startup account” selector and serialize UI actions with a busy state + status messages. |
| settings-ui/index.html | Add default startup account field + live status note region for account actions. |
Review details
- Files reviewed: 16/16 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| #[cfg(windows)] | ||
| { | ||
| use tauri::Manager; | ||
| let config = app.config(); |
| open: app | ||
| .get_webview_window(&accounts::window_label(&a.id)) | ||
| .is_some(), | ||
| is_default: accounts::startup_account(&f).is_some_and(|selected| selected.id == a.id), |
|
Thanks, @matheuscardosoj. Your diagnosis here was right: the remote page's custom commands were being refused by the ACL, and the bridge swallowed the rejection. Part of this PR has since landed on master in a different form, but part of it hasn't, so I'm leaving it open rather than closing it as superseded. Already on master (v0.6.4 to v0.6.6):
Not on master, and still worth having:
The branch now conflicts heavily with master: capabilities, Generated by Claude Code |
Ported from #26 by @matheuscardosoj. - Commands that create a window (add/open account, open settings, lock now) are now async. A synchronous command runs inside WebView2's IPC callback, and building another WebView2 there can deadlock on Windows (wry#583). - Account commands hold one lock across load-modify-save, now that they can run concurrently, and adding an account rolls back if its window fails to build instead of leaving an account with no window. - Saving Settings with "Launch at system startup" off no longer warns on Windows when the Run entry is already absent. Co-Authored-By: matheuscardosoj <97991988+matheuscardosoj@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L8dUghRiNrKrHHR5BNMSSD
v0.6.7: profile pictures on notifications; Windows freeze fixes (from #26)
…ation-acl # Conflicts: # settings-ui/index.html # settings-ui/style.css # src-tauri/capabilities/lock.json # src-tauri/capabilities/main-remote.json # src-tauri/capabilities/settings.json # src-tauri/resources/bridge.js # src-tauri/src/commands.rs # src-tauri/src/settings.rs
Changes
Windows downloads now ask where to save each file and cancel when the save dialog is dismissed. Clicking a notification reveals the account that generated it while respecting the app lock.
Validation
tauri build --bundles nsis -- --locked).Remaining validation
Draft pending end-to-end checks in the installed Windows application: actual WhatsApp header placement, file drag-and-drop, Save As/cancellation/duplicate filenames, notification activation across accounts, and locked-app behavior. macOS and Linux have not been validated locally. The generated installer is a local artifact and is not attached to this PR.