refactor(web): redesign Select component and migrate WorkplaceSelector#35293
Merged
refactor(web): redesign Select component and migrate WorkplaceSelector#35293
Conversation
- Remove clearable/loading/destructive boolean props from SelectTrigger, keeping only size variant with built-in chevron icon - Change SelectItem from compound to pass-through, export SelectItemText and SelectItemIndicator as composable styled wrappers - Add styled wrappers for SelectGroupLabel and SelectSeparator reusing menu-shared constants - Migrate WorkplaceSelector from Headless UI Menu to Select, fixing focus ring bug and correcting menu→listbox semantics - Update all 5 production callers to use new composition API Made-with: Cursor
…nt reuse Rename `menu-shared.ts` → `overlay-shared.ts` and all exported constants from `menu*ClassName` → `overlay*ClassName`. The shared styles are used by Select, DropdownMenu, and ContextMenu — the "menu" prefix wrongly implied they belong only to menu components. Also add `min-w-(--anchor-width)` to SelectContent popup so the dropdown width matches the trigger. Made-with: Cursor
hyoban
approved these changes
Apr 16, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #35293 +/- ##
=======================================
Coverage 85.10% 85.10%
=======================================
Files 4399 4399
Lines 201355 201344 -11
Branches 38299 38292 -7
=======================================
- Hits 171365 171356 -9
+ Misses 26886 26884 -2
Partials 3104 3104
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
HanqingZ
pushed a commit
to HanqingZ/dify
that referenced
this pull request
Apr 23, 2026
langgenius#35293) Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
asukaminato0721
pushed a commit
to asukaminato0721/dify
that referenced
this pull request
Apr 24, 2026
langgenius#35293) Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Redesign the
base/ui/selectcomponent to align with the project's established DropdownMenu pattern and shadcn/ui best practices, while migrating WorkplaceSelector from Headless UI to fix focus and semantics issues.SelectTrigger
clearable,onClear,loading, andvariant(destructive) boolean props — these are business behaviors that don't belong in a base component (architecture-avoid-boolean-props)class-variance-authoritydependency; use a simpleRecordfor size variantssize(small/regular/large) as a pure layout dimensionBaseSelect.IconSelectItem → pass-through (composition pattern)
DropdownMenuItemSelectItemTextandSelectItemIndicatoras composable styled wrappers, followingDropdownMenuRadioItemIndicatorpattern<SelectItem><SelectItemText>…</SelectItemText><SelectItemIndicator /></SelectItem>SelectGroupLabel / SelectSeparator
menuGroupLabelClassName/menuSeparatorClassNamefrommenu-shared.tsWorkplaceSelector migration
Menutobase/ui/select, fixing the focus ring bug (outline-hidden+:focus-visible) and correctingmenu→listboxsemanticsSelectTriggerdefaults viaclassNamefor the custom trigger appearanceSelectItem+SelectItemTextcomposition for custom item layout (avatar + name + PlanBadge)Callers
SelectItemText+SelectItemIndicatorcomposition APITests
From Cursor
Checklist
make lint && make type-check(backend) andcd web && pnpm exec vp staged(frontend) to appease the lint godsMade with Cursor