fmtCost read t.cost and called toFixed on it. A total with no cost
(null, or a reply without the field) threw "undefined is not an object
(evaluating 'c.toFixed')" in renderUsage (plugins/usage/page.js), so the
Usage page stopped drawing and the error's status line sat over the
window's foot. In quota-reads (#3406) that line covered Settings'
Allowance reads button at de 360 in WebKit, 2 of 11 red on main.
magpie's own /api/usage always sends a number (internal/usage/usage.go,
no omitempty), and the test's fake answers {}, so a user meets this only
on a reply without a cost. A cost not read is unknown, so it now shows
nothing, not $0.
quota-reads: once the page error was gone, de 360 in WebKit was still
red. The button sits at 392-414 under a view that ends at 392, and the
app puts back the scroll Playwright makes, so the click landed on the
footer. The test now wheels to the button with reader.cjs's reach, as
a reader would, and fails when the page shows an error status.
Run at a6399dd49 plus this change (origin/main was 4982ded8a at fetch,
which changes no GUI file):
- quota-reads, both engines: 22 of 22 (was 9 of 11 in WebKit).
- currency, tray-cost, tray-totals, routing-request-metrics and
api-key-usage, both engines: 92 of 92.
- i18n-keys 4 of 4; go test -run 'Budget|I18n|Asset' ./internal/gui ok.
Broken by hand: with the old fmtCost line and the new test, quota-reads
is 0 of 22 in both engines ("an error is shown: ... toFixed").
Not run before the push: the whole GUI suite (started after it) and
go test ./... (no Go change).