Skip to content

rx.ui: compiled component package and JS shell fixes - #8037

Draft
FarhanAliRaza wants to merge 250 commits into
mainfrom
ccr-5792db6b-a8cwgd
Draft

FarhanAliRaza wants to merge 250 commits into
mainfrom
ccr-5792db6b-a8cwgd

Conversation

@FarhanAliRaza

@FarhanAliRaza FarhanAliRaza commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Draft, work in progress. One PR for the whole rx.ui plan for now; it may be split along the step boundaries below later, so each step lands as its own merge commit.

What this is

reflex-components-ui, exposed as rx.ui: a compiled component set. The Reflex compiler emits plain HTML elements with static class names, StyleX compiles the styles in the app's own Vite build into one small stylesheet, and interactive behaviour comes from UI SDK (@ui-sdk/core + @ui-sdk/react, pinned at 0.1.0-beta.17), loaded per component only by pages that render it. rx.ui carries no re-implementation of primitives; the only script of its own left is the theme panel's. Props match today's Radix-backed rx.* and the visual target is pixel parity with Radix Themes, so moving a component is an import change. reflex-components-radix is not touched.

It also carries three fixes to Reflex's JS shell that every existing app gets, independent of the new package.

Steps

Shell (all existing apps):

  • 1. Stop importing whole libraries into the app root
  • 2. Scripts start after first paint on prerendered pages
  • 3. State runtime and toaster ship only when used

Foundation:

  • 4. Plugin.get_vite_plugins() hook in reflex-base
  • 5. Package scaffold, rx.ui namespace, JS tooling in CI
  • 6. UIPlugin: StyleX in the build, rx.ui.box as a plain element
  • 7. Tokens, color scales, themes, rx.ui.theme
  • 8. Style compiler, style tables, typed style
  • 9. Parity harness and behaviour contract

Components (57 of 57):

  • 10. Layout and typography (19)
  • 11. Display and actions (12)
  • 12. Form controls (13)
  • 13. Overlays and disclosure (10)
  • 14. App-level: theme panel, color-mode controls (3)

Proof and adoption:

  • 15. Benchmark apps and CI budgets
  • 16. Emotion-free pages
  • 17. Migration codemod and guide
  • 18. Docs: library pages, styling and theming guides

UI SDK

The first version of the components drove their behaviour with hand-written scripts (native popover, <dialog>, roving focus, listbox, menus, sliders...). To avoid maintaining a second implementation of primitives, every interactive component now renders UI SDK's parts with rx.ui's StyleX classes: tabs, dropdown and context menus, dialog, alert dialog, drawer, popover, select, hover card, tooltip, accordion, slider, segmented control, avatar, form fields and messages, text field slots. Native checkbox, switch, radio group and radio cards stay native (no script).

Cost: the kitchen sink ships 269.2 kB gzipped JS with rx.ui against 240.7 kB with rx (171.3 kB before UI SDK); a page without interactive parts is unchanged.

Behaviour differences from Radix that users will notice, all in the allowlist with reasons: dialogs, menus, popovers, selects, accordions and segmented controls need hydration (as Radix); disabled tabs, menu items and accordion headers take focus (ARIA patterns); Tab closes an open menu or select; tabs without a value select the first tab; Enter does not choose a segmented-control item and Home/End do nothing there; form messages follow typing after a failed submit; tooltips close when a press ends; drawers fade under reduced motion.

CI state

On 4297858 (the UI SDK move): unit tests, size budgets, builds, CodSpeed and CodeQL pass; the docs tests, one parity shard and the Firefox/WebKit contracts are being fixed. Firefox and WebKit could not be run outside CI.

  • CodeQL reports one new high-severity alert that nobody working on this PR has been able to read; it needs someone with access to the Security tab.

Needs a maintainer's eye

  • Step 1 flips a default (frontend_lazy_bundled_libraries=True, breaking fragment).
  • Step 2 delays hydration by design. First working click on a throttled connection moves from about 4.1 s to about 4.6 s while paint moves 1.28 s earlier. Clicks made before or during hydration are held and dispatched once after the page's mount effects have settled; pointerdown, key presses and typed input are not.
  • Step 3 changes the connection-error message of a stateful app that sends no toast from a sonner toast to a plain notice.
  • Step 7: the default accent is Reflex's "blue", not Radix's indigo. Since step 14, the appearance of the UIPlugin theme sets the app's default color mode.
  • Step 8: one runtime case is slower than Emotion (1,000 rows all bound to one changing value: 14.7 ms against 12.7 ms). A whole-style Var always wins over a later keyword argument (inline style against a class).
  • Step 8, follow-up: some props raise instead of matching rx pixel for pixel. The Radix margin and padding shorthands (m, px, ...) and lengths without a unit (gap="2") are refused with the spelling that works, because rx silently drops them. Text given to rx.ui.switch(...) is refused with the label to wrap it in, because rx.switch drops it.
  • Step 9: the allowlist (parity/allowlist.toml) holds 158 entries, each with its reason: UI SDK behaviour (above), steps the Radix reference itself fails in one engine, and the differences below. The harness waits for 500 ms without DOM mutations before reading a page (a time constant).
  • UI SDK is in beta and pinned exactly; an upgrade can change behaviour and is guarded by the parity and contract suites. One piece of rx.ui's own JS remains outside the theme panel: a one-shot focus of the first invalid control after a server error in rx.ui.form (UI SDK has no API for it).
  • Step 10: rx.ui.container(stack_children_full_width=True) raises and says how to get the same result.
  • Step 11: scroll_area scrolls natively (no drawn scrollbars; type and scroll_hide_delay have no effect) and is a tab stop, which Radix's is not; progress is a div with progressbar ARIA.
  • Step 12: every checkbox in a checkbox group or checkbox cards is its own tab stop; Enter in a native checkbox, radio or switch submits the surrounding form; in WebKit, arrow keys in a radio group do not wrap.
  • Components held in state: most rx.ui components with conditional styles (buttons, 12 of the 13 form controls) raise a StyleError when stored in state as a component.
  • Step 16: the BackendDisabled overlay (default on Reflex Cloud), the connection banner and the connection modal still use css props, and an rx.icon on a page brings Emotion's jsx, so such pages still ship Emotion.
  • Not yet covered by internal error names: many internal part classes (e.g. menu items, slider thumbs) would name themselves by a private name in an error. Public names are covered.
  • No screen reader has been used on any of this.

Landed so far

1. Dynamic-component libraries load on demand. Blank app JS (gzip of every client .js): 239.8 kB to 170.8 kB. frontend_lazy_bundled_libraries now defaults to True: a custom script that reads a library from window.__reflex must first await window.__reflex_load([...]), or the app sets the flag to False.

2. Scripts start after first paint on prerendered pages. Lighthouse mobile on the blank app: simulated 90 / LCP 2.85 s to 100 / 1.21 s; throttled 88 / 2.99 s to 98 / 1.75 s; CLS 0. Dev mode and client-rendered routes are untouched. A dev checkout with an existing .web needs reflex init after pulling this.

3. State runtime and toaster ship only when used. rx.el-only app: stateless 158.7 kB to 130.8 kB, stateful with no toast 161.6 kB to 153.9 kB. A stateless app keeps the event runtime off pages without handlers. refs imported from $/utils/state (as published packages do) is redirected to $/utils/refs, so it loads no state runtime.

4. Vite plugin hook. Plugin.get_vite_plugins() returns rx.plugins.VitePluginEntry(call=..., imports=[...]); with no entries vite.config.js is byte-identical to before.

5. Package scaffold. packages/reflex-components-ui, the optional extra reflex[ui], lazy rx.ui (no cost at import reflex), a JS package with lint, strict type-check, a generator drift check and vitest in a gated CI job. The extra is unpinned until the package has a first release.

6. UIPlugin. StyleX runs in the app's Vite build through a shipped wrapper. base.css declares the cascade once: resets, then UI SDK, then reflex-ui, then Tailwind's components and utilities, with unlayered CSS on top; verified with Tailwind v4 (v3 has no native layers and wins over rx.ui).

7. Tokens and themes. 81 StyleX modules generated from the installed @radix-ui/themes token CSS, drift-tested. A Chromium sweep against the real stylesheet: 10,556 theme combinations x 1,068 custom properties, sRGB and display-P3, zero differences. UIPlugin(theme=rx.ui.Theme(...)), rx.ui.theme(...), typed rx.ui.tokens, color_scheme and radius on components. Root theme: 4.6 kB gzipped CSS, 0.6 kB gzipped JS.

8. Style compiler and typed styles. Tables and user styles are merged in Python, user last, and emitted as literal StyleX declarations that fold to class strings; state values become inline CSS variables, state-bound variants become tables of class strings; no page ships the StyleX runtime. style is typed from a generated StyleProps (521 properties); misuse is a compile error naming the component as the app writes it (rx.ui.callout.root). keyframes({...}) animates. Compile time 0.7x to 0.99x of the Emotion path.

9. Parity harness. uv run python scripts/ui_parity.py [component] [--fonts TEXT CODE] [--shard i/n] compares pixels, computed styles (including elements inside a cell where the trees correspond, and named parts down to pseudo-elements) and the accessibility tree against the Radix-backed component, runs a behaviour contract against both systems, and writes a browsable report. CI: ui-parity (Chromium, three shards balanced by recorded timings) and ui-contracts (Chromium, Firefox, WebKit), all gated. A Playwright check loads every page of the shared test app in dev and prod and fails on any console warning or error.

10 to 14. Components. All 57: layout and typography (19), display and actions (12), form controls (13), overlays and disclosure (10: tabs, accordion, dialog, alert dialog, drawer, popover, tooltip, hover card, dropdown menu, context menu), and app-level (theme panel, color-mode button and switch). Each has its namespaces and parts and is based on the same HTML element classes as the Radix wrappers, so props match (API parity test). Every non-allowlisted parity cell is within its matrix's tolerance, most at exactly zero. Native checkbox, switch and radio controls work with JavaScript disabled. Interactive components run on UI SDK (see above).

15. Benchmarks and budgets. examples/pages/ holds blank, rx.el stateless and stateful, one rx.ui button, and the same kitchen sink in rx and in rx.ui. uv run reflex-bench run --suite pages measures them, and packages/reflex-bench/budgets.json fails CI on overshoot. Gzipped JS: kitchen sink 240.7 kB with rx, 269.2 kB with rx.ui on UI SDK (CSS 82.4 kB to 22.6 kB, zero Emotion files); one rx.ui button 146.8 kB; rx.el stateless first page 124.5 kB.

16. Emotion-free pages. A generated module imports React's createElement unless its code has a css prop, decided once per module from its code. An rx.ui-only app: 157.7 kB to 149.6 kB gzipped JS, with a permanent test that no script contains Emotion. Compile benchmarks are level with main.

17. Migration codemod and guide. python -m reflex_components_ui.migrate <paths> [--check] [--diff] [--fix-spacing] rewrites rx.* Radix components to rx.ui, moves the theme to rx.plugins.UIPlugin in rxconfig.py, and reports with file, line and column every style or prop it cannot carry over. The migration guide's table of API differences is generated from the allowlist.

18. Docs. rx.ui demos on 51 library pages, beside their rx counterparts, plus an overview and styling and theming guides (what the style compiler accepts and refuses, tokens, themes, color mode).

All Submissions:

  • Have you followed the guidelines stated in CONTRIBUTING.md file?
  • Have you checked to ensure there aren't any other open Pull Requests for the desired changed?

Type of change

  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected): the default flip in step 1
  • This change requires a documentation update

New Feature Submission:

  • Does your submission pass the tests? (not yet: see "CI state")
  • Have you linted your code locally prior to submission?

Changes To Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally? (Linux and Chromium locally; Windows, Firefox and WebKit in CI)

https://claude.ai/code/session_014AwvTPMyGMj9KHaq66r64v

Plugin.get_vite_plugins() returns VitePluginEntry objects, each carrying the
import statements and the expression to place in the plugins array of the
generated vite.config.js, ahead of reactRouter(). Entries keep rxconfig plugin
order then entry order, shared imports render once, and a malformed entry
raises InvalidVitePluginError naming the plugin. With no entries the rendered
file is unchanged.

Claude-Session: https://claude.ai/code/session_014AwvTNGETBu7Fzvwjqecm4
An installable, empty package: `pip install 'reflex[ui]'` adds
reflex-components-ui, which `rx.ui` resolves on first use. reflex does not
depend on it, and without the extra `rx.ui` raises an error that names
the extra.

The package embeds its javascript, js/src, in the wheel, and reads it in
place in a checkout. js/ carries its own tooling: ESLint with the StyleX
rules and rules against components and barrel files in js/src, a type
check from JSDoc, vitest, and a driver that writes generated files and
fails CI when a committed one drifts. Each lint rule has a test that
feeds it a file it must reject.

Claude-Session: https://claude.ai/code/session_014AwvTNjM7Q5Te2EY2FTHrZ
@FarhanAliRaza FarhanAliRaza added documentation Improvements or additions to documentation enhancement Anything you want improved labels Nov 27, 2026 — with ChatGPT Codex Connector
@greptile-apps

greptile-apps Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 0/5 · The PR is not ready to merge: earlier compilation failures, dropped control props, and migration failures remain outstanding.RetriggerView in GreptileConfidence Score: 0/5

[High impact] The PR changes page loading and generated JavaScript across Reflex apps, alongside an opt-in component package.

The PR is not ready to merge: earlier compilation failures, dropped control props, and migration failures remain outstanding.

Findings

  1. P1 Grouped variants lose valid styles ▶
  2. P1 Bound sliders lose input attributes ▶
  3. P1 Reset leaves select display stale ▶
  4. P1 Child controls lose supplied props ▶
  5. P1 Debounced controls lose inline styles ▶
  6. P1 UI benchmarks fail across commits ▶
  7. P1 Moved themes lose their names ▶
  8. P1 Failed checks allow broken migrations ▶
  9. P1 Local arguments get rewritten ▶
  10. P1 Valid column counts are rejected ▶
  11. P1 Benchmark hash is stale ▶
  12. P1 Bound select positions break compilation ▶
  13. P1 Bound menu sizes break compilation ▶
  14. P2 Tests check only fragments ▶
  15. P2 New tests lack required docstrings ▶
  16. P2 Accessibility changes go unchecked ▶
  17. P2 Later styles do not win ▶
  18. P2 Parent styles override the child ▶
  19. P2 Compound styles miss larger screens ▶
  20. P2 Background changes erase decorations ▶
  21. P2 Import breaks repository rule ▶
  22. P2 Nested appearance edits miss ▶
  23. P2 Panels clear each other's choices ▶
  24. P2 Color-mode advice is outdated ▶
  25. P2 Repeated settings cause tracebacks ▶
  26. P2 Docs markup breaks its rule ▶

Summary

Adds the compiled rx.ui package and reduces JavaScript loaded by the existing app shell.

Since the previous review:

  • Apps can use 57 themed components through the new rx.ui package.
  • Prerendered pages start their scripts after the first paint.
  • Dynamic-component libraries load only when a page needs them.
  • Stateless pages skip backend runtime code they do not use.
  • Reflex plugins can add build-time plugins to the generated Vite config.
  • Generated modules without CSS props can avoid importing Emotion.

FarhanAliRaza documents that a whole-style Var wins over later style keywords. That accepted difference is not reported again; the separate loss of earlier whole-style dictionaries remains in finding 5.

Reviews (44) · Last reviewed commit: "Fix CI of rx.ui on UI SDK: imports besid..." · Reviewed by Greptile

Comment thread reflex/utils/frontend_skeleton.py Resolved
root.jsx imported the whole namespace of every library registered for
dynamic components, which kept all of Radix Themes in the chunks every
page loads. frontend_lazy_bundled_libraries now defaults to True, and the
lazy path is fixed so it actually splits:

- Each optional library is loaded through a generated module under
  utils/dynamic_libraries/. Importing the library itself from root.jsx
  made the bundler fold the namespace back into a statically loaded chunk
  whenever a page also imported from it.
- Libraries the compiler registered are only made loadable when a page
  renders a dynamic component (one evaluated by evalReactComponent).
  Libraries the app registered with bundle_library always are.

A production build of the blank template goes from 239.8 kB to 170.8 kB
of gzipped JS.

Claude-Session: https://claude.ai/code/session_014AwvTL12cX7g6Zn6HEiwG1
@codspeed

codspeed Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

1 warning

⚠️ 14 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 146 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing ccr-5792db6b-a8cwgd (55e90f1) with main (6f5c39c)

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

Comment thread tests/units/compiler/test_compiler.py Outdated
Comment on lines +634 to +637
assert (
' "d3-format": () => import("$/utils/dynamic_libraries/d3_format")'
".then((module) => module.default),"
) in code.splitlines()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Tests check only fragments

These new assertions check whether one loader line appears in the generated file. CLAUDE.md requires tests of generated code to compare the complete output, not fragments. These checks can pass when other loaders are missing or extra imports appear.

Compare the full expected output, as test_compile_app_root_loads_optional_libraries_on_demand already does. Apply this to the other new loader assertions too, including those in test_dynamic_components_codegen.py. This repository requirement must be met before merging.

Context Used: CLAUDE.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +539 to +540
def test_rewrite_component_import(module: str, is_reflex_package: bool, expected: str):
assert _rewrite_component_import(module, is_reflex_package) == expected

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 New tests lack required docstrings

This new test starts directly with an assertion, but CLAUDE.md requires Google-style docstrings on all functions, including argument descriptions where needed. Add them here and to the other new tests missing them, including those in test_init.py and test_js_package.py. This repository requirement must be satisfied before merging.

Context Used: CLAUDE.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

A prerendered page is visible without javascript, but react-router's
<Scripts> preloads every route module from the head, where the downloads
compete with the stylesheet the page needs to paint.

The document's Scripts component now renders $/utils/scripts, which wraps
react-router's. On a prerendered page it leaves the module preloads out of
the document and replaces the module script with an inline one that adds
both back on the first paint. A user input, a hidden tab, a browser without
paint timing or a one second timeout start them as well. Dev mode and the
SPA fallback render what react-router renders.

The last click that comes before the page can handle one is dispatched
again after hydration, unless the browser already acted on it.

Claude-Session: https://claude.ai/code/session_014AwvTNacWVsm7SEvVjhfGM
An app without state bundled Socket.io, the cookie library and the code
that connects to the backend, and every app bundled the toaster whether
or not it ever showed a toast.

State runtime. The connection to the backend (socket, session, browser
storage sync, the event loop over the socket) moves out of
utils/state.js into utils/socket.js. Only the compiled context module of
an app with state imports it; it registers itself with utils/state.js
through a registry in the new utils/event_loop.js, which also holds the
event queue the two share. utils/state.js keeps every export it had:
the ones that need the connection delegate to it, and useEventLoop runs
the events the browser handles by itself (scripts, redirects, refs,
storage, downloads) when there is none. _remove_cookie writes the
expired cookie itself, so it needs no cookie library.

Toaster. The app's default toaster is bundled when the app sends a
toast: a toast call compiled into a page or an app wrap carries a
ToasterRequest app wrap in its var data, an on_load toast is read from
the event, and the functions of the state tree are read for references
to rx.toast (by name, through helpers in the app's own modules). A
toaster passed to rx.App is always bundled. Since code that runs on the
backend cannot be ruled out by reading names, an app with state that
gets no toaster gets a plain-DOM stand-in for the toast function
instead, so a toast sent anyway and a connection error still show. The
connection toaster no longer asks for the toaster by itself.

Total gzipped client JS of a production build, rx.el only, no Radix or
Tailwind plugin: 158.7 kB to 130.8 kB without state, 161.6 kB to
153.9 kB with state and no toast.

Claude-Session: https://claude.ai/code/session_014AwvTNmJCFr12bYVhV8efZ
UIPlugin wires StyleX into the app's Vite build: the compiler and its
plugin as development dependencies, the javascript package copied to
.web/reflex-ui, and base.css imported first by the root stylesheet to
declare the cascade layer order.

UIComponent renders a plain element. Its style is emitted as a
stylex.create declaration into whichever module renders the element, and
spread with stylex.props, which StyleX folds to a class name string. A
component held in state falls back to an inline style.

The Vite wrapper fixes the React Router build (the renamed stylesheet),
names the chunk that links the stylesheet after the compiled styles so a
changed style never alters a file under an unchanged name, and loads the
StyleX development module from the client entry.

Claude-Session: https://claude.ai/code/session_014AwvTPBw2eYQiwgtLmDkpC
Recording stopped when the scripts module was imported, which left the time
until hydrateRoot with no one handling a click. The entry points now take
the click over immediately before they hydrate.

Claude-Session: https://claude.ai/code/session_014AwvTNacWVsm7SEvVjhfGM
StyleProps is generated from the type definitions of the pinned StyleX
package, so a type checker catches a misspelt CSS property or keyword.
lower() turns a style into the style object StyleX compiles: conditions per
property, media queries for responsive values, color scales with the module
each needs, and shorthands split into longhands. merge() resolves a
component's style table against the props and the style of one element, by
property with the last one winning, and returns the alternatives of a prop
bound to state without resolving them.

StyleX silently drops the border and background shorthands, so both are
always split, and animation is refused with what to set instead.

Claude-Session: https://claude.ai/code/session_014AwvTMtxnRhQBAehyWjUwF
…erging

Claude-Session: https://claude.ai/code/session_014AwvTPMyGMj9KHaq66r64v

# Conflicts:
#	packages/reflex-components-ui/README.md
#	packages/reflex-components-ui/src/reflex_components_ui/style/__init__.py
Comment on lines +470 to +475
for combo in product(*[domains[member] for member in group]):
change = _difference(
static, merged_with(dict(zip(group, combo, strict=True)))
)
if change:
values[combo] = finish(change, unset=True)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Grouped variants lose valid styles

_merge_dynamic only builds combinations from values explicitly listed in the table. When two state-bound props share a compound style, a valid value of one prop is lost if the other has an unlisted value. For example, a tone="red" variant combined with a loading="true" compound style produces no alternative for tone="red", loading=False. The static style excludes both bound props, so callers cannot recover the red variant. Include a no-match fallback for each grouped prop.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Every custom property Radix Themes defines becomes a StyleX variable with the
same name and value, generated from the token stylesheet of the version the
Radix components install. A color is one light-dark() value with a display-P3
variant, so an appearance is the color-scheme of an element; accent, gray,
radius, scaling and panel are createTheme classes, one module per accent and
per gray so an app carries only what it imports.

A sweep in headless Chromium compares every custom property under these
modules with @radix-ui/themes and its Theme component: part of it in npm test,
the whole product of the theme props in npm run sweep.

Claude-Session: https://claude.ai/code/session_014AwvTMTA184ecs3JHWuggN
…leX modules

Claude-Session: https://claude.ai/code/session_014AwvTPMyGMj9KHaq66r64v

# Conflicts:
#	packages/reflex-components-ui/README.md
#	packages/reflex-components-ui/js/scripts/generate.js
#	tests/units/reflex_components_ui/test_js_package.py
rx.ui.switch is a native input, and React refuses a child of one with an
error that takes the page down, so rx.ui.switch("Sync settings") left a
blank page. rx.switch renders the button of Radix, which drops the text.
The switch and the color mode switch now fail to compile and name the label
to put the text in, which the shared app's form now uses; the difference is
recorded as a children entry of the allowlist.

Every other rx.ui component either renders a text child where its element
takes one or refuses it while compiling, which a test over each now holds.

Claude-Session: https://claude.ai/code/session_014AwvTPQrAAUS9U2MqKfT3k
The trigger rx.ui.tooltip makes of its child named itself
rx.ui.tooltip_trigger, which no app writes.

Claude-Session: https://claude.ai/code/session_014AwvTPQrAAUS9U2MqKfT3k
A line the codemod inserted or rewrote ended in LF in a file with CRLF
line endings, as a checkout on Windows writes them, and its --diff printed
the CR of every line. Each edit now ends its lines as the file does, and the
diff is printed with the newlines of the terminal. The fixture apps and the
diff are tested with both endings.

Claude-Session: https://claude.ai/code/session_014AwvTPQrAAUS9U2MqKfT3k
The app root lists $/utils/refs among its window libraries since dynamic
components read the registry of refs from there; the docs' frontend test
evaluates the root with each library as a parameter, and lacked that one.

Claude-Session: https://claude.ai/code/session_014AwvTPQrAAUS9U2MqKfT3k
…units

flex(gap="3"), grid(gap="6") and center(padding="4") passed bare numbers
to CSS, which the browser drops, so the rx kitchen sink rendered without
that spacing, and rx.ui now refuses them, which failed the export of the
size budgets. They use the spacing prop and a length in pixels.

Claude-Session: https://claude.ai/code/session_014AwvTPQrAAUS9U2MqKfT3k
),
_sidebar(ns),
columns=rx.breakpoints(initial="1", md="2"),
spacing="6",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Benchmark hash is stale

The spacing changes modify the benchmark page without updating examples/pages/.content-hash. The examples workflow runs scripts/hash_examples.py --check, which includes this file and rejects the old hash, so CI fails.

Regenerate and commit the hash with uv run python scripts/hash_examples.py.

FarhanAliRaza and others added 19 commits November 29, 2026 09:02
hover.js closed the popup from a keydown listener without cancelling the
key, so in Firefox and WebKit the same Escape also reached a modal dialog
the popup was in, which closed with it. As the topmost layer, the popup now
takes the key, as Radix's does.

Claude-Session: https://claude.ai/code/session_014AwvTPQrAAUS9U2MqKfT3k
…found

- theme_panel compares computed lengths as numbers, within 0.05px, rather
  than in Chromium's serialisation (Firefox says 21.6px, WebKit 21.59375px
  for 21.5938px).
- context_menu asks for the menu with Shift+F10, and with the context-menu
  key where the engine sends no contextmenu for Shift+F10; its keys cell
  waits for the area to say it is open before the capture reads it.
- wait_for_text says what the element held when the wait ends without the
  text, and the drawer's Tab step names what has the focus outside its
  panel, so a failure in an engine tells what happened.

Claude-Session: https://claude.ai/code/session_014AwvTPQrAAUS9U2MqKfT3k
Both systems move the indicator with a 120ms transform transition, which
Firefox still lists among the animations as the page settles. The step now
waits, for at most two seconds, until no transition runs on the indicator,
then reads every animation as before.

Claude-Session: https://claude.ai/code/session_014AwvTPQrAAUS9U2MqKfT3k
…Chromium

- Firefox and WebKit take a closing modal dialog out of the top layer at
  once, without CSS overlay, so a drawer's panel ran no transition and its
  on_animation_end(false) never came. A dialog that closes now gives a panel
  with a transform transition that is not running the transitionend the
  browsers that run it send.
- WebKit made the drawer's dialog, which covers the page around its panel,
  a stop of Tab. It is out of the order of Tab; showModal still moves the
  focus into the panel.

