Skip to content

fix(Tokenizer): add status to xdsClassName for theme targeting - #1995

Merged
cixzhang merged 1 commit into
mainfrom
navi/hardening-issues/2026-05-03
May 3, 2026
Merged

fix(Tokenizer): add status to xdsClassName for theme targeting#1995
cixzhang merged 1 commit into
mainfrom
navi/hardening-issues/2026-05-03

Conversation

@cixzhang

@cixzhang cixzhang commented May 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Tokenizer's xdsClassName call only included size, missing the status prop that drives visual border/shadow styles via inputStatusBorderStyles[status.type]. Themes couldn't distinguish tokenizer status states (error, warning, etc.) via the xds-tokenizer-[status] class.

Changes

Add status?.type to both xdsClassName calls (main wrapper and layer placeholder) to match the pattern already used by XDSTypeahead.

Audit Notes

Found during Night Watch Component Auditor pass over hardening queue components (Token, Tokenizer, Tooltip, TreeList, Typeahead).

Other components audited — no issues found:

  • Token: xdsClassName includes color + size, all visual props covered. Uses proper tokens throughout.
  • Tooltip: Behavioral wrapper, xdsClassName on tooltip popup correct. No visual props to propagate.
  • TreeList: xdsClassName on TreeListItem includes density, selected, disabled — all visual props covered.
  • Typeahead: Already includes status in xdsClassName — no fix needed.

Noted for human review (not fixed here):

  • Token, Tokenizer, Typeahead props interfaces don't extend XDSBaseProps — they manually define xstyle/className/style. This means they miss data-* support from XDSBaseProps. Broader API pattern decision needed.
  • XDSTypeahead has no ref prop — may need imperative handle similar to XDSTokenizer's XDSTokenizerHandle.

Night Watch — Component Auditor

Tokenizer's xdsClassName call only included size, missing the status
prop that drives visual border/shadow styles. This meant themes
couldn't distinguish tokenizer status states (error, warning, etc.)
via the xds-tokenizer-[status] class.

Add status?.type to both xdsClassName calls (main wrapper and layer
placeholder) to match the pattern already used by XDSTypeahead.
@cixzhang cixzhang added the hardening Component hardening and quality sweep label May 3, 2026
@cixzhang cixzhang added the hardening Component hardening and quality sweep label May 3, 2026
@vercel

vercel Bot commented May 3, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
xds-sandbox Ready Ready Preview, Comment May 3, 2026 10:42am

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label May 3, 2026
@cixzhang
cixzhang enabled auto-merge (squash) May 3, 2026 10:48
@cixzhang
cixzhang merged commit ff40b93 into main May 3, 2026
20 checks passed
@github-actions

github-actions Bot commented May 3, 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.

No new or modified components detected.

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@xds/core 17.7KB 27.5KB 4.1KB

Accessibility Audit

Status: No accessibility violations detected.


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

@github-actions
github-actions Bot deleted the navi/hardening-issues/2026-05-03 branch May 4, 2026 07:11
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.

1 participant