feat(check): allow a number-typed template hole as a pixel arbitrary value - #80
Conversation
…value
Every class had to resolve to at most 32 literal strings, so a width computed
from data had no route; the error named the cap and nothing else. Twenty
agents building one progress bar produced six workarounds, including
21-branch ternary ladders and semantic-less canvases.
check now accepts one dynamic shape: a template hole that is the number of a
pixel arbitrary value, `w-[${px}px]`, when TypeScript types the hole as a
number. The utility prefix and `px]` suffix stay literal, so every utility is
still validated statically; the number is validated by the same class
compiler when the widget runs (about 6 µs per change, measured), and a bad
value fails the widget onto its error surface with the utility named. A hole
anywhere else, or a string-typed hole, is rejected with a message that names
the rule and the three routes (pixel hole, fraction utility, canvas). The
generic cap message now names those routes too.
The project program that the media-capability check already built is shared
with the class walk, so this adds no second type-check pass.
Receipts: cli tests for the accepted shape and three rejected shapes; a new
capture smoke fixture whose fill is `w-[${sessions * 14}px]` moves from 0 to
42 logical pixels across three clicks, checked in the snapshot and pixels.
npm test 119 passed; capture smoke passed.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Greptile SummaryThis change allows widget class templates to use a number-typed interpolation for the numeric portion of a static pixel utility, such as The class-hole capture fixture cannot render on the available Linux null backend: both the initial state and the three-click state stop with T-Rex validation blockedA supported native rendering backend is unavailable in this environment. The available Linux null backend was built and retried, but it reports Confidence Score: 3/5The CLI boundary is verified, but merge safety depends on confirming the rendered state update on a supported native backend. Temporary fixtures exercised successful numeric validation and rejection of malformed and non-numeric forms. The visual regression fixture could not produce either baseline or post-click output because rendering stopped with Files Needing Attention: Verify
What T-Rex did
|
| return ( | ||
| <column class="p-3 gap-2 bg-[#11141c]"> | ||
| <row class="w-full h-[8px] rounded-full bg-[#ffffff]/10"> | ||
| <stack class={`w-[${sessions * 14}px] h-full rounded-full bg-[#5eead4]`} /> |
There was a problem hiding this comment.
Class-hole fixture cannot render
The capture fixture that is meant to prove w-[${sessions * 14}px] updates after interaction does not render on the available Linux null backend. Both the baseline capture and the three-click capture fail with UnsupportedViewKind before emitting a frame or accessibility snapshot, so the expected 0px-to-42px width transition is not covered by an executable regression check in this environment.
|
Re the Greptile P1: the block is T-Rex's Linux host, not the fixture. The null platform reports Receipts on this commit (f301c2d), macOS headless capture, Weaver
|
Stacked on #78 (shares the capture smoke). Merge #78 first; this PR's base then moves to master.
What
weaver checkrequires everyclassto resolve to at most 32 literal strings so it can validate every utility before the widget runs. A width computed from data had no route, and the error named the cap and nothing else. In the render-loop cadence experiment, all twenty agents building the same progress bar needed exactly this and produced six workarounds:<canvas>(14), 21-branch ternary ladders (3), a fraction table, a gradient hard stop, a tick meter.This adds the one dynamic shape that keeps static validation intact: a number-typed template hole as the number of a pixel arbitrary value.
w-[) and suffix (px]) are literal, so check still knows the utility and validates it with a placeholder number.numberby TypeScript. Check already built a program for the media-capability check; it is now built once per project and shared, so there is no second type-check pass.UtilityErrorand fails the widget onto its error surface.<canvas>.Contract gains an amendment describing the rule.
Receipts
w-[${sessions * 14}px]with auseState<number>; rejected string hole, whole-utility hole, percent hole, each asserting the specific message and the routes sentence. Existing "must resolve to at most 32" tests unchanged and passing.test/fixtures/class-hole: the fill's snapshot bounds are0x8initially and42x8after three clicks on "Log" throughtest/capture/log-three.actions, and the accent pixel count rises.npm test119 passed.npm run test:capturepassed.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.