Current row: moment value with windowed average, stable visibility (#173)#175
Merged
Conversation
…erage (#173) The Current row flickered in and out when the instantaneous reading dipped below the 10 mA display floor, and each surface showed its own instant. Keep the moment value as the headline but display the windowed average next to it ("-208 mA (avg: -245)"), and let the average carry the floor gate when available: the average moves slowly, so the row's visibility is stable, while sustained garbage (whose average also sits below the floor) stays hidden exactly as before. The average reuses source A's smoothing criteria, extracted into a shared averagedCurrentMicroAmps helper so the rate source and the displayed average cannot disagree. The notification's mA fallback stays instant-only (the line is already long) and inherits the stable gate for free. Arabic drafted for the new string, pending maintainer review. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The inline "-208 mA (avg: -245)" wrapped mid-parenthesis in narrow columns, larger font scales, and Arabic (maintainer on-device feedback). Move the average to a second line under the moment value, rendered at 0.8x size in the label colour so it reads as a quiet anchor rather than competing with the instant. Table cells accept a CharSequence now so the styled value flows through unchanged. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
almothafar
force-pushed
the
feat/173-current-avg-display
branch
from
July 17, 2026 12:58
4c1acc8 to
0e84a40
Compare
Owner
Author
|
Updated after on-device feedback + the #169/#170 merges:
🤖 Generated with Claude Code |
The unitless "avg: -245" was a leftover of the abandoned inline layout's width squeeze; on its own line the unit costs nothing and reads clearer. Route the value through formatCurrentValue so sign, unit, and Western-digit handling can't drift from the instant above. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Maintainer decision: the line is Latin-heavy already (sign + mA), so a lone Arabic word would just break the text direction. Wording to be revisited later. 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.
Follow-up to the #152 fixes, from on-device testing on the Mate 10 Pro. Base is master (#169/#170 merged; branch rebased).
The Current row blinked in and out whenever the instantaneous reading dipped below the 10 mA display floor, and each surface showed its own instant. Maintainer direction: keep the moment value as the headline (no smoothing it away, no show/hide flapping, no "—" placeholder) and show the windowed average alongside.
What it looks like now
(avg: −245)wrapped mid-parenthesis in narrow columns, larger font scales, and Arabic).formatCurrentValueas the instant, so sign style,mAunit, and the Western-digit guarantee (Battery details table: fix RTL alignment + use Western digits for numbers #96) can't drift.Behavior
averagedCurrentMicroAmpshelper so rate source A and the displayed average can't disagree). Resets on plug/unplug like the rate; until it's ready the row shows the instant alone.hasCurrent.BatteryRategainshasAvgCurrent/avgCurrentMilliAmps; table cells acceptCharSequenceso the styled value flows through; new stringbattery_current_avg_line.Tests
Dip-below-floor stays shown via the avg gate; sustained sub-floor average hidden; fresh window gates on the instant without the avg line;
averagedCurrentMicroAmpsboundaries (mean, implausible-skip, short span, too few);formatAverageCurrentLineunder en + ar.testDebugUnitTest+lintDebuggreen.On-device
Watch the Current row through a normal session — it should tick but never blink out, with the avg line appearing ~45 s into a steady window and tracking the sustained draw.
Closes #173
🤖 Generated with Claude Code