ADR-081: A default example width on conventions.figma - #371
Closed
nathanacurtis wants to merge 2 commits into
Closed
ADR-081: A default example width on conventions.figma#371nathanacurtis wants to merge 2 commits into
conventions.figma#371nathanacurtis wants to merge 2 commits into
Conversation
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Adds an optional positive number to the `figma` conventions block stating the pixel width a library's components and examples are authored at, and the width consumers render them at by default. Absent means the library declares no width and each consumer falls back to its own. - schema: `Conventions` / `ResolvedConventions` field and its schema property - cli: loader resolution, `conventions.yaml` init template, tests - docs: settings page, sidebar entry, conventions table row Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Member
Author
|
Closing unmerged. This belongs on |
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.
Adds
conventions.figma.defaultExampleWidth— an optional positive number stating the pixel width a library's components and examples are authored at, and the width consumers render them at by default.Why
Anything that renders a spec has to pick a width first — a Figma frame written back from a spec, a generated story canvas, a screenshot harness. Nothing in the spec says which, so each consumer invents one. For a library authored at a mobile width the results diverge from the design: a fill-width root stretches across a desktop canvas, and text that wraps to two lines renders on one.
That width is not a per-run preference. It is a fact about how the library was authored — the same number for every consumer, where a different value produces output that misrepresents the design rather than merely styling it differently. That is the test ADR-071 used to separate
ConventionsfromSettings, so it lands onConventions.figma.What changed
packages/schemaConventions.figma.defaultExampleWidth?: numberand itsResolvedConventionscounterpartconventions.schema.json—defaultExampleWidthwithexclusiveMinimum: 0DEFAULT_CONVENTIONS— there is no universal width, and absence is the statement that a library declares nonepackages/cliConfigLoaderresolves the key, dropping anything that is not a finite positive numberconfig/conventions.yamlinit template carries it commented out with375as the samplesitesettings/default-example-widthpage, sidebar entry, and a row in theschema/conventionstableSemver
0.31.0— MINOR. One optional field on an existing interface, one optional property on an existing schema object. Every document valid before remains valid.Downstream
Documented in the ADR, not done here:
specs-from-figma,figma-from-specsandspecs-plugin-2should use the declared width as the default frame width when rendering, and keep their current hardcoded value only as the absent-case fallback.Notes
DRAFT; run/specs.adr.acceptafter review.adr/INDEX.mdclaims 081 on this branch only. The cherry-pick ontomainand the release branch is not done — it needs a push tomain.packages/cli/testsfail in a clean worktree (DEFAULT_SETTINGSresolves toundefinedthrough the workspace link). Identical count before and after this change — pre-existing, untouched here.🤖 Generated with Claude Code