spec(v1.0)!: Remove redundant heading variants from Text component#1668
spec(v1.0)!: Remove redundant heading variants from Text component#1668gspencergoog wants to merge 3 commits into
Conversation
Remove `h1`, `h2`, `h3`, `h4`, and `h5` as allowed enum values for the `Text` component `variant` field in basic and minimal catalogs. Since `Text` component supports Markdown, providing heading variants is redundant and can cause styling conflicts when both are used. Updated all tests, documentation, and example JSON payloads to use Markdown headers instead of the removed variants. BREAKING-CHANGE: Heading variants (h1-h5) are no longer accepted on the Text component in A2UI v1.0. Use Markdown formatting instead.
There was a problem hiding this comment.
Code Review
This pull request removes the heading variants (h1 through h5) from the basic and minimal catalog specifications, shifting heading styling to Markdown markers within the text. Corresponding examples, documentation, and test cases have been updated. The review feedback points out several examples where removing these variants disrupts the visual hierarchy or creates styling mismatches between static labels and dynamic values, and suggests using formatString to prepend Markdown heading markers to dynamic fields.
…ht-status and weather-current examples Address PR review feedback. Converted dynamic Text components in `01_flight-status.json` and `04_weather-current.json` to use `formatString` to prepend `#`, `##` and `###` heading hashes, maintaining the visual styling hierarchy now that heading variants are removed.
| "variant": "h2" | ||
| "call": "formatString", | ||
| "args": { | ||
| "value": "## ${/origin}" |
There was a problem hiding this comment.
Ahhh! I hadn't contemplated that formatString would become so much more important with this change, so you can inject static markdown into dynamic strings. I think it's okay though!
| "variant": { | ||
| "type": "string", | ||
| "enum": ["h1", "h2", "h3", "h4", "h5", "caption", "body"] | ||
| "enum": ["caption", "body"] |
There was a problem hiding this comment.
Hmmm it feels weird to me that we're using the "variant" property of text only to distinguish between "caption" and "body". I wonder if "primary" (typically black or white) and "secondary" (typically grey) might be more generic? Or even to remove the "variant" property entirely?
I don't feel strongly though. I think we will end up creating a new, finer grained transport-focused catalog at some point.
Summary
This pull request removes the redundant
h1,h2,h3,h4, andh5heading variants from theTextcomponent'svariantfield in both the basic and minimal catalogs for the v1.0 specification. Heading variants are redundant because theTextcomponent natively supports Markdown formatting, and having both options can lead to confusing and conflicting UI states.Changes
"h1","h2","h3","h4", and"h5"from the allowedenumvalues for theTextcomponent'svariantproperty inspecification/v1_0/catalogs/basic/catalog.jsonandspecification/v1_0/catalogs/minimal/catalog.json.specification/v1_0/catalogs/basic/examples/andspecification/v1_0/catalogs/minimal/examples/(38 files total) to use Markdown formatting instead ofh1-h5variants. For dynamic function call outputs, thevariantfield was removed.specification/v1_0/test/cases/text_variants.jsonto replace the validh1test case withcaption, and added a test case asserting thath1is now invalid.specification/v1_0/test/cases/contact_form_example.jsonlto remove the redundantvariant: h2configuration from the title Text component.specification/v1_0/docs/basic_catalog_implementation_guide.mdto remove documentation regarding heading variant sizes and mappings.specification/v1_0/docs/a2ui_protocol.mdto remove the redundantvariantproperty.Impact & Risks
h1throughh5are no longer accepted. Existing payloads that rely on"variant": "h1"(etc.) will fail validation under A2UI v1.0. Integrations should update payloads to use Markdown (e.g., prefixing text with#,##, etc.) or omit thevariantfield (defaulting to standard body text).Testing