fix(core,cli): parent-relative figma child geometry; groups stop rejecting subcommand flags#2063
Open
vanceingalls wants to merge 1 commit into
Open
fix(core,cli): parent-relative figma child geometry; groups stop rejecting subcommand flags#2063vanceingalls wants to merge 1 commit into
vanceingalls wants to merge 1 commit into
Conversation
…cting subcommand flags Both found running the brand-loop guide end-to-end against the Simple Design System: - nodeToHtml subtracted the ROOT origin from every node's absolute bounds, but CSS absolute positioning resolves against the nearest positioned ancestor — every nesting level re-added its ancestors' offsets, drifting nested content down-right and pushing deep children off-frame (hero buttons invisible, pricing grid collapsed to one card). Children now subtract their PARENT's box; regression test with a two-level tree. - trackCommandFailures asserted unknown flags against the command group's own (flagless) arg table even when the group was delegating to a subcommand, so `figma component <ref> --name x` imported and THEN threw "Unknown flag: --name". The assertion is now skipped when the first positional names a subcommand; leaf and non-delegating behavior is unchanged and covered by tests. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Both bugs surfaced while executing the brand-loop guide end-to-end against Figma's Simple Design System (follow-up to #2053).
1. Figma mapper: nested children were positioned root-relative
nodeToHtmlsubtracted the ROOT frame's origin from every node's absolute bounds. CSS absolute positioning resolves against the nearest positioned ancestor, so every nesting level re-added its ancestors' offsets — nested content drifted down-right and deep children left the frame entirely. On real SDS frames: hero buttons invisible, three-card pricing grid collapsed to a single off-center card.Children now subtract their parent's box. Regression test with a two-level tree asserts parent-relative coords and rejects the double-offset values.
Before/after on the same SDS import (Hero Actions, Card Grid Pricing):
2. CLI: command groups rejected their subcommands' flags
trackCommandFailuresrunsassertKnownFlagson every wrappedrun. A command group likefigma(subCommands + fallback-help run) asserted the raw args against its own flagless table, sohyperframes figma component <ref> --name xcompleted the import and THEN threwUnknown flag: --name. The check is now skipped when the first positional names a subcommand; leaf commands and non-delegating group invocations still reject unknown flags (all covered by new tests).Validation
🤖 Generated with Claude Code