Skip to content

spec(v1.0)!: Remove redundant heading variants from Text component#1668

Open
gspencergoog wants to merge 3 commits into
a2ui-project:mainfrom
gspencergoog:remove-header-variants-v1.0
Open

spec(v1.0)!: Remove redundant heading variants from Text component#1668
gspencergoog wants to merge 3 commits into
a2ui-project:mainfrom
gspencergoog:remove-header-variants-v1.0

Conversation

@gspencergoog

Copy link
Copy Markdown
Collaborator

Summary

This pull request removes the redundant h1, h2, h3, h4, and h5 heading variants from the Text component's variant field in both the basic and minimal catalogs for the v1.0 specification. Heading variants are redundant because the Text component natively supports Markdown formatting, and having both options can lead to confusing and conflicting UI states.

Changes

  • Schema Updates:
    • Removed "h1", "h2", "h3", "h4", and "h5" from the allowed enum values for the Text component's variant property in specification/v1_0/catalogs/basic/catalog.json and specification/v1_0/catalogs/minimal/catalog.json.
  • Example Catalog Payloads:
    • Updated all JSON example files in specification/v1_0/catalogs/basic/examples/ and specification/v1_0/catalogs/minimal/examples/ (38 files total) to use Markdown formatting instead of h1-h5 variants. For dynamic function call outputs, the variant field was removed.
  • Tests:
    • Updated specification/v1_0/test/cases/text_variants.json to replace the valid h1 test case with caption, and added a test case asserting that h1 is now invalid.
    • Updated specification/v1_0/test/cases/contact_form_example.jsonl to remove the redundant variant: h2 configuration from the title Text component.
  • Documentation:
    • Updated specification/v1_0/docs/basic_catalog_implementation_guide.md to remove documentation regarding heading variant sizes and mappings.
    • Updated the example JSONL payload in specification/v1_0/docs/a2ui_protocol.md to remove the redundant variant property.

Impact & Risks

  • Breaking Change: Heading variants h1 through h5 are 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 the variant field (defaulting to standard body text).

Testing

  1. Run the specification test runner from the root of the repository:
    python3 specification/v1_0/test/run_tests.py
  2. Confirm that all 125 test cases pass, validating the catalog integrity, identifier rules, and test JSON cases.

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread specification/v1_0/catalogs/basic/examples/01_flight-status.json Outdated
Comment thread specification/v1_0/catalogs/basic/examples/04_weather-current.json
…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}"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants