Skip to content

fix(chat): library polish — bubble width, chat.css drop, a2ui light variant, a11y#313

Merged
blove merged 9 commits into
mainfrom
chat-lib-polish
May 14, 2026
Merged

fix(chat): library polish — bubble width, chat.css drop, a2ui light variant, a11y#313
blove merged 9 commits into
mainfrom
chat-lib-polish

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented May 14, 2026

Summary

Second in a three-PR sequence (spec: `docs/superpowers/specs/2026-05-13-chat-lib-polish-design.md`, plan: `docs/superpowers/plans/2026-05-13-chat-lib-polish.md`).

  • User-bubble text-wrap fix: add `width: fit-content` to `.chat-message__bubble`. Bug: `max-width: 80%` only capped growth while a flex parent allowed shrink below intrinsic width — "hello" rendered as "hel" / "lo".
  • Drop `libs/chat/src/lib/styles/chat.css` (the global stylesheet). `ensureChatRootStyles()` auto-injects every `--ngaf-chat-` and `--a2ui-` token via a `@layer ngaf-chat`-wrapped `<style>` on first chat-component load, so `chat.css` was a drift-prone duplicate. Breaking for external consumers; two internal consumers (`examples/chat/angular`, `examples/chat/smoke/template`) updated in this PR.
  • `--a2ui-*` namespace migration: ~30 tokens previously declared only in `chat.css` move into `chat-tokens.ts` (auto-injected) with split theme-variant + invariant blocks. Adds a `prefers-color-scheme: light` / `[data-theme="light"]` variant — previously dark-only, `` rendered white-on-near-black on light pages.
  • Drop hardcoded `#16a34a` fallback at `chat-message-actions.styles.ts:69` — token is always defined by auto-injection.
  • Add `:focus-visible` ring to `.chat-message__control-btn` — keyboard a11y hole on regenerate/copy/rate controls.
  • `modal.component.ts` a11y + cleanup: move inline `style="display:contents"` to a styles-array class; add `aria-label="Open modal"` to the `role="button"` trigger.

PR 3 (cockpit ↔ website style alignment + chat lib palette unification with `--ds-*`) follows.

Test plan

  • `pnpm nx run-many -t lint,test -p design-tokens,ui-react,example-layouts,chat,cockpit` — green
  • `pnpm nx e2e cockpit` — green (6/6 locally)
  • `pnpm nx build website` — green
  • `pnpm nx build cockpit-chat-timeline-angular` — green
  • `pnpm nx build examples-chat-angular` — green
  • Manual chrome MCP smoke on this PR's preview: "hello" bubble width matches text; a2ui surfaces don't render white-on-near-black in light mode

🤖 Generated with Claude Code

blove and others added 9 commits May 13, 2026 20:36
Second in the cockpit dark mode polish series. Fixes the user-bubble
text-wrap bug (max-width without fit-content), drops the duplicate
chat.css token block in favor of chat-tokens.ts auto-injection, migrates
the --a2ui-* namespace into the auto-injection path with a light
variant (currently dark-only / broken in light mode), and closes two
small a11y holes (control-btn focus ring, modal aria-label).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 14, 2026

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

Project Deployment Actions Updated (UTC)
cacheplane Ready Ready Preview, Comment May 14, 2026 4:16am

Request Review

@blove blove merged commit 8d0f562 into main May 14, 2026
16 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