-
由 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:
Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by:
claude[bot] <41898282+claude[bot]@users.noreply.github.com>
正在分析文件…