Files
magpie/internal
ggbdpq 63cccbb47c usage: a custom provider's balance percent reads as Left or Used, as a window's does
The Left/Used switch turned every subscription window, but a custom
provider's balance meter stayed on the used share, its figure and its
bar alike (#3193): with balance.path "Daily: windows.0.used / 100%" the
card read "Daily 8.9%" with an 8.9% bar while Left showed every window
as what is left of it. Windows go through quotaFill/quotaText, which do
quotaLeft ? 100 - used : used; the two places that render a balance part
handed the percent to balanceMeter and drew the part's figure as the
reply had it, and neither reads the switch.

A part asked as a percent now reads the way a window does: on Left the
figure says what is left of it ("91.1% left", the "{n} left" wording
every language already has) and the bar fills with that; on Used the
figure and the bar are as the reply had them. The nearly-full colour
keeps to the used share, the meter warning either way. A part without a
percent (money, counts) is untouched, and the Go side's BalancePart
keeps its Text and Percent as they were: the balance line, the tooltip
and the history still say the reply's number, and the switch is a
rendering choice, so it is made where the windows' own one is.

balanceMeter fills with the switched share and colours by the used one;
balanceText, beside it, says a percent part's figure. panelBalances and
balanceRow, the tray panel's balance card and the Usage page's balance
row, put their parts through them.

Ran: balance-quota-left.test.cjs, new, on Chromium, en and zh, Left and
Used, the Usage page and the panel's Allowances tab. At this fix's
parent, red: the Left run waited 5s for "91.1% left" and timed out on
the figure the page never showed. At this head, green: the figure, the
bar's fill, the nearly-full colour on by the used share in both
displays, and a money part's figure and absent meter unchanged. With the
fix reverted at the tree the run went red again, and green once more
when restored. panel-balance-order, quota-balance-error, balance-parts,
panel-usage, routing-quota-left, usage-quota-head and quota-pools, 30
tests, green. go test -tags nogui ./internal/gui: TestProxyCheckSays
AProxyPassedBy red, as it is at the parent; the rest of the package ok.
gofmt -l clean. go vet ./... and GOOS=linux and GOOS=windows go vet
-tags nogui ./... clean (a cgo enum warning in trayimage_darwin.go, at
the parent too). go build -tags nogui on darwin, linux/amd64 and
windows/amd64 ok.

Fixes #3193

Reported by pc418 in #3193.

Generated-by: GLM-5.3-Flash (ZCode)
2026-11-01 16:43:21 +08:00
..
…
…
…
…
…
…