mirror of
https://github.com/d4rken-org/capod.git
synced 2026-09-14 18:26:11 -04:00
The case row in the expanded notification carried a percentage alone, which doesn't answer whether the case can still top the earbuds up. It now appends the count the overview card already computes, in the same " . <value>" shape the earbud rows use for their time estimates. The figure is shown as a fraction rather than the card's integer because the integer barely moves on a small case: AirPods Pro 3 publishes a 2.0 charge case, so the count only ever reads 0, 1 or 2, and everything below 50% reads 0. A notification suffix makes no adequacy claim, so it can report the number without the interval logic the coloured card line needs. The decimal is cut rather than rounded. A 4.0 case at 24% covers [0.96, 1.00), which the card calls short of a full charge, and rounding to the nearest tenth would print "1.0" beside that. Cutting also keeps the lower-bound wording honest, since 3.8 at 20% is 0.76 and may not claim "0.8+". The epsilon before the cut absorbs binary float error only: 2.0 at 35% lands on 0.69999999 and still has to read 0.7. An empty case drops the "+" even on a lower-bound spec, matching the card's treatment of zero as exact rather than as an underestimate. Apple's Optimized Charge Limit is deliberately not modelled. It pauses around 80% only when the routine predicts you won't need the pods yet, so it applies to some top-ups and not others, and the unit stays whole pair charges. The case label gets a width cap because the row's progress bar is its only weighted child. The added word is translatable, and a long rendering at a large font scale would otherwise take the row and leave the bar at zero width.