Skip to content

Stop the power panel closing itself inside its opened handler - #15319

Merged
dhh merged 2 commits into
quattrofrom
fix/power-opened-loop
Oct 14, 2026
Merged

dhh merged 2 commits into
quattrofrom
fix/power-opened-loop

Conversation

@dhh

@dhh dhh commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

What

Found by the §3 shell log sweep (it was the third binding loop in the smoke log, after the two named in the plan). On a machine without a battery, opening the power panel ran onOpenedChanged, which called close() synchronously — writing the very property whose change was being notified. QML reports it on every attempt:

Binding loop detected for property "opened" (Ui/Panel.qml:22, power Panel)

The power panel is the only panel that closes inside its own opened handler. This defers that close with Qt.callLater; behaviour is unchanged (the button is hidden without a battery and the panel surface already gates on batteryPresent), minus the loop. Adds a runtime-smoke log check scoped to the opened loop — it sits next to #15298's FileView check and the two combine to no-binding-loops once both land.

Verification

From plans/overnight-quality.md §3 (shell log sweep).

On a machine without a battery, opening the power panel ran
onOpenedChanged, which called close() synchronously: writing the
very property whose change was being notified, which QML reports
as a binding loop for Panel.opened on every attempt. Defer the
close with Qt.callLater; the panel still never shows without a
battery (its button is hidden and KeyboardPanel gates on
batteryPresent), it just stops looping to say so.

Add a runtime-smoke log check for the opened loop.
@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with the previous test coverage gap addressed.

Summary

The power panel now defers its no-battery close with Qt.callLater, avoiding a write inside its own opened handler.

  • The power panel closes later when opened without a battery.

Reviews (2) · Last reviewed commit: "Exercise the power panel's no-battery pa..." · Reviewed by Greptile

Comment thread test/shell.d/runtime-smoke-test.sh Resolved
The smoke check only reaches the deferred close where no battery
exists. This fixture runs the real power panel against a dead
system bus (no UPower display device), opens it, and requires it
to settle closed with no binding loop, laptops included.
Mutation-checked: restoring the synchronous close fails it.
@dhh

dhh commented Oct 13, 2026

Copy link
Copy Markdown
Contributor Author

Greptile addressed: new power-no-battery-test.sh runs the real power panel in a fixture against a dead system bus (no UPower display device, so the no-battery path on laptops too), opens it, and requires it to settle closed with no binding loop. Mutation-checked: restoring the synchronous close fails the fixture.

@dhh
dhh merged commit 0b5f827 into quattro Oct 14, 2026
1 check passed
@dhh
dhh deleted the fix/power-opened-loop branch October 14, 2026 01:11
@emirb emirb added this to the 4.5 milestone Oct 17, 2026
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