Skip to content

fix(Chat): add missing themeProps and fix className clobber - #4634

Merged
cixzhang merged 2 commits into
mainfrom
fix/component-audit-2026-08-01
Aug 12, 2026
Merged

fix(Chat): add missing themeProps and fix className clobber#4634
cixzhang merged 2 commits into
mainfrom
fix/component-audit-2026-08-01

Conversation

@cixzhang

@cixzhang cixzhang commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix theming class handling in three Chat sub-components:

ChatSendButton — the themeProps('chat-send-button') className was overwritten by the explicit className prop passed to Button. When a consumer provided className, the astryx-chat-send-button targeting class was lost. Now uses mergeProps to concatenate both classNames before passing to Button.

ChatDictationButton, ChatLayoutScrollButton — these exported components lacked a themeProps call entirely. Themes had no stable class to target them. Added themeProps('chat-dictation-button') and themeProps('chat-layout-scroll-button') to their root elements using the existing mergeProps pattern.

Testing

  • pnpm build passes (0 errors)
  • All 171 Chat tests pass (vitest run packages/core/src/Chat/)

Night Watch — Component Auditor

…utton

ChatSendButton: the themeProps className was overwritten by a subsequent
explicit className prop, losing the astryx-chat-send-button targeting class
when consumers pass className. Use mergeProps to concatenate both.

ChatDictationButton, ChatLayoutScrollButton: add themeProps calls so
themes can target these components via their stable astryx-* class names.
@cixzhang cixzhang added the hardening Component hardening and quality sweep label Aug 1, 2026
@vercel

vercel Bot commented Aug 1, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
astryx Ready Ready Preview Aug 3, 2026 4:32pm

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Aug 1, 2026
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

Modified Components

Chat (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 5367 -
Complexity N/A Very High (438) -

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.9KB 1.3KB

Accessibility Audit

Status: 1 accessibility violation(s) found — 1 serious.

Chat - 1 issue(s)
  • 🟠 serious: Ensure the contrast between foreground and background colors meets WCAG 2 AA minimum contrast ratio thresholds
    • Rule: color-contrast · Affects 2/8 stories · Learn more
    • WCAG: 1.4.3 (Level AA)

Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

github-actions Bot added a commit that referenced this pull request Aug 1, 2026
@cixzhang
cixzhang merged commit 52992ae into main Aug 12, 2026
21 checks passed
cixzhang added a commit that referenced this pull request Aug 12, 2026
RichTextEditor's input wrapper spread `themeProps('rich-text-editor', ...)`
and then overwrote it with both `stylex.props(...)` and
`className={className}`. Each of those carries its own `className`, so React
kept only the last one: the stable `astryx-rich-text-editor` class never
reached the DOM, and with it went every StyleX class on the wrapper — border,
padding, disabled and status styling — plus the `xstyle` passthrough. Merged
through `mergeProps` instead, so the theme target, the StyleX classes and any
consumer `className`/`style` all survive.

The ChatSendButton half of this change landed separately on main in #4634
(`fix(Chat): add missing themeProps and fix className clobber`) with the same
`mergeProps` call, so only its regression test remains here.

The changeset goes with it: what is left changes `@astryxdesign/lab` only,
which is `private: true` / canary-only and so cannot be named in changeset
frontmatter (`check:changesets` rejects it), matching how other lab-only
fixes land (#4670, #4550, #4380, #4891).

@cixzhang
cixzhang added a commit that referenced this pull request Aug 12, 2026
RichTextEditor's input wrapper spread `themeProps('rich-text-editor', ...)`
and then overwrote it with both `stylex.props(...)` and
`className={className}`. Each of those carries its own `className`, so React
kept only the last one: the stable `astryx-rich-text-editor` class never
reached the DOM, and with it went every StyleX class on the wrapper — border,
padding, disabled and status styling — plus the `xstyle` passthrough. Merged
through `mergeProps` instead, so the theme target, the StyleX classes and any
consumer `className`/`style` all survive.

The ChatSendButton half of this change landed separately on main in #4634
(`fix(Chat): add missing themeProps and fix className clobber`) with the same
`mergeProps` call, so only its regression test remains here.

The changeset goes with it: what is left changes `@astryxdesign/lab` only,
which is `private: true` / canary-only and so cannot be named in changeset
frontmatter (`check:changesets` rejects it), matching how other lab-only
fixes land (#4670, #4550, #4380, #4891).

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

Labels

CLA Signed This label is managed by the Meta Open Source bot. hardening Component hardening and quality sweep

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants