chore(model-selector): remove redundant z-index hacks after overlay unification

Now that base/ui primitives carry z-[1002] by default (#33185),
the per-call-site overrides (z-[1002] on ModelSelector, z-[1003]
on nested PopupItem dropdown) are no longer needed — DOM order
handles stacking for same-z-index portals.
This commit is contained in:
yyh
2026-03-10 14:05:09 +08:00
parent 83c15227f6
commit a4942139d2
2 changed files with 2 additions and 15 deletions

View File

@ -11,7 +11,6 @@ import {
PopoverContent,
PopoverTrigger,
} from '@/app/components/base/ui/popover'
import { cn } from '@/utils/classnames'
import { useCurrentProviderAndModel } from '../hooks'
import ModelSelectorTrigger from './model-selector-trigger'
import Popup from './popup'
@ -85,16 +84,10 @@ const ModelSelector: FC<ModelSelectorProps> = ({
</button>
)}
/>
{/*
* TODO(overlay-migration): temporary layering hack.
* Some callers still render ModelSelector inside legacy high-z modals
* (e.g. code/automatic generators at z-[1000]). Keep this selector above
* them until those call sites are fully migrated to unified base/ui overlays.
*/}
<PopoverContent
placement="bottom-start"
sideOffset={4}
className={cn('z-[1002]', popupClassName)}
className={popupClassName}
popupClassName="overflow-hidden rounded-lg"
popupProps={{ style: { minWidth: '320px', width: 'var(--anchor-width, auto)' } }}
>

View File

@ -148,13 +148,7 @@ const PopupItem: FC<PopupItemProps> = ({
</div>
)}
/>
{/*
* TODO(overlay-migration): temporary layering hack.
* This nested provider-settings dropdown opens from inside ModelSelector
* (z-[1002]), so it must stay one level higher until all related modals
* are unified on the new overlay stack.
*/}
<PopoverContent placement="bottom-end" className="z-[1003]">
<PopoverContent placement="bottom-end">
<DropdownContent
provider={currentProvider}
state={state}