Files
omarchycn/migrations/1786517850.sh
T
David Heinemeier HanssonandClaude Opus 5 ab57ad65fd Make notification history the last ten notifications on disk
History was a pair of in-memory lists mirrored into notifications.json, split
into "pending" and "past" by a seen/unseen distinction no surface exposed,
capped at 100, deduped by an id that repeats across server generations, and
pruned by a 15-minute TTL. Replaying it showed five rows drawn from whichever
list happened to hold them.

Every toast already writes a file under ~/.local/state/omarchy/notifications
so it can survive a shell restart. That file is now the history record: when
the popup leaves the screen it moves into notifications/history instead of
being deleted, the newest ten are kept, and showHistory replays exactly what
is in there, including the toasts still on screen when it is asked for. A
notification DND silenced is written straight into the same directory, since
a toast that never showed is the one worth looking back at.

That leaves the models, notifications.json history payload, past pruning, and
the /tmp image cache that existed to keep century-old history thumbnails alive
with nothing to do, so they go.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-12 00:58:14 -07:00

11 lines
512 B
Bash

echo "Drop the retired notification image cache"
# Notification history used to be a pair of long-lived lists in
# notifications.json, and thumbnails for it were copied out of /tmp into this
# cache so they would outlive the screenshot they came from. History is now the
# last ten notification files under ~/.local/state/omarchy/notifications/history,
# which reference their image where it already lives, so nothing writes or reads
# this directory anymore.
rm -rf "$HOME/.cache/omarchy/notification-images"