fix(runtime): an unset or zero radius projects square corners - #79
Conversation
Weaver mapped an unset radius to null when projecting a painted box, and Native SDK reads null as "use the theme radius" (smallest token: 6px). A zero radius took the same branch, so rounded-[0px] could not turn it off. On a card nobody notices; on a 14px progress segment every boundary scallops, which two agents saw in the cadence experiment and one redesigned around. The contract's model is CSS: no rounded utility means square corners. Pass retained.radius through whenever it is non-negative; the tree default is 0. Receipts: five shipped examples (clock, pomodoro, weather, system, now-playing) re-captured with this binary against a baseline built from the same commit are pixel-identical, 0 changed of 332,720. A probe of 20 gapless 8px segments goes from a per-column profile of 4,6,8…8,6,3 at every seam to a flat 8. New runtime test pins radius 0 for a painted box with no rounded utility and for rounded-[0px]. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Greptile SummaryPainted boxes now preserve a zero radius when lowered to the Native SDK. Boxes with no rounding utility and boxes using The portable runtime test suite passed with 89 tests passing and 2 skipped. Focused coverage confirms that both the retained default and an explicitly authored zero radius reach the Native widget style as an explicit Confidence Score: 5/5Safe to merge: the changed rendering behavior is covered by passing runtime tests and direct projection assertions. The retained default, zero-value normalization, Native optional-radius projection, and painted-box lowering path were checked. The portable Zig runtime suite and focused zero-radius regression both completed successfully. Files Needing Attention: No follow-up changes are needed. Native-host rendering could not be exercised on Linux, but the runtime’s Native widget projection is directly asserted by the portable test coverage.
What T-Rex did
Reviews (2): Last reviewed commit: "Merge remote-tracking branch 'origin/mas..." | Re-trigger Greptile |
…ault # Conflicts: # runtime/src/main.zig
What
A painted box with no
rounded-*utility was getting Native SDK's theme radius (6px at the smallest), because Weaver projected an unset radius asnulland Native readsnullas "theme default".rounded-[0px]hit the same> 0test and was treated as unset too. Result: every small painted box has ~2px scalloped corners that no class can remove. Two Opus agents in the cadence experiment saw it on gapless progress segments; one redesigned its bar into a tick meter because of it.Fix is one comparison: pass the retained radius through when it is
>= 0. The tree's default is 0, so "no utility" now means square, as the contract's CSS model implies. Contract table gains the row.Receipts
Shipped examples are pixel-identical. Same widget sources, same fixtures, same clock, two runtime binaries from the same commit differing only in this line:
Every example specifies its radii; nothing relied on the theme default.
Probe. 20 gapless 8px
growsegments in a track. Per-column accent height on master:468888888888863468888888888863…(each seam loses rows). With this change:8888888888888888…. Same result forrounded-[0px]segments, for no radius class, and for fixedw-[14px]segments.Runtime test
painted boxes without a rounded utility project square corners, not the theme radius.zig build test: 89 passed, 1 skipped.Not in this PR
The other two open items from the experiment (a supported route for data-driven widths, and
npx --no-install weaveroutside the repo tree) are real decisions; evidence and options are written up in the experiment folder for Dara.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.