Skip to content

fix(chat): correct the A2UI theme presets and accent contrast, and add them to React - #1606

Queued
blove wants to merge 2 commits into
mainfrom
blove/react-a2ui-theme-presets
Queued

blove wants to merge 2 commits into
mainfrom
blove/react-a2ui-theme-presets

Conversation

@blove

@blove blove commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

What

Corrects the A2UI theme presets in the Angular chat library, fixes a contrast failure in the default A2UI accent, and adds the same four presets to React.

What was wrong (libs/chat/src/themes)

  • default-light.css had drifted from the chat's own A2UI tokens: four colours and four shadows differed, so importing the "default" preset changed how surfaces looked.
  • The dark presets set no shadows, so a dark preset on a light page kept light-scheme shadows.
  • The default accent failed the chat UI guide's 4.5:1 rule: white on #4f8df5 is 3.25:1 as button text, and #4f8df5 on the light surface is 3.11:1 as link text.
  • The headers called the files chat themes. They only set --a2ui-* tokens for agent-rendered surfaces; the chat's --tplane-chat-* colours never change. They also described :host defaults and a message field that no longer exist.
  • Three example apps inlined copies of the drifted values.

Changes

Angular

  • The default accent is now #2f6fed with white text in light (4.55:1), and #8ab4ff with #0b1220 text in dark (8.96:1). These are the values the React A2UI stylesheet already used. This is a visible change to every default A2UI button, link and choice chip.
  • The four presets are regenerated: the two defaults repeat the chat's canonical values exactly, every preset sets the full colour and elevation set, and the headers say what the files do and do not change. The Material presets stay A2UI-only and no longer repeat shape values that equal the defaults.
  • New chat-theme-presets.spec.ts fails when a default preset drifts from the canonical tokens, when a preset leaves a scheme-dependent token (or one a component reads) unset, when presets disagree on their token set, or when button, body, link or error text is below 4.5:1 for the chat defaults or any preset.
  • chat.css comment, the chat UI guide's gap list and the three example stylesheets are brought in line.

React

  • New @threadplane/react/a2ui/themes/{default-light,default-dark,material-light,material-dark}.css, exported and packaged. Each is one rule scoped to .a2ui-surface that outranks the base stylesheet, so import order does not matter, and sets color-scheme so native controls match.
  • The default pair repeats the base stylesheet's own light and dark values. A spec holds that, the token set, the scoping and the packaging.

Verification

  • Browser, real token stylesheet plus each preset on a sample card, on light and dark pages: before the fix, default-light differed from no preset and the dark presets kept light shadows; after it, the default presets compute identically to no preset and every preset holds all its tokens on both pages. React themes apply in either import order, hold under a dark system scheme, and an inline agent primary colour still wins.
  • Mutation checks: restoring one drifted value fails the drift guard; restoring the old blue fails the contrast guard.
  • npx nx run-many -t test,type-tests,lint -p react,chat, and builds of core,content,angular,react,chat: pass.
  • verify-packages.mjs, inventory.mjs --check --drift warn, and the 169 verifier spec tests: pass.
  • Not checked: the presets inside a running Angular app with real A2UI components. The button and choice-picker components pair the accent with --a2ui-on-primary, which I confirmed by reading their styles. The example apps were not run.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
threadplane Ready Ready Preview Nov 15, 2026 8:56pm UTC

Request Review

@blove
blove added this pull request to the merge queue Nov 16, 2026
Any commits made after this event will not be merged.

This branch was successfully deployed

1 active deployment
Preview – threadplane — ce0fc829 Deployed Nov 15, 2026 by vercel[bot]
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