Between 640px and the width the Usage head needs in full (the tabs, the
periods with Custom named, Refresh's period and the sum), the sum was the
one item in the head that could shrink, so ≈$0.001 read "≈$0." with
nothing to say more was there. The narrow-window layout only began below
640px, and how wide the head needs to be depends on the language and the
sum's own length, so no single breakpoint fits.
The head now takes the narrow layout (.usage-head.tight: the sum's label
hidden, the unpicked Custom unnamed, Refresh compacted, wrapping as a
last resort) wherever the sum would be cut. A ResizeObserver and a
MutationObserver on the head decide it on the next frame, by whether the
sum's right edge passes its box.
Verified:
- usage-sum-whole.test.cjs (new): Chromium and WebKit, en/zh/ja/de,
every width from 380px to 1240px in steps of 10: the sum reads whole,
inside its box and the window, and the page never scrolls sideways.
Without the change Chromium en is cut from 650px to 750px+ (the box
0px to 15px wide for a 62px sum).
- usage-range, usage-arrange, usage-unpriced-names, currency,
usage-ledger, usage-refresh, usage-refresh-flight, usage-quota-head,
usage-hit-rate, click-scroll, gui-ja, gui-de: 104 pass in both engines.
- Not tried in the built desktop app on the reporter's screen.