mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-11-23 13:29:08 +00:00
CI's swift test on macos-latest measured the two-row title at 21pt where this machine measures 20pt, so the exact-equality assertion failed 16 times. The figure is release-dependent: SF Symbol metrics and line rounding move between macOS versions. Nothing positions the rows off it — AppKit's button cell centres whatever it measures inside the status item — so 21pt is centred just as correctly as 20pt, and the requirement was always "fits a 22pt menu bar", not "measures exactly 20pt". The test now asserts that band, and twoRowMeasuredHeight is replaced by twoRowMaximumHeight (the bar) and twoRowMinimumHeight (a floor, so a lost paragraph clamp or a dropped second line is still caught rather than passing as "fits"). The 1pt delta does expose a real risk the constant was hiding: the first line's height follows the flame image, and the image size for a point size is the system's business. A release that renders it taller could push the title past the bar. The two-row attachment box is now computed by twoRowAttachmentBounds(imageSize:), which scales the image down to the clamped line height — never up — so the first line cannot outgrow its clamp. Verified by composing the real title with the flame forced to 11, 13, 16 and 24pt tall: every combination still lays out at 20pt here. The single-row path keeps the raw image size and its -3pt offset, so it stays byte-identical. |
||
|---|---|---|
| .. | ||
| CodeBurnMenubarTests | ||