Repository navigation
Desktop notifications can be answered with Reply, play a sound, and group by chat - #250
Merged
Merged
Conversation
…roup by chat Windows and Linux now send their own notifications instead of GPUI's, which are silent and can't take typed text. Windows toasts get a reply box, Mark as Read, the system sound, and a header per chat. Linux freedesktop notifications over D-Bus play message-new-instant, offer inline-reply where the server supports it, and can now be taken back. A reply is sent like plain composer text, then the chat is marked read. If it fails, "Reply not sent" appears, as on the Mac. macOS keeps GPUI's notifications until the app ships as a bundle.
- A "Reply not sent" notification with no chat listed now opens its chat once the chat is listed: chat_named checks this run's chat before the tag fallback. - On Linux, the body is escaped when the server reads it as markup, and characters XML refuses are dropped there and in Windows toasts. - A Windows reply whose text couldn't be read now says "Reply not sent". Failed reads and toasts Windows rejects are logged. - Windows hashes tags with FNV-1a, which gives the same hash in every build (DefaultHasher doesn't promise that), and hides a toast still on screen when taking it back. - On Linux, failing to read the server's capabilities no longer turns notifications off, and a click that won't decode is logged. - Shown.reaction is now Shown.unread, which says what it decides. - Comments now match what each platform does.
Owner
Author
Review (
|
Nothing hears a click on a toast after Hush quits: no COM activator relaunches it. A reply typed into one would be lost. The orderly stop that the menu's and the tray's Quit and the Dock or logout path run now removes Hush's toasts, from the screen and the notification center. Only the Hush that had the data does this, so a launch that was refused it leaves the running one's toasts alone.
Owner
Author
Windows toasts are cleared at quit (owner's call, 2026-11-29)This is in 65f9e35, on top of a merge of
|
As with Windows' toasts: nothing hears a click or a reply typed into one after Hush quits. The D-Bus thread now closes every notification it shows this run when the orderly stop asks, and again only in the Hush that had the data. The server-id bookkeeping moves into a small Live map that can be tested.
Owner
Author
Linux notifications are closed at quit too (owner's call, 2026-11-29)This is in 79cd3e3. The branch is up to date with
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Message notifications in the desktop app now have Reply, play a sound and group by chat, as far as each system allows. The Mac app does all three (
Notifications.swift,AppStore.replyFromNotification).silent)Groupis set to the chat too.inline-replycapability (KDE Plasma). On GNOME, which doesn't support it, a click still opens the chat ready to type.sound-namehintmessage-new-instant, plus the categoryim.received. It plays where the server plays sounds.send_textcall the composer uses for plain text: no draft, no quote, no preview, as on the Mac. If the chat is unread, it is then marked read. A blank reply does nothing.<chat>|reply-failed), saying "Open the chat to send it again." or "Its chat is no longer in Hush.". Opening the chat takes it back. These are the Mac's words and rules.notifications/toast.rs,notifications/freedesktop.rs), and never calls GPUI's. GPUI'sSystemNotificationstays in use only on macOS and in tests, where the test platform records it.CloseNotification). A newer notification with the same tag replaces the older one (replaces_id). This covers only notifications shown in this run, because the server's ids from earlier runs aren't known.History.ClearWithId).CloseNotification). It isn't waited for; it runs while the core stops.shortcut:notes the limits: a crash leaves them (on Windows, until the next quit); Linux keeps earlier runs' notifications, whose ids aren't known, and those of a logout, which ends Hush without asking it.body-markup). Characters XML refuses are dropped, on Linux and in Windows toasts.notifications.rs: what a click asks for, the reply-failed tag and the chat's name. The per-OS layer is thin. Pure builders for what each system is sent are also tested: the toast XML and the freedesktop actions and signals.windows0.62 is added for Windows only, with featuresData_Xml_Dom,Foundation_CollectionsandUI_Notifications. It is already in the tree through GPUI, soCargo.lockgains one dependency line and no new crate. Linux uses thezbus5 that is already a dependency.macOS: left as is
GPUI's macOS notifications use
UNUserNotificationCenter. GPUI turns them off entirely unless the app runs from a bundle, and the desktop app runs unbundled. When bundled, GPUI's own delegate receives every response and drops the typed text, and GPUI sets no sound and no thread. Reply and sound would need an app bundle (packaging is a separate issue that hasn't started), plus our own delegate in place of GPUI's. Ashortcut:comment on the macOSshowsays so. The Mac has the Swift app, which already does all three.How it was tested
Gate, run from
core/:cargo fmt --check: passcargo clippy --all-targets -q -- -D warnings: passcargo clippy --all-targets --features hush-desktop/snapshot -q -- -D warnings: passcargo test --features hush-desktop/snapshot -q: passThe Swift leg (xcodebuild) was skipped because nothing in
app/changed.New tests. Each one failed when the code was mutated back to the old behavior: a reply treated as a click, a
silenttoast, noinline-reply.audio); the freedesktop actions by capability and content; the server's signals read as a click, Mark as Read or a reply.Windows and Linux code was type-checked but never run. Only the pure parts run here.
toast.rsandfreedesktop.rswere type-checked and linted withcargo clippy --target x86_64-pc-windows-msvcand--target x86_64-unknown-linux-gnuin a scratch crate that includes the two files, with the lockfile's versions. Both pass with-D warnings. Also type-checked:cfg(not(any(test, target_os = "macos")))glue innotifications.rs. This one was compiled withcargo checkby temporarily switching itscfgon macOS and stubbingsystem(not committed).Never run:
UserInputLivemap whose tests check that quitting closes exactly the ids on show (it failed whentake_alldidn't drain). The D-Bus call itself was type-checked.inline-replyor theNotificationRepliedsignalNo snapshot: nothing in the window looks different. The error banner is the existing one.
Closes #233