fix(codegen): center lone in-flow space-between children - #46
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Figma centers the only in-flow child of a
SPACE_BETWEENauto-layout. CSS flexbox has nothing to space between and parks that child at the start. Every such node was therefore generated in the wrong place - this is a general mismatch between the two layout models, not a property of any one design.The
keyframesscreen made it visible because it is 64px across and built from single-dot wrappers: a 2px dot Figma draws atx=5inside a 12px box was drawn atx=0. The same wrappers recur on the notice desktop frame, which is why that improved too without being targeted.Every other screen is byte-identical.
The condition
Horizontal or vertical layout,
primaryAxisAlignItems == SPACE_BETWEEN, and exactly one child that is both visible and not absolutely positioned - hidden and absolute children take no part in distribution and must not be counted. No node id, no viewport, no breakpoint, no constant fitted to this capture.The source map gains
derived-lone-child-centerrather than reusing an existing label, and its published description says which fields decide the count and that this is a layout-semantics correspondence, not a claim of pixel parity.A theory retired with evidence
This screen was assumed to be unmeasurable because it animates and Figma's reference is a still. That is false: the harness
index.htmldisables animations, the capture shows zero active animations, and the divergence is entirely static. The emitted root translation was also checked against the plugin'sgetReactionPropsanswer and matches.docs/keyframes-static-alignment.mdrecords this, so nobody re-runs that theory.What remains
110 pixels, all circle edges. The report names fractional paint origins and edge coverage as the next lead rather than guessing. No threshold was moved for it.
Verification
Measured independently in the main checkout with binaries built from
mainand from this branch, full 15-screen acquire and render on each side. My figures match the worker's to the decimal.All 268 plugin byte-parity goldens unchanged. Korean
keep-alluntouched. Only the two measured thresholds lowered.Gates:
fmt0,clippy --locked --workspace --all-targets --all-features -D warnings0,cargo test --workspace1074 passed / 0 failed / 2 ignored,insta --checkno drift.Process note
The first pass on this screen ended in a failed outcome because the worker asked whether a layout-field fix was in scope - my spec had scoped it to animation fields - and my reply did not arrive across two ten-minute waits. That is the second time this cycle. The follow-up spec now pre-authorises any fix that is proven from collected node data, general rather than capture-specific, and outside the off-limits list, so a worker no longer has to block on me for the answer that has been yes every time.