mirror of
https://github.com/NanmiCoder/cc-haha
synced 2026-07-16 13:03:31 +08:00
Notification clicks and repeated launches can enter the native app through OS-level activation paths, so the desktop runtime now registers Tauri's single-instance guard before sidecars or other plugins start. A second launch restores and focuses the existing main window instead of creating another app process. Constraint: macOS and Windows launch paths must reuse the running desktop instance. Rejected: Handle only notification click callbacks | does not cover Dock, shortcut, installer, or Windows relaunch paths. Confidence: high Scope-risk: narrow Directive: Keep the single-instance plugin before sidecar startup so duplicate launches cannot create extra runtime processes. Tested: SKIP_INSTALL=1 ./desktop/scripts/build-macos-arm64.sh Tested: open -n built app twice; desktop_count stayed 1 with pid 69821 Tested: bun run check:native Tested: cargo test --manifest-path desktop/src-tauri/Cargo.toml Tested: cd desktop && bun run test -- desktopNotifications.test.ts Tested: cd desktop && bun run lint