Skip to content

Details table: keep Rate / Time / Current rows always present with a placeholder + info icon (#188)#189

Merged
almothafar merged 3 commits into
masterfrom
fix/188-stable-detail-rows
Jul 18, 2026
Merged

Details table: keep Rate / Time / Current rows always present with a placeholder + info icon (#188)#189
almothafar merged 3 commits into
masterfrom
fix/188-stable-detail-rows

Conversation

@almothafar

Copy link
Copy Markdown
Owner

Problem

Three details-table rows appeared and disappeared with state, shifting the rows below them and reading as confusing/janky:

  • Drain rate / Charge rate — absent during the ~1–3 min warm-up after plug/unplug or launch.
  • Time to full — charging-only, and only below ~99%.
  • Current — dropped out whenever the reading dipped below the display floor or the device momentarily didn't report it (the most visible one).

Fix — the three "live" rows are now permanent; the label + value adapt instead

Row Charging Discharging Not ready yet
Rate Charge rate: 30%/h Drain rate: 9%/h + ⓘ
Time Time to full: ~1h 20m Time to empty: ~5h 30m (new) + ⓘ
Current +900 mA −208 mA + ⓘ
  • In steady state every label is constant, so 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.
  • Placeholder = + 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).
  • New Time to empty while discharging — BatteryRateTracker.estimateMinutesToEmpty, the mirror of estimateMinutesToFull; the shared formatter formatTimeToFullformatDuration (direction-neutral). Arabic label الوقت حتى الفراغ mirrors the existing الوقت حتى الاكتمال, no wider than what the table already carries.
  • New neutral ic_info drawable (distinct from the amber Battery health: show 'Unknown' + tappable info when the charge gauge is unreliable (vs design capacity) #94 warning). applyValueDecorations now clears every decoration on rebind, so a row flips between a real value and the placeholder in place without leaking an icon/colour/click.
  • Design capacity is left as-is — it appears once when set and stays, it wasn't flickering.

Tests

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

almothafar and others added 3 commits July 18, 2026 13:45
…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>
@almothafar
almothafar merged commit 580d53b into master Jul 18, 2026
2 checks passed
@almothafar
almothafar deleted the fix/188-stable-detail-rows branch July 18, 2026 14:40
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.

Details table: stop rows showing/hiding — keep Rate / Time / Current always present with a placeholder + info icon

1 participant