Claude-Session: https://claude.ai/code/session_014AwvTPQrAAUS9U2MqKfT3k
A popup recorded Escape as what closed it only from its own keydown, so
one the browser dismissed on an Escape pressed before the focus had moved
in was said to be dismissed from outside. popup.js now notes an Escape on
the page, and the first popup that closes in its task was closed by it;
popups, menus and selects take what closed them from closedBy().

Claude-Session: https://claude.ai/code/session_014AwvTPQrAAUS9U2MqKfT3k
…r cards on focus

- The transitionend a dialog gives a panel that does not slide out came
  before the dialog said it had closed, where a transition that runs ends
  after: it is now sent last.
- The focus-visible cells of the hover card matrix captured Radix's card
  before it had opened: Radix opens it a task after the focus, rx.ui at
  once. The cell now waits for the card, as the hover and open cells do.

Claude-Session: https://claude.ai/code/session_014AwvTPQrAAUS9U2MqKfT3k
format_library_name split `pkg@1.0.0/sub` at the last @ and dropped
everything after it, so a component with that library imported from
`pkg`. The subpath after a version now stays, unless the specifier is a
location (a path, a protocol or a git ref), whose slashes are its own.
The installer reads the package from either form.

Claude-Session: https://claude.ai/code/session_014AwvTPMyGMj9KHaq66r64v
The three components render the React parts of @ui-sdk/react
0.1.0-beta.17 (pinned, installed only by a page that renders one) with
rx.ui's StyleX classes; their hand-written behaviour goes (tabs.js;
dialog.js, menu.js and popup.js stay for alert_dialog, drawer,
context_menu, popover and select).

- SDKPart: a part of UI SDK styled as any rx.ui element; a trigger or a
  close button renders as its child through `render`, and the page
  collects that child's styles, custom code and app styles.
- The events Radix fires on the content of a dialog or a menu are called
  by the reason UI SDK gives for a change, before the change, as in Radix.
- A dialog is UI SDK's backdrop and its content, the panel, in the top
  layer; a dropdown menu is placed by UI SDK with Radix Themes' offsets.
- UI SDK's state attributes (data-open, data-highlighted, data-disabled,
  data-ending-style) select the styles; base.css places the ui-sdk
  cascade layer under rx.ui's.
- The parity harness reads UI SDK's markup; the allowlist drops the
  entry for Tab leaving a dialog, which UI SDK keeps inside as Radix.

Claude-Session: https://claude.ai/code/session_014AwvTPMyGMj9KHaq66r64v
An unselected panel of UI SDK's tabs is not in the page, as in Radix, and
a button that opens a popup selects UI SDK's data-open beside Radix's
data-state: the declarations of the app's memoized components follow.

Claude-Session: https://claude.ai/code/session_014AwvTPMyGMj9KHaq66r64v
All four render UI SDK's parts in rx.ui's look, so no native popover or
dialog is left under the dialog family and the select inside a dialog no
longer closes it with Escape.

- _sdk: one popup root that calls the Radix events of its content by the
  reason of a change, Radix defaults where UI SDK's differ (menus and the
  select stop at their ends), and placed content with Radix Themes'
  offsets; a trigger's child brings its hooks and is written to JSX only
  when it renders.
- _dialog: the parts dialog, alert_dialog and drawer share. The cancel
  button of an alert dialog takes the focus; a drawer's edge is UI SDK's
  side and the end of its slide onOpenChangeComplete, and a drawer that
  is not modal draws no overlay.
- select: UI SDK renders the chosen option and the form input;
  position="item-aligned" is alignItemWithTrigger.
- Allowlist: the approved phase-1 entries, the same categories for the
  wave, entries for the differences found (Tab leaves an open select,
  a drawer's close button closes it when not dismissible, the drawer
  fades under reduced motion), stale entries removed, reasons rewritten
  for UI SDK.

Claude-Session: https://claude.ai/code/session_014AwvTPMyGMj9KHaq66r64v
The menus share the parts of @ui-sdk/react/menu: the context menu opens
from MenuContextTrigger, and a checkbox item closes its menu and keeps
its own state, as in Radix. The hover card and the tooltip are the parts
of UI SDK, with the delays and placement of Radix Themes; a tooltip
describes its child. The popup behaviour scripts and the native-popover
style tables are gone.

Claude-Session: https://claude.ai/code/session_014AwvTPMyGMj9KHaq66r64v
…ces of wave B

A label of a menu is an element of its own, as in Radix: UI SDK's label
must be inside a group. The arrow keys of a context menu stop on a
disabled item, a tooltip closes when a press ends, and one the pointer
cannot rest on stays open while the pointer is over it. The trigger of a
popover names it by the id its content is given, while it is open.

Claude-Session: https://claude.ai/code/session_014AwvTPMyGMj9KHaq66r64v
… shared app

A context menu asked for from the keyboard opens beside its area, where
UI SDK puts it. Regenerate the stubs and the differences of the migration
guide, and hold the shared rx.ui app to the select trigger, the context
menu and the hover card on UI SDK.

Claude-Session: https://claude.ai/code/session_014AwvTPMyGMj9KHaq66r64v
The accordion is the parts of @ui-sdk/react/accordion: a heading around a
button, a panel UI SDK mounts while it is open; a single accordion keeps
its open item open unless it is collapsible, and Tab passes the trigger
of a disabled item, as in Radix. The slider is UI SDK's, its thumbs
travelling as far as Radix Themes'. The segmented control is UI SDK's,
its arrow keys moving the focus without choosing and Enter, Home and End
doing what they do in Radix; what marks the chosen item is placed by CSS
before the page hydrates. The accordion, slider and roving-focus scripts
are gone; the radio group and radio cards stay native.

Claude-Session: https://claude.ai/code/session_014AwvTPMyGMj9KHaq66r64v
The avatar is the parts of @ui-sdk/react/avatar, which shows the fallback
until the image has loaded. A form field is UI SDK's field: a message with
a condition is its error, one without is always shown, and a label points
at its control in the page the server sends. A text field with slots is
UI SDK's input group. The theme panel keeps its class swap as an app
script, its tooltips UI SDK's. The form-validity, image-status and
text-field scripts are gone.

Claude-Session: https://claude.ai/code/session_014AwvTPMyGMj9KHaq66r64v
The README says how a component is made of the parts of UI SDK; the docs
and the migration guide say what renders what, with the sizes of the
kitchen sink measured again. One breaking news fragment says behaviour
comes from UI SDK pinned at 0.1.0-beta.17 and what a user may notice, and
the fragments of the waves no longer describe the scripts it replaced.
The size budgets of the kitchen sink are the measured values + 5 %. The
reasons of the allowlist that still described native elements say what
UI SDK does.

Claude-Session: https://claude.ai/code/session_014AwvTPMyGMj9KHaq66r64v
Enter, Home and End on a segmented control and Tab passing a disabled
accordion header were behaviour written beside UI SDK; UI SDK's own is
kept, and the differences are allowlisted with their reasons.

Claude-Session: https://claude.ai/code/session_014AwvTPMyGMj9KHaq66r64v
Comment on lines +470 to +472
if position is None or position == "popper":
return tag
if isinstance(position, Var):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Bound select positions break compilation

Passing a state-bound position to rx.ui.select now fails during compilation. SelectContent._render() compares position with "popper" before checking whether it is a Var. That comparison produces another Var, which Python cannot use in an if.

Check for Var first so the existing alignItemWithTrigger expression can be emitted.

Comment on lines +64 to +65
size = literal(size)
return -4 * int(size if size in ("1", "2") else 2)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Bound menu sizes break compilation

A state-bound menu size now fails when raised() calculates the default alignOffset. The membership check size in ("1", "2") truth-tests comparisons with the Var. This affects context menus and submenus that inherit a state-bound size, stopping the app from compiling.

Handle a Var separately and emit the offset as a browser expression.

…acts

- UI SDK parts are imported under UISDK-prefixed names: the docs app,
  which renders Base UI's Popover beside rx.ui.popover, failed to compile
  on the two imports of `Popover`.
- The difference of the harness's text_field reaches the page of
  rx.ui.input, which documents it; the docs test reads the components the
  pages render.
- Remove the dropdown_menu style entry for the scrolling menu, which no
  longer differs.
- A step of a contract waits 10 seconds by default rather than 30, so an
  allowlisted step that fails by design costs a third: WebKit ran past the
  job's 30 minutes.
- Firefox and WebKit send no contextmenu for the keys Playwright presses;
  the area is sent the one a browser sends for them, as from the keyboard.
- Allow Shift+Tab staying on the selected tab of rx.tabs in Firefox.

Claude-Session: https://claude.ai/code/session_014AwvTPMyGMj9KHaq66r64v
Radix adds the scrollbar of a menu whose items overflow, and Radix Themes
the room for it, once it has measured the items: a capture taken before
missed the 4px the allowlist explains, so the entry read as stale on one
machine and was needed on another. The capture now waits for it, and the
entry is back.

Claude-Session: https://claude.ai/code/session_014AwvTPMyGMj9KHaq66r64v

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

documentation Improvements or additions to documentation enhancement Anything you want improved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants