修复模型选择弹窗空白并收敛弹窗尺寸
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled

This commit is contained in:
Your Name 2026-02-14 20:59:42 +08:00
parent 10b44ddfcd
commit 09aa0de7b6
3 changed files with 33 additions and 33 deletions

View File

@ -2083,17 +2083,17 @@ export function CanvasChatPanel({ chatId, initialMessages = [], onClose, onOpenF
{allModels.find(m => m.id === selectedModelId)?.displayName || "Agent模式"}
</span>
</SelectTrigger>
<SelectContent className="w-[320px] max-h-[420px] overflow-hidden rounded-[22px] border border-[#cfd4dc] bg-[#f3f4f6] p-2 shadow-[0_10px_30px_rgba(15,23,42,0.15)]">
<div className="max-h-[390px] space-y-1 overflow-y-auto pr-1">
<SelectContent className="w-[272px] max-h-[380px] overflow-hidden rounded-[20px] border border-[#cfd4dc] bg-[#f3f4f6] p-2 shadow-[0_8px_24px_rgba(15,23,42,0.14)]">
<div className="max-h-[348px] space-y-1 overflow-y-auto pr-1">
{allModels.map((model) => (
<SelectItem
key={model.id}
value={model.id}
className="h-12 rounded-2xl px-3 text-[#2f3640] [&>span]:hidden focus:bg-[#dfe2e6] focus:text-[#1f2937] data-[state=checked]:bg-[#dfe2e6] data-[state=checked]:text-[#1f2937]"
className="h-11 rounded-2xl px-3 text-[#2f3640] [&>span:first-child]:hidden focus:bg-[#dfe2e6] focus:text-[#1f2937] data-[state=checked]:bg-[#dfe2e6] data-[state=checked]:text-[#1f2937]"
>
<div className="flex w-full items-center justify-between gap-3">
<div className="flex min-w-0 items-center gap-2.5">
<div className="h-7 w-7 overflow-hidden rounded-full border border-[#d4d9df] bg-white">
<span className="flex w-full items-center justify-between gap-3">
<span className="flex min-w-0 items-center gap-2.5">
<span className="h-6 w-6 overflow-hidden rounded-full border border-[#d4d9df] bg-white">
{model.avatarUrl ? (
<img src={model.avatarUrl} alt={model.displayName} className="h-full w-full object-cover" />
) : (
@ -2101,13 +2101,13 @@ export function CanvasChatPanel({ chatId, initialMessages = [], onClose, onOpenF
{model.id === "auto" ? "A" : model.displayName.slice(0, 1)}
</span>
)}
</div>
<span className="truncate text-[15px] font-medium leading-none">{model.displayName}</span>
</div>
</span>
<span className="truncate text-[14px] font-medium leading-none">{model.displayName}</span>
</span>
{selectedModelId === model.id ? (
<span className="text-base font-semibold text-[#1f2937]">✓</span>
) : null}
</div>
</span>
</SelectItem>
))}
</div>

View File

@ -1336,17 +1336,17 @@ export function LovartHome({
</span>
</span>
</SelectTrigger>
<SelectContent className="w-[320px] max-h-[420px] overflow-hidden rounded-[22px] border border-[#cfd4dc] bg-[#f3f4f6] p-2 shadow-[0_10px_30px_rgba(15,23,42,0.15)]">
<div className="max-h-[390px] space-y-1 overflow-y-auto pr-1">
<SelectContent className="w-[272px] max-h-[380px] overflow-hidden rounded-[20px] border border-[#cfd4dc] bg-[#f3f4f6] p-2 shadow-[0_8px_24px_rgba(15,23,42,0.14)]">
<div className="max-h-[348px] space-y-1 overflow-y-auto pr-1">
{[{ id: "auto", displayName: "Agent模式", avatarUrl: null }, ...imageModels].map((model) => (
<SelectItem
key={model.id}
value={model.id}
className="h-12 rounded-2xl px-3 text-[#2f3640] [&>span]:hidden focus:bg-[#dfe2e6] focus:text-[#1f2937] data-[state=checked]:bg-[#dfe2e6] data-[state=checked]:text-[#1f2937]"
className="h-11 rounded-2xl px-3 text-[#2f3640] [&>span:first-child]:hidden focus:bg-[#dfe2e6] focus:text-[#1f2937] data-[state=checked]:bg-[#dfe2e6] data-[state=checked]:text-[#1f2937]"
>
<div className="flex w-full items-center justify-between gap-3">
<div className="flex min-w-0 items-center gap-2.5">
<div className="h-7 w-7 overflow-hidden rounded-full border border-[#d4d9df] bg-white">
<span className="flex w-full items-center justify-between gap-3">
<span className="flex min-w-0 items-center gap-2.5">
<span className="h-6 w-6 overflow-hidden rounded-full border border-[#d4d9df] bg-white">
{model.avatarUrl ? (
<img src={model.avatarUrl} alt={model.displayName} className="h-full w-full object-cover" />
) : (
@ -1354,13 +1354,13 @@ export function LovartHome({
{model.id === "auto" ? "A" : model.displayName.slice(0, 1)}
</span>
)}
</div>
<span className="truncate text-[15px] font-medium leading-none">{model.displayName}</span>
</div>
</span>
<span className="truncate text-[14px] font-medium leading-none">{model.displayName}</span>
</span>
{(selectedModelId || "auto") === model.id ? (
<span className="text-base font-semibold text-[#1f2937]">✓</span>
) : null}
</div>
</span>
</SelectItem>
))}
</div>

View File

@ -1178,22 +1178,22 @@ function PureModelSelectorCompact({
<ChevronDownIcon size={16} />
</Button>
</Trigger>
<PromptInputModelSelectContent className="w-[320px] max-h-[420px] overflow-hidden rounded-[22px] border border-[#cfd4dc] bg-[#f3f4f6] p-2 shadow-[0_10px_30px_rgba(15,23,42,0.15)]">
<div className="max-h-[390px] space-y-1 overflow-y-auto pr-1">
<PromptInputModelSelectContent className="w-[272px] max-h-[380px] overflow-hidden rounded-[20px] border border-[#cfd4dc] bg-[#f3f4f6] p-2 shadow-[0_8px_24px_rgba(15,23,42,0.14)]">
<div className="max-h-[348px] space-y-1 overflow-y-auto pr-1">
{displayModels.map((model) => (
<SelectItem
key={model.id}
value={model.id}
className={cn(
"h-12 rounded-2xl px-3 text-[#2f3640] [&>span]:hidden",
"h-11 rounded-2xl px-3 text-[#2f3640] [&>span:first-child]:hidden",
"focus:bg-[#dfe2e6] focus:text-[#1f2937]",
"data-[state=checked]:bg-[#dfe2e6] data-[state=checked]:text-[#1f2937]",
model.isSubModel ? "pl-8" : ""
)}
>
<div className="flex w-full items-center justify-between gap-3">
<div className="flex min-w-0 items-center gap-2.5">
<div className="h-7 w-7 overflow-hidden rounded-full border border-[#d4d9df] bg-white">
<span className="flex w-full items-center justify-between gap-3">
<span className="flex min-w-0 items-center gap-2.5">
<span className="h-6 w-6 overflow-hidden rounded-full border border-[#d4d9df] bg-white">
{model.avatarUrl ? (
<img
src={model.avatarUrl}
@ -1201,19 +1201,19 @@ function PureModelSelectorCompact({
className="h-full w-full object-cover"
/>
) : (
<div className="flex h-full w-full items-center justify-center text-[10px] font-medium text-[#6b7280]">
<span className="flex h-full w-full items-center justify-center text-[10px] font-medium text-[#6b7280]">
{model.id === "auto" ? "A" : model.displayName.slice(0, 1)}
</div>
</span>
)}
</div>
<div className="truncate text-[15px] font-medium leading-none">
</span>
<span className="truncate text-[14px] font-medium leading-none">
{model.isSubModel ? `└ ${model.displayName}` : model.displayName}
</div>
</div>
</span>
</span>
{selectedModel?.id === model.id ? (
<span className="text-base font-semibold text-[#1f2937]">✓</span>
) : null}
</div>
</span>
</SelectItem>
))}
</div>