omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

Dismissing a replayed notification re-archives it instead of forgetting it

Open Hazakins opened this issue 1 month ago • 1 comments

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, historyLimit 10

Steps to reproduce

  1. Count history files: ls ~/.local/state/omarchy/notifications/history | wc -l → 10 (already at historyLimit, so this run also shows the cap trimming the oldest entry as the new one archives).
  2. 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.json dropped, new entry …-165.json added; net count unchanged because of the cap, but the new entry is present).
  3. Replay history as toasts: omarchy shell notifications showHistory
  4. Dismiss the replayed test card: omarchy shell notifications dismiss "TD-063 repro"
  5. 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.json survived the dismiss.

Mechanism (file:line, this checkout)

  • Service.qml:321 removePopup(index, reason) is called for every reason a popup leaves the screen (dismissed, expired, replayed-then-dismissed) and at Service.qml:335 unconditionally calls archivePopupFileFor(entry) — defined at Service.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-83 binds right-click (Qt.RightButton) to closeRequested() → the same dismiss → archive path, so the obvious "dismiss" gesture can never shrink history.

Proposed fixes

  1. Narrow: in removePopup, when reason indicates the popup was a replayed card from history (not a fresh notification), delete its file instead of calling archivePopupFileFor again.
  2. General: add a forget(id) method to the notifications IPC target (alongside showHistory, 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.

Hazakins avatar Oct 12 '26 16:10 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.

aholbreich avatar Oct 12 '26 22:10 aholbreich