mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-24 04:33:17 +00:00
5db751985c
The metric, stacked memory and stacked disk bars choose between "60%" and "60% (265 GB/440 GB)" by estimating the label's width. The estimate was 5.5px per character plus 8, which is off by -7px to +5px on real labels: at the label's 10px type a digit is 6.7px wide and a full stop 3px. In the Kubernetes clusters table at a 560px viewport the memory bar is 113px wide, the estimate came to 112.5px, the label needs 118px, and it rendered with an ellipsis. A sweep of the platform tables found 24 such bars on main, all stacked memory bars, at 560, 900 and 1440px. estimateTextWidth now sums per-glyph advances. It reads them once per page from a hidden probe that carries the label's type classes, so the estimate follows whichever system font the browser renders; the advances measured for the macOS system font stand in where there is no layout. The value is measured semibold and the detail at normal weight, and each model adds the padding its own label sits in instead of sharing one constant. Two more gaps in the same decision are closed. The stacked bars now count the anomaly marker that shares the label's line, and the inline per-disk slots are sized after the gap between them: a two-disk Proxmox node at 900px clipped "backup 80%" by 2px. The probe is the estimator's only layout read, 1.7ms on the 429-bar Proxmox overview, and never per bar. Bar widths still come from the resize observer alone.