Skip to content

feat(chat,examples-chat): catalog v1 prop additions + theme cascade fix (smoke pass)#237

Merged
blove merged 2 commits into
mainfrom
claude/a2ui-catalog-smoke-pass
May 10, 2026
Merged

feat(chat,examples-chat): catalog v1 prop additions + theme cascade fix (smoke pass)#237
blove merged 2 commits into
mainfrom
claude/a2ui-catalog-smoke-pass

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented May 10, 2026

Summary

Systematic live-smoke pass against the A2UI catalog using two new "kitchen sink" welcome suggestions designed to elicit LLM-generated surfaces that exercise all 18 components across two prompts. Pass uncovered 6 real bugs — 5 catalog components missing canonical v1 props, plus one cross-cutting theme-cascade specificity inversion.

Bugs found + fixed

Component v1-prop gaps (5 NG0303 runtime errors → 0)

Component Missing v1 prop(s) Behavior
`Image` `fit`, `usageHint` Added inputs; `usageHint` maps to a sizing preset (max-width / aspect-ratio / border-radius for the avatar circle); `fit` passes through to CSS `object-fit`
`Icon` `name` (canonical) Added as canonical input alongside the pre-v1 `icon` alias resolved via `effectiveName` computed
`AudioPlayer` `description` Added input + caption rendered above the audio control
`List` `alignment` (start/center/end/stretch) Added input mapped to flex `align-items`
`CheckBox` `value` (canonical) Added as canonical input alongside the pre-v1 `checked` alias resolved via `effectiveValue` computed; emit-binding uses `value` when surface declares that path

Theme cascade specificity inversion

`:host` `--a2ui-*` defaults on `` won over inherited `:root[data-theme=...]` overrides because the host element is closer to the rendered children than `:root` in the CSS custom-property inheritance chain. Setting `:root[data-theme=material-light] { --a2ui-primary: #6750A4 }` had no effect — the surface kept the lib's default `#4f8df5`.

Fix: moved the ~50-token defaults block from `surface.component.ts` `:host` into `libs/chat/src/lib/styles/chat.css` `:root`. Cascade now works:

  1. `:root` in `chat.css` — lib defaults (lowest)
  2. `:root[data-theme=...]` from preset — overrides the lib defaults (slightly higher specificity)
  3. `` host inline-style binding — agent's `beginRendering.styles.primaryColor` overrides per-surface (highest, inline)

New welcome suggestions

  • "Smoke: media + layout kitchen sink" — exercises Card, Tabs, Column, Row, List, Divider, Text, Image, Icon, Video, AudioPlayer (11 components)
  • "Smoke: interactive form kitchen sink" — exercises Card, Column, TextField, Slider, CheckBox, DateTimeInput, MultipleChoice, Divider, Row, Button, Modal (11 components, with overlap)

Together they cover all 18 catalog components when the LLM honors the prompts. Intended as the canonical smoke triggers for catalog regression testing.

Test plan

  • `nx run-many -t test,lint,build -p chat,examples-chat-angular` — all green
  • Live verified post-fix: Material light theme correctly applies (`--a2ui-primary = #6750A4`, surface = `#FFFBFE`), all 18 components render with proper labels and styling, zero NG0303 console errors. Screenshots show: bold "Profile setup" Card title, M3 purple Slider/Save button, M3 outline "Open details" secondary button, all CheckBox + MultipleChoice labels visible, Divider, DateTimeInput.

🤖 Generated with Claude Code

…ix (smoke pass)

Live smoke against two new "kitchen sink" welcome suggestions
("Smoke: media + layout kitchen sink", "Smoke: interactive form
kitchen sink") uncovered six real bugs covering five catalog
components + one cross-cutting theme-cascade specificity issue:

1. Image — missing v1 props `fit` (CSS object-fit equivalent) and
   `usageHint` (sizing preset: icon | avatar | smallFeature |
   mediumFeature | largeFeature | header). Added inputs with a usage-
   hint → CSS-style mapping (max-width, aspect-ratio, border-radius
   for the avatar circle).

2. Icon — missing v1 canonical `name` prop. Added as the canonical
   input + kept `icon` as a back-compat alias resolved by an
   `effectiveName` computed.

3. AudioPlayer — missing v1 `description` prop. Added input + a small
   caption rendered above the audio control.

4. List — missing v1 `alignment` prop (start | center | end | stretch).
   Added input mapped to flex `align-items` (start/end translated to
   flex-start/flex-end CSS values).

5. CheckBox — missing v1 canonical `value` prop. Added as canonical
   input, kept `checked` as back-compat alias resolved by an
   `effectiveValue` computed. Emit-binding uses `value` when the
   surface declares that path, falling back to `checked`.

6. Theme cascade specificity inversion. `:host` `--a2ui-*` defaults on
   `<a2ui-surface>` won over inherited `:root[data-theme=...]`
   overrides because the host is closer to the rendered children in
   the inheritance chain than `:root`. Result: setting
   `:root[data-theme=material-light] { --a2ui-primary: #6750A4 }` had
   no effect — the surface kept the lib's `#4f8df5`. Fix: moved the
   ~50-token defaults block from surface.component.ts `:host` into
   chat.css `:root`. Now `:root[data-theme=...]` preset overrides
   land at the same selector with attribute-selector specificity
   bump and win the cascade. The agent's host inline-style binding
   (`[style.--a2ui-primary]="primaryColor()"`) still wins per-surface
   for the v1 spec's `beginRendering.styles.primaryColor` knob.

Adds two new welcome suggestions ("Smoke: media + layout kitchen
sink", "Smoke: interactive form kitchen sink") that systematically
exercise all 18 catalog components across two prompts, intended as
the canonical smoke triggers for catalog regression testing.

Verified live: post-fix Material light theme correctly applies
(--a2ui-primary = #6750A4, surface = #FFFBFE), all 18 components
render with proper labels and styling, zero NG0303 console errors.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cacheplane Ready Ready Preview, Comment May 10, 2026 5:08pm

Request Review

@blove blove merged commit 6d9a161 into main May 10, 2026
14 checks passed
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.

1 participant