Skip to content

Show a notification the sender updated, instead of the version it replaced - #6733

Closed
dhh wants to merge 1 commit into
notification-history-on-diskfrom
notification-replace-rebinding
Closed

Show a notification the sender updated, instead of the version it replaced#6733
dhh wants to merge 1 commit into
notification-history-on-diskfrom
notification-replace-rebinding

Conversation

@dhh

@dhh dhh commented Aug 12, 2026

Copy link
Copy Markdown
Member

Stacked on #6731 — the base is notification-history-on-disk, so this diff is just the one commit. GitHub retargets it to quattro when that merges.

A client that updates a notification through replaces_id does not produce a second onNotification: Quickshell writes the new content onto the Notification object the shell is already holding. The card draws a snapshot copied out of that object — deliberately, since a live QObject in a ListModel role becomes a dangling pointer the moment the server destroys it — so nothing reached the screen. A Slack thread that updates in place read as stuck on its first message, and that stale version is what got archived to history.

Every property the card draws is now watched on the notification we hold, and a change rewrites both the model row and the file the popup was persisted under. That file name is the popup's identity, so the rewrite lands in place: a shell restart restores the version last shown, and so does the copy that reaches history.

The countdown starts over when the content changes — new text arriving a second before the toast was due to expire deserves a full look, not the remainder of the clock the text it replaced had nearly run through.

Verified against the running shell: a replaced toast now shows the new text; an update at t=6s of an 8s toast kept it up until 14s; history archived the updated version; a replacement arriving after the original expired still comes through as its own fresh toast; and dismissing one toast out of several leaves the others' timers alone (the survivor still expired at 8.07s).

— 🤖 Claude, posting on behalf of @dhh

…laced

A client that updates a notification through replaces_id does not produce a
second onNotification: Quickshell writes the new content onto the Notification
object the shell is already holding. The card draws a snapshot copied out of
that object — deliberately, since a live QObject in a ListModel role becomes a
dangling pointer the moment the server destroys it — so the toast kept showing
the superseded text, and archived it to history when it left the screen. A
Slack thread that updates in place read as stuck.

Every property the card draws is now watched on the notification we hold, and
a change rewrites both the model row and the file the popup was persisted
under. The file name is that popup's identity, so the rewrite lands in place:
a shell restart restores the version last shown, and so does the copy that
reaches history.

The countdown starts over when the content changes. New text arriving a second
before the toast was due to expire deserves a full look, not the remainder of
the clock the text it replaced had nearly run through.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings August 12, 2026 07:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates active notification popups when clients modify them via replaces_id, including persistence and lifetime handling.

Changes:

  • Watches notification properties and refreshes popup snapshots.
  • Preserves popup identity while rewriting persisted content.
  • Adds replacement and timer-reset coverage.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
shell/plugins/notifications/Service.qml Watches updates, refreshes rows/files, and resets timers.
shell/plugins/notifications/NotificationLogic.js Creates replacement snapshots preserving popup identity.
test/shell.d/notifications-test.sh Tests replacement snapshots and service wiring.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

}

persistPopupFile(snapshot)
watchForUpdates(notification, snapshot)
Comment on lines +876 to +878
onSummaryChanged: cardSlot.remainingLifetime = 1.0
onBodyChanged: cardSlot.remainingLifetime = 1.0
onImageChanged: cardSlot.remainingLifetime = 1.0
@dhh

dhh commented Aug 12, 2026

Copy link
Copy Markdown
Member Author

Landed on quattro directly as cd84583 — closing this in favour of the commit that shipped. The Copilot findings on both PRs are being addressed in a single follow-up PR.

— 🤖 Claude, posting on behalf of @dhh

@dhh dhh closed this Aug 12, 2026
@dhh
dhh deleted the notification-replace-rebinding branch August 12, 2026 10:08
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.

2 participants