Skip to content

Collapse identical notifications arriving together into one card again - #18349

Merged
dhh merged 2 commits into
quattrofrom
collapse-duplicate-notifications
Nov 10, 2026
Merged

dhh merged 2 commits into
quattrofrom
collapse-duplicate-notifications

Conversation

@dhh

@dhh dhh commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

A web app open in several tabs fires one notification per tab for a single reminder. A HEY calendar reminder arrived from Chromium twice, 12 ms apart, under ids 9 and 10, and stayed on screen as two identical critical cards.

#13522 collapsed these, but the check went out with the old engine when the notification engine was replaced (4671ae2), and the new one never gained it.

What changes

A new notification that repeats a live card word for word within two seconds now takes over that card's slot, the way a replaces_id update does: one card, one history entry, and the superseded copy is closed at its sender.

  • Same means the same app, source, headline, text, click command and buttons (Store.isDuplicate).
  • The picture is not compared: Chromium hands each copy its own temporary file.
  • The click command is: every screenshot toast shares its text but opens a different file.
  • The same words after the window are a second message ("ok", an hour later), not a copy. Collapse identical notifications from the same sender into one toast #13522 had no time limit.
  • A card on its way out is not brought back by a copy of itself.

Testing

test/shell.d/notifications-test.sh passes, with a new case modelled on the HEY duplicate (a copy landing before the first card is shown, and one landing on the shown card) plus the cases that must stay separate. The new case fails with the matcher disabled. The test fixtures now give each fake sender its own body, since identical ones arriving together are one card.

Not exercised against a live Chromium notification.

🤖 Generated with Claude Code

A web app open in several tabs fires one notification per tab for a
single reminder: a HEY calendar reminder arrived from Chromium twice,
12 ms apart, under ids 9 and 10, and stayed on screen as two identical
critical cards.

#13522 collapsed these, but the check went out with the old engine when
the notification engine was replaced (4671ae2), and the new one never
gained it.

A new notification that repeats a live card word for word within two
seconds now takes over that card's slot, the way a replaces_id update
does: one card, one history entry, and the superseded copy is closed at
its sender. Same means the same app, source, headline, text, click
command and buttons. The picture is not compared, since Chromium hands
each copy its own temporary file; the click command is, since every
screenshot toast shares its text but opens a different file. The same
words after the window are a second message, and a card on its way out
is not brought back by a copy of itself.

Co-Authored-By: Claude <noreply@anthropic.com>
@dhh
dhh marked this pull request as ready for review November 10, 2026 11:06
@greptile-apps

greptile-apps Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; both previous findings are fixed.

Summary

Collapses matching notifications arriving within two seconds into one card and closes the superseded sender.

  • Matching notifications arriving together share one live card.

Reviews (2) · Last reviewed commit: "Keep unnamed toasts in their own decks a..." · Reviewed by Greptile

Comment thread shell/plugins/notifications/Service.qml Resolved
Comment thread shell/plugins/notifications/Store.js Resolved
… own cards

Two regressions in the duplicate collapse, both found in review.

The row was snapshotted before its key was chosen, so an omarchy-action
or notify-send toast, which is grouped by its own key, got the group
"toast:" with no key: unrelated notices fell into one deck, the newest
hiding the rest. The group is rebuilt once the key is known.

The match compared Omarchy's command hints but not the sender's own
actions, so the same words offering Reply and then Join merged, and the
first button was lost with its sender. A copy now has to offer the same
buttons as the card it repeats.

Co-Authored-By: Claude <noreply@anthropic.com>
@dhh
dhh merged commit 255acd9 into quattro Nov 10, 2026
3 of 4 checks passed
@dhh
dhh deleted the collapse-duplicate-notifications branch November 10, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant