fix(runtime): pin the Native SDK wrap-budget fix for content-sized labels - #75
Conversation
…bels
Content-sized <text> labels at fractional positions wrapped their last
glyph ("Star" / "t" in pomodoro, "fixtur" / "e" in noro-signal). Geometry
pixel snapping rounds each frame edge on its own and can shave a whole
device pixel off a label sized exactly to its text, but the Native SDK's
wrap budget only handed back half of that. SunkenInTime/native#33 hands
back the full pixel; this pins that commit (464ff65f).
test/fixtures/text-wrap places five exact-fit labels at fractional
positions, and the capture smoke asserts one laid-out line per text node
for it and for noro-signal, so a regression shows up as line count, not as
a pixel diff someone has to notice.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Greptile SummaryThis change pins the Native SDK text-measurement correction and adds coverage for labels whose width is exactly their measured text. The release audit rejected a real alternate Native SDK commit and passed after the reviewed commit was restored. The new Text Wrap fixture compiled and rendered with five text nodes and five layout lines. T-Rex validation blockedThe Noro Signal capture could not run on this Linux host because the required Confidence Score: 4/5The dependency pin and the dedicated exact-fit label fixture behave as intended in the available native runtime. The release guard was exercised in both rejection and acceptance paths, and the new fixture rendered with one layout line per text node. The Noro Signal assertion could not be executed on its supported native renderer in this environment. Files Needing Attention: Run
What T-Rex did
Reviews (1): Last reviewed commit: "fix(runtime): pin the Native SDK wrap-bu..." | Re-trigger Greptile |
Defect
Content-sized
<text>labels at fractional positions wrapped their last glyph: "Star" / "t" on the pomodoro's main button, "fixtur" / "e" in noro-signal's source label, chip labels in the pomodoro mode row. Reproduced at master on the macOS headless capture path.Root cause
Geometry pixel snapping rounds each frame edge on its own, so a label sized exactly to its measured text can lose up to one whole device pixel at render time. The Native SDK's wrap budget (
textWrapMaxWidth) only handed back half a pixel. Receipt from instrumentation: a 34.77px "Start" paragraph sat at x = 92.62, snapped to [93, 127] (34px), and wrapped against a 34.5px budget.Earlier hypotheses (CoreText measurement APIs disagreeing, ulp drift between intrinsic sizing and the line breaker) were measured and ruled out: both CoreText APIs agree to the ulp on the bundled Geist face.
Fix
1/scale) and adds a regression test that replays the receipt through a mock measurement provider for both a plain label and a span paragraph; it fails on the old budget with two emitted runs.464ff65f) inruntime/native-sdkand the release audit.test/fixtures/text-wrapplaces five exact-fit labels at fractional positions; the capture smoke asserts one laid-out line per text node for it and for noro-signal.Verification (macOS, Zig 0.16.0)
zig build testandzig build test -Dwidget-profile=truepass on the pinned commit.npm run typecheck,npm test(fail 0),node cli/test/example-surface-smoke.mjs,npm run test:capture,npm run audit:releaseall pass with the rebuilt runtime.Note: the fork PR is still open; the pin references its branch commit, matching how 9a499f16 was pinned before its merge.
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.