Show a notification the sender updated, instead of the version it replaced - #6733
Closed
dhh wants to merge 1 commit into
Closed
Show a notification the sender updated, instead of the version it replaced#6733dhh wants to merge 1 commit into
dhh wants to merge 1 commit into
Conversation
…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>
Contributor
There was a problem hiding this comment.
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 |
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #6731 — the base is
notification-history-on-disk, so this diff is just the one commit. GitHub retargets it toquattrowhen that merges.A client that updates a notification through
replaces_iddoes not produce a secondonNotification: Quickshell writes the new content onto theNotificationobject 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