Let the quota line shrink into the circles instead of snapping at 900px #134
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/quota-display"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The problem
The quota badge swapped to its two circular gauges at a single
@media (max-width: 900px). Measured in a browser, the full line is 336px wide and the whole header wants 637px — so a half-width desktop window with a quarter of the header sitting empty still showed phone-shaped gauges, and so did every phone.Two more symptoms were hiding behind the same rule:
titletooltips — and a phone has no hover. The one surface that still had the answer was the one the operator could not reach.What it does now
Four stages, each measured rather than picked:
Headerhides its wordmark — 107px of the logo's 139pxThe ramp starts ~90px above where the line would actually stop fitting, so the narrowing reads as a warning rather than a surprise, and the switch sits at the foot of it.
The circles are the floor, not the mobile form. 330px is below the narrowest phone still in circulation, so a phone now gets a real reading.
The unknown state renders the same two forms instead of its own. A null window draws a dashed track and an em dash inside the same markup, so an arriving report fills the shape that was already there — and the two
{#if}branches collapse into one.Tapping the badge opens a panel with both windows' percentage and reset time (or "no report yet"). Being absolutely positioned it costs the header no width, so it reads identically at 1400px and 320px and in either form — which is why it's the answer rather than a fifth breakpoint, which would have had to buy the room from somewhere. It reuses
HeaderMenu's disclosure contract: listeners only while open, and the outside-click root is the wrapper that contains the trigger, or tapping the badge again would close onpointerdownand reopen onclick.Approaches that do not work
Recorded in the code comments so they aren't retried:
.q— measures the badge's own (tiny) inline size. Size containment makes it ignore its children, so it read as tiny at every width and the line never rendered at all. (A container on.rightis the variant that could work; see the last section for why it isn't taken.)width: 46pxmakes the bar's min-content contribution 46px too, so.rightcan't shrink and the logo absorbs the whole squeeze (measured: 139.5px → 91px, wordmark clipping, bars untouched). Swapping toflex-basis: 46pxinverts it — flex intrinsic sizing then sizes the bar from its max-content contribution, which is 0 because the fill is a percentage-width block, so the bar sat at its floor at every viewport, 1400px included.Verification
Driven in a real browser from 1400px down to 320px, including a forced-on pass below each switch to find the true floor rather than guessing it, and at the worst-case reading (100% in both windows, ~14px wider than two digits):
pnpm lintclean,svelte-check0 errorsAGENTS.md fact #19 updated with the stage table, the disclosure, and both dead ends. Fact #21's "never put
overflow: hiddenon that header" now protects two popups instead of one./simplify pass (commit 2)
Four cleanup agents reviewed the diff. Reuse: clean. Applied:
resolve()per window. The markup asked the same three questions in four places —w ? band(…) : 'unknown'twice on adjacent lines, plus a tooltip helper re-deriving the rounded percentage and re-running the Intl-backedfmtResetat each of its two call sites.fmtResetdrops from three calls per window to one..track.unknownclass instead of a boundstroke-dasharray, so all four "unknown" tokens are expressed the same way.quota-badge-stages.test.ts— the altitude review flagged that Header's wordmark constant is meaningful only in terms of the badge's internal budget, with the two files correlated by prose alone. The test pins the ordering, not the numbers: retuning a breakpoint stays green, inverting two stages or moving one without the other does not. All six guards were mutation-checked (inverting the circles floor, moving the wordmark drop below it, detuning the ramp end, moving the reset drop below the wordmark drop, renaming the.rstrule) — each produced the expected failures.Skipped, with reasons:
.pct.unknown/.cap.unknowninto one rule — saves a line but breaks their co-location with their own token families. The reviewer agreed..right— the one variant that could actually work. It needsflex: 1 1 0; min-width: 0, which zeroes the content-based minimum that AGENTS.md fact #21 depends on (the logo has to be what yields under the window-controls overlay, or the right cluster slides under the window controls and the menu stops hit-testing). That trades a measured guarantee for an approximation, so it stays viewport-based and the reasoning is now recorded in the file.