Skip to content

feat!: migrate from Radix UI to UI SDK on React 19 (experiment) - #1342

Draft
gjones wants to merge 1 commit into
mainfrom
experiment/ui-sdk-migration
Draft

gjones wants to merge 1 commit into
mainfrom
experiment/ui-sdk-migration

Conversation

@gjones

@gjones gjones commented Nov 30, 2026

Copy link
Copy Markdown
Collaborator

Experiment. Draft only, not for merge. This PR exists so the work can be read and discussed. It should not be merged, released or published from this branch.

Description

An experiment to see how far Click UI can get on UI SDK (@ui-sdk/react, currently 0.1.0-beta.20) in place of Radix UI. UI SDK requires React 19, so the branch moves to React 19 as well.

  • Replaces all 15 @radix-ui/* packages with @ui-sdk/react and @ui-sdk/core. Migrated: Switch, Checkbox, RadioGroup, Separator, Avatar, Tabs, Accordion, MultiAccordion, Dropdown, ContextMenu, SplitButton, Popover, HoverCard, Tooltip, Dialog, Flyout, ConfirmationDialog, the Select family, AutoComplete, DatePicker and Toast.
  • Moves to React 19 (peer dependency ^19.0.0) and fixes the fallout: ref typing, the removed global JSX namespace, effect timing in Table column measuring.
  • Keeps the public API close to today's through small compatibility layers for the Radix-style dismissal and focus callbacks. Radix type re-exports are replaced by Click UI's own types.
  • Declares the ui-sdk cascade layer ahead of clickui, so Click UI styles win over UI SDK's injected styles and consumer styles still win over both.
  • Accessibility pass: icons are decorative by default, icon-only buttons have names, labels are wired with <label htmlFor>, Badge dismiss is a real <button>, FileTabs use a roving tabindex, focus rings and reduced-motion guards added. eslint-suppressions.json shrinks to two files.
  • Agent-facing docs: a generator (yarn generate:llm-docs) writes llms.txt and one Markdown page per component into docs/llm/, shipped in the package. A new @clickhouse/click-ui/agent entry re-exports UI SDK's agent bridge.

Links and tickets

  • UI SDK: https://ui-sdk.dev
  • Docs site running on this build: branch uisdk-react19 in ClickHouse/clickhouse-design

Good to know

Breaking for consumers (details and migration note in the changeset):

  • React 19 only.
  • @ui-sdk/react is ESM-only with subpath exports, so consumers need moduleResolution bundler or node16, and Jest setups need ESM handling.
  • Popups render in the browser top layer instead of a portal. jsdom needs stubs for showPopover, hidePopover and getAnimations (see setupTests.ts).
  • State attributes change from data-state="open" to data-open / data-closed / data-checked.

Known issues

  • A Flyout opened from inside a modal Dialog renders behind it.
  • Scroll lock on a modal Flyout is unconfirmed: it held in jsdom, one browser check showed the page scrolling.
  • DateRangePicker closes when Tab is pressed.
  • MultiSelect chips can only be removed with a pointer.
  • AutoComplete is not a full combobox pattern yet.
  • Clickable Cards are still role-less divs (the two remaining lint suppressions); ProgressBar has no role.
  • Focus leaving a non-modal Dialog no longer closes it.
  • UI SDK is a beta. Its API may change.

Expected CI failures

  • Visual regression and Chromatic: the Playwright specs still assert data-state, and snapshots were not regenerated. I did not run them.

Checklist

  • Breaking changes? (add migration notes in changesets)
  • Visual changes? (specify in changesets)
  • Design review needed?

Contribution

  • Sufficient research before PR
  • Self-reviewed the PR
  • Manually tested the changes (when applies - visual confirmation in Storybook)
  • build and build-storybook work locally
  • Tests and Stories are aligned with the changes

Run locally and passing: typecheck, lint (0 errors), format, circular-dependency:check, test (1134 unit tests), build and the build health check. All 672 Storybook stories render without console errors. Unit tests and stories are updated; the Playwright visual specs are not, which is why the last box is unticked.

Accessibility

  • Keyboard - every action works with Tab / Enter / Space / Esc; focus is visible and returns to the trigger on close
  • Names — every control has a name that includes its visible label; icon-only controls take aria-label
  • Vision — colors come from tokens, focus ring shows, targets are at least 24×24 px

Left unticked on purpose. Tested: keyboard passes in Chromium on Dialog, Dropdown, Select, Tabs, Accordion, Popover, Tooltip and Toast; eslint-plugin-jsx-a11y at error level; unit tests for the ARIA attributes each migrated component promises (WCAG 2.1.1, 2.4.3, 2.4.7, 4.1.2). Not tested: axe on every story, screen readers, Safari, Firefox, contrast measurements (1.4.3, 1.4.11), target size (2.5.8). The keyboard gaps listed under known issues are open.

Screenshots

None. Visual snapshots were not regenerated.

🤖 Generated with Claude Code

Local experiment, not for release. Replaces every Radix UI primitive with
UI SDK (@ui-sdk/react 0.1.0-beta.20) and moves the library to React 19.

- Remove all 15 @radix-ui packages; components keep their public names
  and compound APIs. Radix-only props are kept as deprecated no-ops or
  mapped to UI SDK equivalents.
- Fix React 19 fallout: polymorphic forwardRef typing, ref object types,
  and Table's first column measurement (also under StrictMode).
- Declare the ui-sdk cascade layer before clickui, and hide closed UI SDK
  content before hydration.
- Accessibility: icons are decorative by default, icon-only buttons have
  real names, form controls are named by their visible label, focus rings
  and reduced-motion guards added, keyboard access for FileTabs,
  AutoComplete and the MultiAccordion check.
- Agent docs: generated llms.txt and a page per component ship in the
  package (yarn generate:llm-docs), plus an ./agent entry re-exporting
  UI SDK's agent bridge.

Not run: Playwright visual tests (specs still assert data-state and
snapshots need intended updates). Known open issues are listed in
.changeset/experiment-ui-sdk-migration.md and the session notes: Flyout
inside a modal Dialog renders behind it, and DateRangePicker closes on Tab.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@workflow-authentication-public

Copy link
Copy Markdown
Contributor

Chromatic Storybook

Check Status Link
Storybook ✅ 672 stories published Open Storybook
UI Tests ⏳ 22 changes must be accepted as baselines Open build

Built from commit: 0dbef5c5d87c999fd2490b9a14a749055e3c4d74 · Chromatic run

Statuses as of the end of the run. The build link shows the live review state.

@XOP XOP added the demo only Only demonstration, all code changes in the follow up label Dec 1, 2026
@workflow-authentication-public

Copy link
Copy Markdown
Contributor

Storybook Preview Deployed

✅ Preview URL: https://click-oq5h8t8a7-clickhouse.vercel.app

Built from commit: d9edb44ccd66bce8b13ff423ead9eeb56ca275e9

This branch has not been deployed

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

Labels

demo only Only demonstration, all code changes in the follow up

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants