Skip to content

fix(chat): a2ui catalog layout polish (component-scoped CSS)#230

Merged
blove merged 3 commits into
mainfrom
claude/fix-a2ui-catalog-layout-polish
May 10, 2026
Merged

fix(chat): a2ui catalog layout polish (component-scoped CSS)#230
blove merged 3 commits into
mainfrom
claude/fix-a2ui-catalog-layout-polish

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented May 10, 2026

Problem

All 18 @ngaf/chat a2ui catalog components used Tailwind utility class strings (flex flex-col gap-1, text-3xl font-bold, rounded-lg px-3 py-2, bg-blue-600, etc.) in their templates. This workspace has no Tailwind compiler configured — no tailwind.config.*, no @tailwind directives — so every one of those class names was silently inert. The result was visible layout breakage in every rendered surface:

  • TextField / Slider / DateTimeInput / MultipleChoice: label and input rendered on the same line (no flex-column wrapper), no padding or border-radius on the input
  • Text: h1h5 headings rendered as inline <span> at body font size; no block display, no size, no weight
  • Column / Row / List: flex layout + gap never applied
  • Card: no border, no padding, no background
  • Button: no padding, no background, invisible
  • Tabs: tab strip lost all padding, border, and active-state indicator
  • Modal: overlay/panel positioning and backdrop lost

Solution

Added an Angular styles: [...] block to each @Component decorator — no new dependencies, no toolchain changes. Each component now carries its own BEM-style component-scoped CSS that reproduces the intended layout:

  • TextField, Slider, DateTimeInput, MultipleChoice: display:flex; flex-direction:column; gap:4px wrapper; full padding/border/border-radius/focus state on inputs
  • Text: block display per usageHint with correct font-size + font-weight for h1h5, muted color for caption, readable line-height for body
  • Column / Row: convert the numeric gap and alignment inputs to real CSS via [style.gap.px] / [style.align-items] / [style.justify-content] bindings (Tailwind's gap-N shorthand was not resolvable at runtime)
  • List: two named classes (a2ui-list--vertical / a2ui-list--horizontal) replacing the computed Tailwind string
  • Card: rounded border + padding + background via --a2ui-card-bg CSS variable
  • Button: visible primary/secondary states with hover, padding, border-radius, disabled opacity
  • Tabs: tab strip with bottom-border indicator, active colour, hover state, panel padding
  • Modal: fixed overlay + backdrop blur + panel sizing via real CSS classes
  • CheckBox, Icon, Image, Audio, Video, Divider: simpler layout fixes (block/inline-flex, width:100%, border rules)

All --a2ui-* CSS variables from the existing palette (--a2ui-primary, --a2ui-border, --a2ui-label, --a2ui-input-bg, --a2ui-input-text) are reused as fallback defaults throughout.

Verification

npx nx run-many -t test,lint,build -p chat --skip-nx-cache
# NX   Successfully ran targets test, lint, build for project chat and 4 tasks it depends on

Components touched

Component Change
audio-player w-full.a2ui-audio { display:block; width:100% }
button Full primary/secondary styles with padding, border-radius, hover, disabled
card flex-column wrapper with border, background, padding, border-radius
check-box flex-row label+checkbox with gap and accent-color
column Replaced computed Tailwind string with [style.align-items] + [style.gap.px]
date-time-input flex-column + styled label + full input padding/border/focus
divider border-white/10 → real border-top / background CSS
icon inline-flex items-center justify-center select-none → component CSS
image max-w-full rounded → component CSS
list Replaced computed Tailwind string with two named CSS classes
modal Fixed overlay, backdrop, panel, title with real position/layout CSS
multiple-choice flex-column + label + styled select + checkbox list with gap
row Replaced computed Tailwind string with [style.justify-content] + [style.align-items] + [style.gap.px]
slider flex-column + label + width:100% range with accent-color
tabs Tab strip with border, active indicator, hover state, panel padding
text-field flex-column + label + input/textarea with full padding/border/focus
text Block display per usageHint; font-size/weight/line-height for h1–h5, caption, body
video w-full rounded-lg → component CSS

🤖 Generated with Claude Code

Replace inert Tailwind utility class strings with Angular component-scoped
styles: blocks on all 18 a2ui catalog components. No Tailwind compiler is
configured in this workspace so those class names were silently ignored,
causing visible layout breakage (label+input running together, headings
rendering inline at body size, Column/Row/List/Card having no flex gap, etc.).

Each component now carries its own BEM-style CSS that faithfully reproduces
the original layout intent: flex-column wrappers with 4px gap on TextField,
DateTimeInput, Slider, MultipleChoice; flex-row on Row; flex-column on Column
and List; padding/border/radius on all input-like elements; block-level
display and correct font-size/weight hierarchy on Text h1-h5/caption/body;
visible padding and hover states on Button; border+padding on Card and Modal.
Column and Row convert the numeric `gap` and `alignment` inputs to real CSS
via inline [style] bindings rather than gap-N Tailwind shorthand.

Co-Authored-By: Claude Sonnet 4.6 <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 4:32am

Request Review

@blove blove merged commit 1628924 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