Repository navigation
Resolve and persist notification icon hints and desktop identity - #12741
davidboulay wants to merge 3 commits into
Conversation
app_icon is optional in the notification spec and plenty of senders leave it empty, so their toasts draw a blank icon slot. libnotify 0.8 made this common: it no longer passes `notify-send -i` through as app_icon, moving it to a desktop-entry hint the service does not read. Those notifications still carry app_name, and that name is nearly always the Name= of an installed desktop entry, which knows the app's icon. Look it up by display name, desktop id or startup class before giving up. No themed lookup on the name itself when that misses: an unconstrained theme lookup resolves an app called "Mail" or "Zoom" to a stock action icon, and a confidently wrong face is worse than none. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
No production defect confirmed in the scoped review of Verified: the helper matches desktop entries by name, id or startup class, including case folding and the spaced-name retry. The notification suite passes all 143 assertions. Source inspection preserves this priority: Optional test improvement: removing either startup-class matching or the hyphenated retry still leaves all 143 assertions passing. The Chrome fixture already matches its display name, and no assertion needs Documentation correction: consider removing or correcting the new libnotify sentence in Review informationTest scope: isolated JavaScript tests with synthetic desktop entries and diagnostic mutations; QML precedence and API checked by source/type metadata. No live notification, visual rendering or theme-resolution verification. Empty or unmatched app names remain outside the new fallback. Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review. Automated AI review: GPT 6 Astra Medium initial inspection and synthesis, independent Opus 5.5 High and GPT 6 Sol Xhigh technical assessments, followed by verification against targeted test and source evidence. |
The comment said libnotify 0.8 moved `notify-send -i` to a desktop-entry hint. It did not: from 0.8.8 the icon goes out as the image-path hint, and app_icon is filled from it only for servers speaking a spec older than 1.1, which quickshell (1.2) is not. Captured off the session bus on libnotify 0.8.8: app_icon "", hints image-path/urgency/sender-pid, no desktop-entry. The fixtures let two match paths go untested: "Google Chrome" matched its display name before the hyphenated retry was ever tried, and no assertion needed startupClass. Chrome's display name now differs from the sender's app_name so only the hyphenated id reaches it, and a Signal entry is reachable through its class alone. Removing either path in the helper now fails its own assertion. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Thanks, both taken in 3e7f900. libnotify sentence: you're right that it was wrong, and the real story is a step further on than the 0.8.5 revert. From 0.8.8, No Fixtures: Chrome's display name is now |
Automated AI review
Follow-up to the earlier review and the author's reply, checked at Verified: both earlier notes are resolved. The new commit changes only a code comment and the tests, and no regression was found in the tested scope. Verified, test coverage (resolved): each of the two match paths the earlier note named now fails its own assertion when removed. The notification suite passes 144/144 at
Verified, libnotify comment (resolved): the rewritten comment and PR description match the libnotify 0.8.8 source. Verified, unchanged behavior: the Squash offer: the first commit message still carries the old Review informationTest scope: the notification test suite ran at both heads in an isolated sandbox, with synthetic desktop entries and labelled diagnostic mutations. libnotify 0.8.8 and quickshell notification-server source were read directly. The author's session-bus capture was not reproduced. The full AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments of this follow-up, and an Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
|
Updated in eb27474: the fallback now resolves icon metadata when the notification is received, so the resolved icon survives persistence instead of only appearing on the live card. This covers empty app names using Validation: all 158 notification assertions pass. I also verified fresh notifications and disk-backed history replay in the running shell; before/after captures are now in the description. The full suite completed with nine unrelated failing test files, with baseline reproduction details documented there. I checked related PRs before extending this one: #9985 addresses raw image-path rendering, while this update addresses metadata resolution and persistence; #12567 handles browser web-app identity. The title and description now describe the complete change. |
Automated AI review
Follow-up to the earlier follow-up and the author's update, checked at Verified: the new commit resolves
Senders that set Earlier notes at this head:
Clicking a replayed toast now focuses a window by desktop-entry idThe description says there are no window-focus changes, but the new
Impact: with more than one agent open, clicking a replayed agent toast can focus a different agent than the one that notified. Other desktop-entry-only senders now get click-to-focus by id where the click previously focused nothing. Suggested change: either state this as intended in the description, or keep the desktop-entry id in its own snapshot field so Optional test improvement: each of these edits still passes all 158 assertions:
The test file already pins Failed image copy on restore: a file-backed Design note: Quickshell v0.3.1 already fills Related PRs: #9985 and #12567 serve different purposes, but each conflicts with this PR on the same Review informationTest scope: the notification suite ran at the merge base, AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
|
Tested this against the exact Using
|
|
Reviewed at Reproduction. I sent notifications over D-Bus with an empty Tests. Two side effects, neither blocking:
Who checked it. This review is Claude Opus 5.5's alone. The second opinion, Codex Medium, answers but did not run, because today's review budget was spent. Until it reviews this head, this pull request is labelled Waiting on a second opinion, then the maintainer. Nothing is needed from you. |
|
Thanks @davidboulay! The new engine falls back from |
Notifications with an empty
app_iconcan lose their icon when they move into history. GTK/Ghostty notifications can also leaveapp_nameempty: a captured notification carrieddesktop-entry=org.omarchy.agentandimage-path=com.mitchellh.ghostty, but the persisted entry had an empty app, appIcon, and image.Resolve the missing icon while taking the notification snapshot, so the existing image persistence pipeline can retain it:
image-path(or legacyimage_path), then the installed desktop entry's icon, then an app-name lookup.desktop-entryas the app identity whenapp_nameis empty.Per-notification image data keeps its existing rendering priority. File-backed fallback icons use the existing validated copy pipeline; themed icon names remain durable names. There are no Ghostty-specific conditions or window-focus changes in this PR.
Before / after
The same synthetic notification, replayed from disk after its original live image was gone:
Persisted metadata changed from
{"app":"","appIcon":"","image":""}to{"app":"org.example.Terminal","appIcon":"com.mitchellh.ghostty","image":""}. The synthetic sender deliberately uses an unknown desktop identity to exercise the image-path fallback independently of desktop lookup.Validation
bash test/shell.d/notifications-test.sh: 158 assertions pass, including precedence, empty identities, desktop-entry hints/properties, legacy image paths, replacement snapshots, file-copy planning, and persistence/restore.git diff --check: passes../test/all: CLI passes; shell completes with 9 of 248 test files failing outside notifications. Seven fail identically on the unchanged PR head:config,factory-reset-accounts,launch-about,omarchy-kernel-migration,snapper,unowned-system-paths, andupdate-pacman.network-qralso exits 1 after the same two passing cases on both branches.locatefails on suite-generatedbin/__pycache__bytes; it passes on a clean baseline and reproduces the same decoding error when that generated cache is present. No notification-suite failures.Related work
This extends the existing icon-fallback PR rather than opening a duplicate. #9985 fixes rendering of raw image-path values in the card; this change addresses snapshot metadata and persistence. #12567 identifies browser web-app icons from URLs, which is a separate source of icon identity. Senders supplying neither a usable image/icon nor a matching desktop identity can still remain iconless.