Skip to content

fix(runtime): an unset or zero radius projects square corners - #79

Merged
SunkenInTime merged 2 commits into
masterfrom
fix/radius-zero-default
Sep 6, 2026
Merged

SunkenInTime merged 2 commits into
masterfrom
fix/radius-zero-default

Conversation

@SunkenInTime

@SunkenInTime SunkenInTime commented Sep 5, 2026 •

Copy link
Copy Markdown
Collaborator

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 as null and Native reads null as "theme default". rounded-[0px] hit the same > 0 test 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:

    Example Pixels changed
    clock 0 / 42,240
    pomodoro 0 / 103,200
    weather 0 / 67,840
    system 0 / 66,640
    now-playing 0 / 52,800

    Every example specifies its radii; nothing relied on the theme default.

  • Probe. 20 gapless 8px grow segments in a track. Per-column accent height on master: 468888888888863468888888888863… (each seam loses rows). With this change: 8888888888888888…. Same result for rounded-[0px] segments, for no radius class, and for fixed w-[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 weaver outside the repo tree) are real decisions; evidence and options are written up in the experiment folder for Dara.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

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-apps

greptile-apps Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

Greptile Summary

Painted boxes now preserve a zero radius when lowered to the Native SDK. Boxes with no rounding utility and boxes using rounded-[0px] receive square corners instead of inheriting the Native theme radius.

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 0.

Confidence Score: 5/5

Safe 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.

T-Rex T-Rex Logs

What T-Rex did

  • Validated that a retained node defaults radius to 0 and that Native projection forwards all non-negative radii as an optional value, and ran the portable Zig runtime suite with 89 tests passed and 2 skipped.
  • Confirmed that the authored radius property is retained as zero and only negative radius values become the -1 unset sentinel, with Native receiving 0 as an explicit optional float and negatives lowered to null; compared the portable runtime results before and after the change and ran the focused radius projection regression.
  • Documented the default retention and normalization in code paths and noted the provider socket deadline warning but a successful runtime with exit code 0.
  • Summarized the retention/normalization, projection, and Native type declaration checks, along with the regression assertion that zero remains an explicit value in the built state.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (2): Last reviewed commit: "Merge remote-tracking branch 'origin/mas..." | Re-trigger Greptile

@SunkenInTime
SunkenInTime merged commit bf2da4c into master Sep 6, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant