Skip to content

Fix notifications placements binding loop - #20926

Open
grold wants to merge 2 commits into
omacom:quattrofrom
grold:fix/notifications-placements-loop
Open

grold wants to merge 2 commits into
omacom:quattrofrom
grold:fix/notifications-placements-loop

Conversation

@grold

@grold grold commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

What changes

omarchy-shell logged Binding loop detected for property "placements" (Service.qml:572:3), "layout" (Service.qml:547:3), and "shown" (Toast.qml:578:7) during notification waves, deck expansions, hover/sole changes, and dismissals.

Toast binds place, drawnWidth, and drawnHeight to placements (via service.at(...)) and called service.noteSize() synchronously from onTargetWidthChanged, onTargetHeightChanged, Component.onCompleted, and onShowingNotificationsChanged. Whenever toasts, expanded, sole, leaving, or hovered updated Toast sizes during an active placements/layout notification, noteSize() read placements in snapshot() and incremented layoutRevision += 1 mid-evaluation.

  • shell/plugins/notifications/Service.qml:
    • Added queueSize() / flushSizes() / applySizes() / jumpedSinceMove so non-arriving Toast size changes defer to Qt.callLater instead of re-entering snapshot() and layoutRevision synchronously. Arriving cards (key === arriving) still measure in place, queued updates for closed or leaving cards are dropped, and jumpedSinceMove keeps instant keyboard dismissals jumping (clearing in flushSizes() and landed() so subsequent resizes animate).
    • Computed landing in showRow() with service.layoutWith(service.expanded, service.openDeck) so arriving cards snapshot their freshly measured height/width even if layout evaluated during toasts.insert before Component.onCompleted.
    • In finishClose(), removed the model row (toasts.remove(at)) before unmarkLeaving(key) so layout never briefly sees a closing card as live and front again.
  • test/shell.d/notifications/logic.cjs: Added layoutWith to newCapacityScope and lifted Service.qml unit tests verifying zero re-entrant placements/layoutRevision reads during leaving updates, batching, instant-dismissal jump + flag clear, and dropping queued sizes for leaving cards.
  • test/shell.d/fixtures/notifications-layout/shell.qml & test/shell.d/notifications-test.sh: Added a real quickshell fixture (behind require_quickshell + dbus-run-session) exercising a 4-card action wave, animated close, instant dismissal, expanded/hovered/sole transitions with dynamic-width cards, and asserting 0 Binding loop detected warnings and settled card dimensions.

Verification

  • Confirmed the regression tests fail on base 536592fd0: notifications/logic.cjs fails without queueSize, and test/shell.d/fixtures/notifications-layout/shell.qml fails with arriving card snapshots its measured height (58 vs 93) and 23 Binding loop detected warnings (placements, layout, and shown).
  • Ran on 779b4f690:
    • bash test/shell.d/notifications-test.sh — 6/6 pass
    • ./test/headless bash test/shell.d/notifications-test.sh — 6/6 pass (0 binding loops)
    • bash test/shell.d/notification-send-test.sh — 30/30 pass
    • bash test/shell.d/motion-test.sh — 1/1 pass
    • bash test/shell.d/qml-text-format-test.sh — 19/19 pass
    • bash test/shell.d/qmllint-test.sh — 153/153 pass

Screenshots

No visible change: deferring non-arriving size updates to the next tick and reordering toasts.remove before unmarkLeaving preserves the existing notification deck layout, dynamic sizing, and animation behavior without binding loops.


Assisted by Gemini 4 Hydrogen (Reasoning: XHigh)

@greptile-apps

greptile-apps Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] The PR appears safe to merge; no actionable new issues were found.

Summary

The PR defers notification size updates to avoid binding loops while preserving arrival sizes and instant dismissals.

  • Notification cards wait to update their size until the layout is ready.

No actionable new issues were found. No previous review threads were supplied. Tests were not run during this review.

Reviews (2) · Last reviewed commit: "Keep a revived toast's deferred size" · Reviewed by Greptile

@chessing234

Copy link
Copy Markdown
Contributor

your commit is in #21025. the placement binding loop fix is on the notification service, next to the countdown border from #20998. the notification logic checks passed here. the state-directory setup then hit chmod --, which this Mac's chmod does not accept. @dhh @omarchybot if 21025 lands, this can close as superseded.

@chessing234

Copy link
Copy Markdown
Contributor

@dhh @omarchybot deferring placement updates that arrive mid-layout is in #21030.

The size test loads liveRows because layoutWith calls it, and stubs playArrivalSound. node test/shell.d/notifications/logic.cjs passed, including the deferred size cases and the flood cases that follow them.

Please consider closing this as superseded only after #21030 is accepted. Leaving the close to you.

@omarchybot omarchybot added the bug Something isn't working label Dec 2, 2026
Hold a leaving card's latest measurement until it closes or is revived. A replacement that changes only notification metadata can then use the unhovered size without another measurement signal.

Co-Authored-By: GPT-6 High in Codex <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 High <noreply@anthropic.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Dec 2, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

On an Omarchy ISO worker running Hyprland, the same notification bursts, dismissals, and deck expansion logged 62 binding-loop warnings on quattro, zero at 4a49d2c7d9, and 60 with the fix reverted. All six notification checks passed.

With animations enabled, a same-ID replacement during dismissal revived a compact toast at its old hover width. 4a49d2c7d9 keeps the last measurement until the card revives or closes. The new regression test failed when I restored the old code, and the live toast now returns at its normal width.

Before the correction, the revived toast keeps the extra hover width

After the correction, the revived toast returns at its normal width

I compared the diffs with #17951 and #18758. #17951 addresses the button visibility dependency, and #18758 defers height updates on the older layout. This PR defers both dimensions on current quattro. #21025 and #21030 include the original patch alongside other changes.

GPT-6 High in Codex ran the worker checks. Opus 5.5 High identified the revival case, and Opus 5.5 High and muse-wonder via pi at high effort reviewed the corrected commit and found no remaining defects. They may have shared context with this review.

The full suite hit the same four assertions on the final head and its fork point, in agent resume, audio panel opening, the provisioning keyboard test, and runtime smoke. The test and translation workflows on GitHub are waiting for maintainer approval.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants