• Will Chen's avatar
    Radix to Base UI migration (#2432) · 684bed8e
    Will Chen 提交于
    <!-- This is an auto-generated description by cubic. -->
    ---
    ## Summary by cubic
    Migrates shadcn UI from Radix primitives to Base UI across the app and
    adds migration docs. Fixes interaction regressions (tooltips, submenu
    triggers, switch roles) to stabilize the UI and e2e tests.
    
    - **Migration**
    - Rewrote core UI in src/components/ui using Base UI (accordion,
    alert-dialog, button, checkbox, command, dialog, dropdown-menu, label,
    popover, scroll-area, select, separator, sheet, sidebar, switch, tabs,
    toggle, toggle-group, tooltip).
    - Updated 40+ components to new APIs (use polymorphic/as or direct
    elements instead of asChild, adjust Select onValueChange to handle
    undefined, align Accordion/Tabs props, replace data-[state] with
    data-open/checked, remove Tooltip wrappers around interactive elements,
    set submenu triggers to click/openOnHover=false, add aria-labels to
    switches/checkboxes, hide streaming animation text from a11y with
    aria-hidden).
    - Stabilized e2e tests (use click for submenu items, role-based locators
    for switches, waits for dialog close) and added
    .claude/run-e2e-update.sh for snapshot updates.
    - Added shadcn-migration.md documenting Radix→Base mappings and
    patterns.
    
    - **Dependencies**
      - Added @base-ui/react and removed 16 @radix-ui/react-* packages.
    
    <sup>Written for commit c89958b108c41de335aadb9ab9516a5140b8d63b.
    Summary will update on new commits.</sup>
    
    <!-- End of auto-generated description by cubic. -->
    
    <!-- CURSOR_SUMMARY -->
    ---
    
    > [!NOTE]
    > **Medium Risk**
    > Medium risk because it replaces core UI primitives and interaction
    patterns (dialogs/menus/selects/switches), which can cause subtle
    UX/a11y regressions despite primarily being framework-level refactors.
    > 
    > **Overview**
    > **Migrates UI primitives from Radix to Base UI.** Adds
    `@base-ui/react` and removes many `@radix-ui/react-*` deps, then updates
    shared shadcn wrappers (e.g. `dialog`, `alert-dialog`, `select`,
    `switch`, `dropdown-menu`, `tooltip`, `accordion`) and consumers to the
    new Base UI prop/events and `data-*` state attributes.
    > 
    > **Updates app components for new trigger/tooltip patterns and
    accessibility.** Replaces many `asChild` trigger patterns with direct
    triggers or `buttonVariants` styling, swaps some tooltips for `title`
    attributes, guards `Select` `onValueChange` against `undefined`, and
    adds `aria-label`s to switches/checkboxes.
    > 
    > **Stabilizes Playwright E2E tests and snapshots.** Menu submenus now
    open via click (not hover) and tests wait for submenu items/dialog
    close; branch manager assertions switch to new trigger text; switch
    locators move to role/name; multiple aria snapshot fixtures are updated,
    and a helper script `.claude/run-e2e-update.sh` is added to regenerate
    snapshots.
    > 
    > <sup>Written by [Cursor
    Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
    c89958b108c41de335aadb9ab9516a5140b8d63b. This will update automatically
    on new commits. Configure
    [here](https://cursor.com/dashboard?tab=bugbot).</sup>
    <!-- /CURSOR_SUMMARY -->
    
    ---------
    Co-authored-by: 's avatarClaude Opus 4.5 <noreply@anthropic.com>
    Co-authored-by: 's avatarclaude[bot] <41898282+claude[bot]@users.noreply.github.com>
    684bed8e
名称
最后提交
最后更新
.claude 正在载入提交数据...
.cursor/rules 正在载入提交数据...
.devcontainer 正在载入提交数据...
.github 正在载入提交数据...
.husky 正在载入提交数据...
assets 正在载入提交数据...
docs 正在载入提交数据...
drizzle 正在载入提交数据...
e2e-tests 正在载入提交数据...
makers 正在载入提交数据...
packages/@dyad-sh 正在载入提交数据...
scaffold 正在载入提交数据...
scripts 正在载入提交数据...
shared 正在载入提交数据...
src 正在载入提交数据...
testing 正在载入提交数据...
tools 正在载入提交数据...
worker 正在载入提交数据...
workers/tsc 正在载入提交数据...
.cursorignore 正在载入提交数据...
.env.example 正在载入提交数据...
.eslintrc.json 正在载入提交数据...
.gitattributes 正在载入提交数据...
.gitignore 正在载入提交数据...
.oxfmtrc.json 正在载入提交数据...
.oxlintrc.json 正在载入提交数据...
.prettierignore 正在载入提交数据...
.prettierrc 正在载入提交数据...
AGENTS.md 正在载入提交数据...
CLA.md 正在载入提交数据...
CLAUDE.md 正在载入提交数据...
CONTRIBUTING.md 正在载入提交数据...
LICENSE 正在载入提交数据...
README.md 正在载入提交数据...
SECURITY.md 正在载入提交数据...
biome.json 正在载入提交数据...
components.json 正在载入提交数据...
drizzle.config.ts 正在载入提交数据...
forge.config.ts 正在载入提交数据...
forge.env.d.ts 正在载入提交数据...
index.html 正在载入提交数据...
lint-staged.config.js 正在载入提交数据...
merge.config.ts 正在载入提交数据...
package-lock.json 正在载入提交数据...
package.json 正在载入提交数据...
playwright.config.ts 正在载入提交数据...
tsconfig.app.json 正在载入提交数据...
tsconfig.json 正在载入提交数据...
tsconfig.node.json 正在载入提交数据...
vite.main.config.mts 正在载入提交数据...
vite.preload.config.mts 正在载入提交数据...
vite.renderer.config.mts 正在载入提交数据...
vite.worker.config.mts 正在载入提交数据...
vitest.config.ts 正在载入提交数据...
windowsSign.ts 正在载入提交数据...