diff --git a/web/src/components/ModelPickerDialog.tsx b/web/src/components/ModelPickerDialog.tsx index d99ea09a8ab..22b2cb1bce8 100644 --- a/web/src/components/ModelPickerDialog.tsx +++ b/web/src/components/ModelPickerDialog.tsx @@ -5,6 +5,7 @@ import { Input } from "@/components/ui/input"; import type { GatewayClient } from "@/lib/gatewayClient"; import { Check, Search, X } from "lucide-react"; import { useEffect, useMemo, useRef, useState } from "react"; +import { createPortal } from "react-dom"; /** * Two-stage model picker modal. @@ -194,7 +195,14 @@ export function ModelPickerDialog(props: Props) { } }; - return ( + // Portal to document.body: the main dashboard column in App.tsx is + // `relative z-2`, which creates a stacking context that traps fixed + // descendants below the app sidebar (z-50). Without the portal this + // modal's z-[100] is scoped to z-2 and the sidebar covers its left + // edge — visible especially in the Large theme variants where the + // larger root font widens the dialog into the sidebar's column. See + // Toast.tsx for the same pattern. + return createPortal(
e.target === e.currentTarget && onClose()} @@ -296,7 +304,8 @@ export function ModelPickerDialog(props: Props) {
- + , + document.body, ); }