Repository navigation
battery: redesign the bar widget and popout - #4337
Conversation
Claude reviewFour layout and rendering bugs, plus some reuse, token and idle-cost cleanups.
Docs pending: new battery widget options ( Checked: the v47 settings migration and its idempotence, JS helper/QML contracts, settings keys, untouched translation catalogs, the generated search index, wave timer gating, other |
Claude reviewThe ten findings from the last review are fixed. Two new issues: a popout bug and a raw
Docs pending: new battery widget options ( Checked: the earlier findings against HEAD, the v47 migration and its idempotence, settings keys in the spec, data, profiles and UI, the JS helper and QML contracts, other |
Claude reviewNo issues found. Both findings from the last review are fixed: the details group now reads Checked: the hero layouts moved into one column with their footer (invisible footers add no gap), |
Claude reviewOne layout bug: the ring hero can show a blank column when a peripheral leads.
Checked:
Model: claude-opus-5-5. |
Claude reviewNo issues found. The finding from the last review is fixed: Checked:
Model: claude-opus-5-5. |
Claude reviewNo issues found in the four commits since the last review (f3fac77..HEAD). Checked:
Model: claude-opus-5-5. |
Claude reviewNo issues found in the two commits since the last review (095cd1d..HEAD). Checked:
Model: claude-opus-5-5. |
4a222b0 to
7df38eb
Compare
Claude reviewTwo bugs in the squashed branch: a crash and a gap in the migration.
Checked:
Model: claude-opus-5-5. |
| openSettingsWithTab("bar_widget"); | ||
| return; | ||
| } | ||
| const slotted = origin?.barId === barId && !origin.surface?.islandController; |
There was a problem hiding this comment.
This throws when openBarWidgetSettings is called without barId and origin, which is what the new "Widget settings" row in the Control Center battery menu does (WidgetConfigOverlay.qml:213). origin?.barId === barId is undefined === undefined, so it is true, and origin.surface then reads a property of undefined.
It breaks whenever the battery widget is on a bar, or in no bar or dock. Only the dock path returns before this line. Settings never opens, and the root.close() after the call never runs, so the menu stays open.
| const slotted = origin?.barId === barId && !origin.surface?.islandController; | |
| const slotted = !!origin && origin.barId === barId && !origin.surface?.islandController; |
| if (bar.batteryColorMode === "theme") | ||
| bar.batteryColorMode = "lowcharging"; | ||
| for (var k = 0; k < BAR_WIDGET_LIST_KEYS.length; k++) | ||
| migrateBatteryWidgetList(bar[BAR_WIDGET_LIST_KEYS[k]], ["id", "widgetId"], isVerticalPosition(bar.position)); |
There was a problem hiding this comment.
The v50 migration skips battery widgets in island layouts. Island bars render any bar widget from bar.islandHomeLayout through SurfaceWidgetHost (HomeCompact.qml:1076), and an island widget inside a bar list carries its own islandHomeLayout. eachSysmonList (line 935) already walks both, but this loop only covers BAR_WIDGET_LIST_KEYS.
After upgrading, an island battery with batteryStyle: "ring" or "duo" stays unmigrated. Battery.qml:298 only maps "circle" to the arc, so it draws as a solid meter. The style dropdown has no matching value either. An island "icon" entry doesn't get batteryDirection: "vertical", so it falls back to the "horizontal" default and is rotated 90°.
Fix: also call migrateBatteryWidgetList on bar.islandHomeLayout and on the islandHomeLayout of each island widget in the bar lists, with the bar's vertical.
Claude reviewNo issues found. Both findings from the last review are fixed in 4d7d5c8. Checked:
Model: claude-opus-5-5. |
Description
Needs duxlabs-dev/dux-qml-common#57 for the shared widget changes. Has already been merged now so this PR is good to go!
Redesigns the battery bar widget and the popout.
Bar widget:
Popout:
Behavior changes:
Type of change
Related issues
Partially implements #3806, excluding the notification part of this issue.
Screenshots / video
Use case for a desktop PC without a battery:

Popout
(Color update on the device row that is not on the other screenshots. depending on the theme they looked very weird. now its the charge status merged with the background row)

More styles and layouts
Settings
Checklist
I18n.tr()with translator context, reusing existing terms where possiblemake fmt, added/updated tests,make testpasses, andgo mod tidyis cleanmake lint-qmlwith no new warnings