2.4 KiB
2.4 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec | |
|---|---|---|---|---|---|---|---|
| 05-native-notifications | Native notifications and duplicate suppression | done | 4 |
|
plan.md | ../../specs/desktop/requirements/desktop-tauri-app.md |
Task 05: Native Notifications and Duplicate Suppression
Acceptance
- Desktop-owned launches emit native notifications for waiting-for-input and session-failure events when allowed by existing notification preferences.
- Each event identity produces at most one native notification; the browser Web Notification and backend shell-command System provider are suppressed only for the desktop-owned launch.
- Browser, CLI, and service notification behavior remains unchanged.
- Dock reopen and second-instance activation show/unminimize/focus the existing window without inferring a notification route.
- Permission denial keeps in-app indication/toasts and does not repeatedly prompt.
Files Likely Touched
apps/desktop/src-tauri/src/main.rs,lib.rs, and a native notification moduleapps/desktop/src-tauri/Cargo.tomland capabilitiesapps/desktop/src-tauri/src/backend.rsfor the desktop-owned launch markerapps/backend/internal/notifications/service/and provider testsapps/web/lib/ws/handlers/notifications.tsapps/web/lib/ws/handlers/agent-session.tsapps/web/hooks/use-session-failure-toast.ts- New desktop notification bridge modules and focused tests
Verification
rtk make -C apps/backend fmt
rtk make -C apps/backend test
cd apps/desktop/src-tauri && rtk cargo fmt --check && rtk cargo test --features desktop-runtime
cd apps/web && rtk pnpm test notification
cd apps/web && rtk pnpm run typecheck
Tests must cover event identity deduplication, desktop-only provider suppression, both event types, preference-disabled behavior, focus without inferred routing, and permission denial.
Platform Limitation
The Tauri notification plugin exposes desktop action callbacks, but Kandev does not register actions because the generic notification body click has no portable task-route payload. Dock reopen and second-instance activation therefore show, unminimize, and focus the existing main window without consuming a task route. Generic focus and activation events never navigate.
Output Contract
Update this task to done and check its plan item only after duplicate suppression is proved at
the desktop/backend/browser boundary.