Uh oh!
There was an error while loading. Please reload this page.
Feature: Component.description - #375
Open
nathanacurtis wants to merge 2 commits into
Open
Conversation
Component.description — the authored Figma description, plain text and opt-inComponent.description
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 freeto 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.
Draft ADR responding to #374 — carrying a Figma component's authored description into the spec.
Status is
DRAFT. This records a proposal and the reasoning behind it; it is not a commitment to accept.What it decides
Three separate decisions, each with its own options section:
Component.description, sibling totitle. Rejectedmetadata.source.description(provenance is not documentation, andSubcomponentdropsmetadata),$extensions['com.figma'](the value is platform-neutral documentation, not a Figma-only concept), andadditionalProperties: true(surrenders the closedComponentdefinition thatSubcomponent's draft-07allOfcomposition depends on).descriptionanddescriptionMarkdown; the REST file response exposes only the plain form. A markdown field would make the CLI and the plugin emit different output for the same component.spec.descriptionsetting, defaultfalse— every existing run stays byte-identical, and a library opts in knowingly. Same shape asdefaultSlotContent(ADR-050). A length cap or truncation was rejected as lossy and arbitrary.The field is fixed as opaque text — carried, never interpreted. No consumer may parse structure out of it.
Why the gate
The Context section works through what libraries actually put in that box:
There is enough implicit structure to tempt a parser and never enough to justify one. And the readability cost is real: an unbounded block scalar at the top of every
api.yaml, where an editorial reword in Figma reads as a change to the component's API. That is a default problem, not a contract problem — hence declare the property, make the run ask for it.Change inventory
types/Component.tsdescription?: stringtypes/Settings.tsspec.description?: boolean, required onResolvedSettings,falseinDEFAULT_SETTINGSschema/component.schema.jsondescriptionunder#/definitions/Component/properties; definition stays closedschema/settings.schema.jsonspec.descriptionboolean, defaultfalseSubcomponentneeds no change — it inherits the field throughOmit<Component, …>.Semver:
0.31.0, MINOR — additive optional fields only.Refs #374