omarchy
omarchy copied to clipboard
Dismissing a replayed notification re-archives it instead of forgetting it
Environment
- Omarchy 4.0.4-1 (
pacman -Q omarchy) - Shell plugin:
/usr/share/omarchy/shell/plugins/notifications/Service.qml+components/NotificationCard.qml - History store:
~/.local/state/omarchy/notifications/history/<epoch_ms>-<id>.json,historyLimit10
Steps to reproduce
- Count history files:
ls ~/.local/state/omarchy/notifications/history | wc -l→ 10 (already athistoryLimit, so this run also shows the cap trimming the oldest entry as the new one archives). - Send a notification and let it expire/archive:
notify-send -a td-063-repro "TD-063 repro" "archive-then-dismiss test — ignore"Count again → 10 (oldest entry…-155.jsondropped, new entry…-165.jsonadded; net count unchanged because of the cap, but the new entry is present). - Replay history as toasts:
omarchy shell notifications showHistory - Dismiss the replayed test card:
omarchy shell notifications dismiss "TD-063 repro" - Count again → 10, and
…-165.json(the dismissed card) is still on disk.
Expected vs actual
- Expected: dismissing a card that only exists because it was replayed from history should forget it (or at least not re-insert it) — the user already saw and dismissed it once.
- Actual: the dismissed card is written straight back into the history directory. The history file count cannot shrink except by
clearHistory()(all-or-nothing). Confirmed above:…-165.jsonsurvived the dismiss.
Mechanism (file:line, this checkout)
Service.qml:321removePopup(index, reason)is called for every reason a popup leaves the screen (dismissed, expired, replayed-then-dismissed) and atService.qml:335unconditionally callsarchivePopupFileFor(entry)— defined atService.qml:538— which writes/keeps the entry file.clearHistory()(Service.qml:588) is the only function that deletes, and it deletes everything.components/NotificationCard.qml:35,82-83binds right-click (Qt.RightButton) tocloseRequested()→ the same dismiss → archive path, so the obvious "dismiss" gesture can never shrink history.
Proposed fixes
- Narrow: in
removePopup, whenreasonindicates the popup was a replayed card from history (not a fresh notification), delete its file instead of callingarchivePopupFileForagain. - General: add a
forget(id)method to thenotificationsIPC target (alongsideshowHistory,dismissOne,dismiss,clearHistory) that deletes one history file by id, so any client (ours included) can remove a single entry without clearing all.
— drafted with Claude (Sonnet 5 subagent, reviewed by Fable 5.1, via Claude Code); reviewed and posted by Hazakins.
This is covered by the open PR #14804: with it, a manual close or click deletes the popup file, the matching history file, and its copied images, while timeouts still go to history. Its test includes the "restored manual close" case, i.e. dismissing a replayed card removes it from history/. The per-id forget(id) IPC from your second proposal isn't part of it.