Skip to content

feat(ui): support Switch state content#90

Merged
wyf027 merged 4 commits into
mainfrom
codex/switch-state-content-2026-07-08
Jul 7, 2026
Merged

feat(ui): support Switch state content#90
wyf027 merged 4 commits into
mainfrom
codex/switch-state-content-2026-07-08

Conversation

@wyf027

@wyf027 wyf027 commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • add checkedChildren and unCheckedChildren props for Switch state content parity
  • keep state content aria-hidden so the switch accessible name stays stable
  • add Switch tests for state content rendering and accessible-name behavior
  • update Switch docs with a Tailwind demo and accessibility guidance

Validation

  • GitHub Actions CI / quality passed for head f71c6db35e528ffc552ddd68d324d0d6eac57dd2 in run 28893400648.
  • Passed steps: npm run lint:ui, npm run typecheck:ui, npm run test:ui, npm run build:ui, npm run build:docs.
  • Test run included Switch coverage for state content rendering, stable accessible naming, toggle behavior, click preservation, preventDefault, onChange, and disabled state.
  • Not run locally: the Codex shell executor is currently failing with Failed to create unified exec process: No such file or directory.

Notes

  • codebase-memory-mcp graph tools were not exposed in this session, so this run used repository files through GitHub as the AGENTS.md fallback.
  • External references: Ant Design exposes checkedChildren / unCheckedChildren; Element Plus exposes active/inactive text; WAI-ARIA switch guidance requires a stable accessible label and aria-checked state.

@ecc-tools

ecc-tools Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f71c6db35e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

<span
aria-hidden="true"
className={cn(
'pointer-events-none absolute inset-y-0 flex max-w-[calc(100%-1.75rem)] items-center overflow-hidden truncate text-[10px] font-medium leading-none text-white',

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Let switch content size the track

When callers pass text such as checkedChildren="Yearly" / unCheckedChildren="Monthly", this absolutely positioned content is capped to calc(100%-1.75rem) and cannot contribute to the button's intrinsic width; the button only gets min-w-14, leaving roughly 26px for the label and clipping most state text by default. Please keep the state content in layout or otherwise size the track from the content so the new visual labels are actually readable.

Useful? React with 👍 / 👎.

@ecc-tools

ecc-tools Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR.

@wyf027
wyf027 merged commit 910e6d1 into main Jul 7, 2026
1 check passed
@wyf027
wyf027 deleted the codex/switch-state-content-2026-07-08 branch July 7, 2026 23:13
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