Details table: keep Rate / Time / Current rows always present with a placeholder + info icon (#188)#189
Merged
Merged
Conversation
…de (#188) The rate, time-estimate and current rows used to appear and disappear depending on state (rate warm-up, time-to-full charging-only + <99% gate, current dipping below the display floor), which shifted the table and read as janky. They are now permanent: the label follows the charge direction and a not-yet-available value shows a "—" placeholder with a tappable info icon that explains why (rate still settling, current not always reported, estimate needs the rate first). In steady state the labels are constant, so values update in place with no flicker; a label only changes on plug/unplug. - New "Time to empty" while discharging (BatteryRateTracker.estimateMinutesToEmpty), the mirror of Time to full; formatTimeToFull renamed to the direction-neutral formatDuration. - Placeholder is a dash ("—") deliberately: every worded option is much longer in Arabic and the value column has broken layout before (#175); the info dialog carries the explanation where length is free. - New neutral ic_info affordance (distinct from the amber #94 warning); applyValueDecorations clears every decoration on rebind so a row can flip between real value and placeholder in place. - New strings drafted in EN + AR (values-ar). Closes #188 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…#188) "Time to empty" / "الوقت حتى الفراغ" reads as vague in Arabic — فراغ (empty/ void/space/finish) doesn't make clear "empty of what". "Time remaining" / "الوقت المتبقي" is unambiguous. Renamed the string key time_to_empty -> time_remaining to match. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The Design capacity row only existed once a value was set, so it appeared out of nowhere the first time — the same show/hide the rest of this change removes. It's now always present: when no design capacity is entered it shows the "—" placeholder + info icon, whose dialog explains what it is and that it's set in Battery Insights. Also generalized the info-icon content description to "More information" (it now serves both not-yet-ready values and this not-set config row). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Three details-table rows appeared and disappeared with state, shifting the rows below them and reading as confusing/janky:
Fix — the three "live" rows are now permanent; the label + value adapt instead
Charge rate: 30%/hDrain rate: 9%/h—+ ⓘTime to full: ~1h 20mTime to empty: ~5h 30m(new)—+ ⓘ+900 mA−208 mA—+ ⓘsyncRows(Details refresh: stop rebuilding the whole table every 3 s; cut redundant reads per tick #161) updates the value cells in place — no flicker. A label only changes on plug/unplug, when the whole context changes anyway.—+ a tappable ⓘ, chosen over words: every worded option ("Calculating…", "Pending", "N/A") is much longer in Arabic and the value column has broken layout before (Current row: moment value with windowed average, stable visibility (#173) #175). The dash is width-neutral in both locales; the ⓘ dialog carries the explanation in full sentences (rate settling / current not always reported / estimate needs the rate first).BatteryRateTracker.estimateMinutesToEmpty, the mirror ofestimateMinutesToFull; the shared formatterformatTimeToFull→formatDuration(direction-neutral). Arabic labelالوقت حتى الفراغmirrors the existingالوقت حتى الاكتمال, no wider than what the table already carries.ic_infodrawable (distinct from the amber Battery health: show 'Unknown' + tappable info when the charge gauge is unreliable (vs design capacity) #94 warning).applyValueDecorationsnow clears every decoration on rebind, so a row flips between a real value and the placeholder in place without leaking an icon/colour/click.Tests
EstimateMinutesToEmpty(8 cases) + renamedFormatDurationinBatteryRateTrackerTest.BatteryDetailsRowSyncTest(Details refresh: stop rebuilding the whole table every 3 s; cut redundant reads per tick #161) still pins the in-place behaviour.testDebugUnitTest(420 tests) +lintDebuggreen (all new strings havevalues-ar); debug build installed on the Mate 10 Pro.On-device check: with the screen open, the Rate/Time/Current rows should stay put and never blink out — Current in particular; tapping the ⓘ on a
—value opens its explanation. Unplug and confirm the label flips to Drain rate / Time to empty with a sensible estimate.Arabic drafted by Claude — pending your review (the three dialog messages +
الوقت حتى الفراغ).Closes #188
Follow-up to #161, #173/#175, #108/#124.
🤖 Generated with Claude Code