Repository navigation
Backlog
Backlog
Pending-request notifications on Windows and Linux: remove when handled, click opens the request#1710
Feature
Copy link
Labels
Milestone
Description
Goal
On Windows and Linux, a pending-request notification disappears once its request is answered or the user returns to the app. Clicking the notification brings the app to the front and opens the tab of the request.
Context
- Pending requests: native notification and Dock/taskbar attention while the app is in the background #1709 added:
- the
PendingRequestNotifiertrait; - the desktop implementation and the OS notification backend boundary in
crates/app-shell(show by id, remove by id, remove all); activate_pending_request(id).
- the
- Its plugin-based backend (
tauri-plugin-notification2.4) can neither remove a delivered notification nor report a click on desktop. tauri-plugin-notificationusesnotify-ruston Linux andtauri-winrt-notificationon Windows; both are already inCargo.lock.
Requirements
- Linux backend (freedesktop notifications over D-Bus, e.g.
notify-rustdirectly):- Keeps the
NotificationHandleper request id. - Closes the notification on remove (
CloseNotification). - Handles the default action (click) by calling
activate_pending_request(id).
- Keeps the
- Windows backend (WinRT toast,
tauri-winrt-notificationor thewindowscrate):- Each toast carries a tag derived from the request id and a fixed group.
- Remove uses
ToastNotificationManager::History().Remove(tag, group, app_id). - Remove all uses
RemoveGroup. - Activation (click) calls
activate_pending_request(id). - Use the app's existing AppUserModelID; in dev builds without one, fall back to the plugin behaviour and log it.
- Both backends:
- plug into the boundary from Pending requests: native notification and Dock/taskbar attention while the app is in the background #1709, with no change to the trait or callers;
- remove a request's notification when it ends, and all pending-request notifications when the main window gets focus;
- log failures without content; they never affect the request.
- Notifications never offer approve/deny actions. A click only focuses and switches the tab.
Acceptance Criteria
- On Linux, a pending-request notification is closed when its request ends (approved, denied, timeout, tab closed) and when the main window gets focus.
- On Linux, clicking the notification focuses the app and switches to the tab of the request.
- On Windows, a toast is removed from the Action Center when its request ends and when the main window gets focus.
- On Windows, clicking the toast focuses the app and switches to the tab of the request.
- Without a usable notification service (no D-Bus session, no AppUserModelID), the app falls back to the plugin backend, logs once without content, and the request flow is unchanged.
- Unit tests for the id-to-handle/tag mapping and for the remove-on-end / remove-all-on-focus logic, using a fake backend.
- Relevant automated tests pass on the Linux and Windows CI jobs.
Technical Notes
- Real desktop behaviour (Action Center, GNOME/KDE notification daemons) can only be checked by hand. The reviewer lists manual test steps per OS.
- Keep each OS in its own module behind
cfg(target_os). - No content in logs (Spec 0094).
Files: crates/app-shell/src/ (pending_request_notifications backend modules for linux and windows), crates/app-shell/Cargo.toml, Cargo.lock, docs/specs/ (pending-request notification spec)
Spec impact: update the pending-request notification spec created by #1709 (platform behaviour for Windows and Linux)
Open questions
- Windows API choice:
tauri-winrt-notificationif it exposes tag/group and the activation callback (recommended, fewer dependencies), otherwise thewindowscrate withUI_Notifications.
Related Work
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
P2 - Normal
Activity