feat(settings): improve battery status layout - #3103
Conversation
|
@bbedward @purian23 My initial intention is to redesign the battery info tab in the settings, but there is a question I want to clarify before going any further: Should we repeat the information that's already available in the battery widget? Because I'd like to remove the duplicate information and replace it with something more useful, like battery history, so users can track their battery level over an extended period of time. But the edge case is some user might not use the battery widget so this is still holding some use case. |
|
Hey @hthienloc, I'm fairly open on this one with no strong opinions either way. It should repeat maybe the basics of info, but otherwise open to the options you listed for sure. Thanks! |
|
/claude review |
| spacing: Theme.spacingXXS | ||
|
|
||
| StyledText { | ||
| text: I18n.tr("Estimated time") |
There was a problem hiding this comment.
These re-cased/reworded labels create brand-new untranslated terms and orphan already-translated ones. quickshell/translations/en.json has Estimated Time (line 8809), Battery Health (3262) and AC Adapter (Plugged In) (964), each referenced only from this file — so this PR drops every existing locale's translation for them in exchange for identical strings that differ only in casing/wording. CONTRIBUTING asks to reuse existing terms.
Please restore the exact existing terms:
- line 147:
I18n.tr("Estimated Time") - line 177:
I18n.tr("Battery Health") - line 105:
I18n.tr("AC Adapter (Plugged In)")
| text: I18n.tr("Estimated time") | |
| text: I18n.tr("Estimated Time") |
| width: parent.width | ||
| iconName: "battery_charging_full" | ||
| title: I18n.tr("Status") | ||
| settingKey: "batteryStatusCard" |
There was a problem hiding this comment.
Dropping title: here breaks the settings-search label for this card. extract_settings_index.py falls back to the block's first text: when there's no title (find_settings_components, lines 368-377), so it picked up the no-battery fallback string: the regenerated index now lists batteryStatusCard as "Power" (and with no icon) instead of "Status". Users searching settings will see the battery card titled "Power" under the "Power & Security" tab, which reads as a different setting.
If the header-less card is intentional, keep the searchable title but hide the header — or at minimum reorder so the first text: in the block is a meaningful label rather than the !batteryAvailable fallback.
Claude reviewLayout change looks sound; two i18n/search-index issues worth fixing before merge.
Checked: effective diff is BatteryTab.qml + settings_search_index.json (the BatteryService.qml commits are already on master); verified |
|
/claude review |
| text: BatteryService.batteryAvailable ? `${BatteryService.batteryLevel}%` : I18n.tr("Power") | ||
| font.pixelSize: Theme.fontSizeXLarge | ||
| font.weight: Font.Bold | ||
| color: root.batteryStatusColor | ||
| } | ||
|
|
||
| StyledText { | ||
| text: BatteryService.batteryAvailable ? BatteryService.batteryStatus : I18n.tr("Management") |
There was a problem hiding this comment.
The no-battery fallback splits the phrase "Power Management" across two separate I18n.tr() calls ("Power" on line 88, "Management" on line 95), rendered side by side in the same Row. Those are two unrelated existing terms in en.json (a nav label and a generic noun), and word order + wording can't be fixed by a translator, so localized builds get things like "Energía Gestión". Sentence fragments shouldn't be assembled from separate terms.
BatteryService.batteryStatus already returns a properly translated "No battery" for this case, so the simplest fix is to drop the fragment and let the existing status string carry it — e.g. keep the icon/percentage slot empty (or use one whole new term) and use BatteryService.batteryStatus unconditionally on line 95.
Claude reviewBoth findings from the previous round are fixed; one new i18n issue.
Checked: previous round resolved — |
Type of change
Screenshots / video