repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

notifications: tidy card (dedupe comment, top-align full-mode icon)

e23db3b706beccd2d834acf336ebda3ef16c29dd

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Task 3 review minors: remove a duplicated comment block and anchor the
app icon to the top in full mode so it sits beside the app-name row on
tall multi-line cards. Also propagate the Item-wrapper delegate pattern
into the Task 4 plan (toast Repeater hits the same modelData injection).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Changed files (2)

quickshell/nuguland/NotificationCard.qml

Modified
78 78 spacing: 10
80 80 IconImage {
81 + anchors.top: card.compact ? undefined : parent.top
81 82 anchors.verticalCenter: card.compact ? parent.verticalCenter : undefined
82 83 width: card.compact ? 20 : 36
83 84 height: width
88 89 Column {
89 - // size off the card's own (externally-set) width, NOT parent.width:
90 - // cardBody is a Row whose width derives from content, so reading it
91 - // here collapses the column to 0 (a binding loop). 22 = left+right margins.
92 90 // size off the card's own (externally-set) width, NOT parent.width:
93 91 // cardBody is a Row whose width derives from content, so reading it
94 92 // here collapses the column to 0 (a binding loop). 22 = left+right margins.

quickshell/nuguland/docs/superpowers/plans/2026-06-27-notifications-redesign.md

Modified
225 225 - [ ] **Step 3: Add `activeToastRows` / `dismissToast` / `dismissToasts`; surface in stateJson**
227 +`liveRow(row)` already exists in `Notifications.qml` (added with Task 1's replace-by-id work — it overlays the current native `summary`/`body`/`appIcon`/`image`/`urgency` from `nativeNotifications[id]` onto a snapshot row). **Do not re-add it.** Wrap each toast row in `liveRow` so a replace-while-toast-visible updates the toast text (the native object is stored unconditionally in `acceptNativeNotification`, before the transient check, so `liveRow` resolves transient toasts too):
227 229 ```qml
228 230 function activeToastRows() {
229 231 const rows = [];
230 232 for (let t = 0; t < activeToasts.length; t++) {
231 - const row = toastById[activeToasts[t]];
232 - if (row && !row.closed)
233 + const stored = toastById[activeToasts[t]];
234 + if (!stored)
235 + continue;
236 + const row = liveRow(stored);
237 + if (!row.closed)
233 238 rows.push(Object.assign({}, row, {
234 239 "actionRows": actionRows(row),
235 240 "timeoutMs": toastTimeoutMs(row)
727 732 Repeater {
728 733 model: toasts
729 - delegate: NotificationCard {
734 + // Wrap in a plain Item: Qt6 does NOT inject an array
735 + // model's modelData into a required property on an
736 + // external-component (NotificationCard) delegate root —
737 + // the wrapper takes the injection and passes it down
738 + // explicitly. (Same fix used for the popup in Task 3.)
739 + delegate: Item {
740 + id: toastWrap
730 741 required property var modelData
731 742 width: toastColumn.width
732 - theme: nuguTheme
733 - modelData: modelData
734 - compact: true
735 - onDismiss: (id) => notifications.dismissToast(id)
736 - onInvokeAction: (id, actionId) => notifications.runAction(id, actionId)
743 + implicitHeight: toastCard.implicitHeight
744 + height: implicitHeight
745 + NotificationCard {
746 + id: toastCard
747 + width: parent.width
748 + theme: nuguTheme
749 + modelData: toastWrap.modelData
750 + compact: true
751 + onDismiss: (id) => notifications.dismissToast(id)
752 + onInvokeAction: (id, actionId) => notifications.runAction(id, actionId)
738 754 Timer {
739 - running: (modelData.timeoutMs || 0) > 0
740 - interval: Math.max(1, modelData.timeoutMs || 0)
755 + running: (toastWrap.modelData.timeoutMs || 0) > 0
756 + interval: Math.max(1, toastWrap.modelData.timeoutMs || 0)
741 757 repeat: false
742 - onTriggered: notifications.dismissToast(String(modelData.id))
758 + onTriggered: notifications.dismissToast(String(toastWrap.modelData.id))