Skip to content

Break the notification binding loop through a card's own height - #17951

Open
amuif wants to merge 1 commit into
omacom:quattrofrom
amuif:fix/notification-front-binding-loop
Open

amuif wants to merge 1 commit into
omacom:quattrofrom
amuif:fix/notification-front-binding-loop

Conversation

@amuif

@amuif amuif commented Nov 6, 2026 •

Copy link
Copy Markdown

What changes

Stacked notifications log Binding loop detected for layout, placements and shown (Service.qml:521, Service.qml:545, Toast.qml:532) during ordinary use.

A card showed its button bar from place.front, but placements depends on every card's height, and showing the bar changes that card's height: shown → targetHeight → noteHeight() → land() → layoutRevision → layout → placements → place → shown. Qt cuts the cycle mid-evaluation.

Which card leads a deck depends only on row order, so the service now passes each card a front flag from a new Layout.fronts(), computed from the live rows without heights or layoutRevision. Leaving cards keep their departure placement's flag, as before. layoutWith()'s live-row filter moves into liveRows() so both share one definition of which cards count.

Verification

  • bash test/shell.d/notifications-test.sh passes. The new check asserts Layout.fronts() marks the same cards compute() marks front (collapsed, expanded, one deck open); it fails on quattro, where fronts() does not exist. liveRows is added to the keyboard test's lifted functions, which use layoutWith().
  • Live, on stable 4.5.0-3 with the change applied to the installed shell: omarchy-dev-notification-demo logged 4 binding-loop warnings before (layout 1, placements 1, shown 2) and 0 after, with no QML errors.
  • Two stacked notifications with actions from one app: only the front card shows its button bar, unchanged from before.

Screenshots

Front card with its buttons, the older card stacked behind without them (after the change):
omarchy-pr-17951-screenshot

A card showed its button bar from place.front, but placements depends on
every card's height, and showing the bar changes that card's height:
shown -> targetHeight -> noteHeight -> land -> layout -> placements ->
place -> shown. Qt cut the cycle with "Binding loop detected" warnings for
layout, placements and shown during ordinary notification use.

Which card leads a deck depends only on row order, so the service now
gives each card a front flag from Layout.fronts(), read from the live rows
without heights or layoutRevision. Leaving cards keep their departure's
flag, as before.
@greptile-apps

greptile-apps Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

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

Summary

This PR separates notification button visibility from height-dependent card placement to break the reported binding loop.

  • Notification cards show actions on the lead card without a height feedback loop.

No actionable new issues were found. Tests were not run during this review. Local visual verification was blocked by the missing Qt/Quickshell runtime.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Rows[Live rows] --> Fronts[Layout.fronts]
  Fronts --> Buttons[Button visibility]
  Buttons --> Height[Card target height]
  Rows --> Layout[Layout.compute]
  Height --> Layout
  Layout --> Placement[Card placement]
Loading

Reviews (2) · Last reviewed commit: "Break the notification binding loop thro..." · Reviewed by Greptile

@omarchybot

Copy link
Copy Markdown
Collaborator

I read the four-file diff at bf9df2395b9d4b6910b929e357be8cf6f16c4f43, the surrounding notification layout and button-visibility code, and the notification tests (GPT-6, high effort, in Codex).

Classification is incomplete: I classified this as a bug fix, but the configured DeepSeek V4.1 Flash classifier returned no usable class, so the required two-model classification has not completed. Worker verification and the second implementation review were skipped at this stage; no tests ran and no changes were pushed. Further verification waits for classification to be resolved.

@omarchybot omarchybot added the bug Something isn't working label Nov 22, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

The stacked-card path is fixed at bf9df2395b9d4b6910b929e357be8cf6f16c4f43, but keyboard navigation through a deck taller than the screen still logs a binding loop.

On disposable Omarchy ISO workers with real Hyprland sessions, I sent four same-app critical notifications with Open/Edit actions and dismissed them front-first, three rounds. That logged 57 binding-loop warnings at this branch’s fork point and zero at this head. Today’s quattro (fee089f164) logged 60; a test merge of this head with that commit logged zero. CLI, notification logic, sender, motion, and QML text-format checks passed on the worker. Updating an existing notification into another app’s group also correctly showed actions on both front cards.

The remaining case is a 1280×800 display with 16 same-app cards: enter notification keyboard mode and press Down until selection reaches the bottom. This head logged Binding loop detected for property "hovered" at shell/plugins/notifications/Service.qml:1646. Selecting a card reveals its buttons and grows it; synchronous noteHeight() then calls keepSelectionInReach(), which changes keyboardKey while the card’s hovered binding is still updating. I captured the warning; I am not claiming a visible stale highlight was observed.

#18758 defers that height callback and covers both paths. On a fresh worker at its full head 7b76fa10072e5f62ee0dd5299ccde9db793c4df8, the identical dismissal and keyboard sequences both logged zero warnings; the final selected card and its actions fit on screen. The two completed comparison reviews favored #18758 if it passed these probes, because it handles this additional reproduced case. It passed both. It already carries ready; this stays open for the maintainer to choose between the fixes. No branch changes were pushed.

GPT-6 High in Codex, Opus 5.5 High, and muse-wonder via pi (thinking high) reviewed the comparison. Opus identified the keyboard reach-back case before the worker reproduced it. Their source comparison used the supplied pinned diffs. A final recheck against a fixed checkout was terminated before returning a report; both reviewers still answered the availability check afterwards. Their agreement is not guaranteed to be independent of this review. I have not added verified or ready here.

These settled-state captures show that the two-card stack retains its appearance; the journal comparisons above establish the warning difference.

Before: the base shows actions on the front card of a two-card stack

After: this head preserves the same settled two-card appearance

@chessing234

Copy link
Copy Markdown
Contributor

@dhh @omarchybot breaking the placement binding loop through a card's own height is in #21030, together with the deferred size updates from #20926. The animation snapshot now reads service.placements, so a getter installed by the size test is the placements the snapshot copies.

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

@omarchybot

Copy link
Copy Markdown
Collaborator

The December 1 overlap is real. #21030 included this front-card change and closed without merging. The current diff still reports size changes synchronously when keyboard selection expands a card, which produced the hovered warning in the earlier 16-card worker test. #20926 defers both width and height updates before checking whether the selected card still fits. #18758 deferred height alone and now conflicts with the width-aware code on quattro.

GPT-6.2 Sol High in Codex, Opus 5.5 High and muse-wonder via pi, thinking high checked the diffs and agreed on that distinction. The reviewers may have seen earlier findings. Prior worker runs for #20926 recorded zero binding-loop warnings during notification delivery, dismissal, and expansion. This pass used source and those earlier worker results. The exact 16-card keyboard sequence has yet to be run on #20926. This PR stays open for the maintainer to choose between the fixes.

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants