diff --git a/web/src/components/model-logo.tsx b/web/src/components/model-logo.tsx index b67ad7542..0531c3084 100644 --- a/web/src/components/model-logo.tsx +++ b/web/src/components/model-logo.tsx @@ -1,5 +1,5 @@ import { useEffect, useMemo, useRef, useState, type ComponentType, type SVGProps } from "react"; -import { Input, Popover } from "antd"; +import { Button, Input, Modal } from "antd"; import { Cpu, Search, X } from "lucide-react"; import { toc } from "@lobehub/icons/es/toc"; @@ -69,7 +69,7 @@ export function ModelIconPicker({ value, onChange }: { value?: string; onChange? useEffect(() => { if (open) { - const timer = setTimeout(() => searchInputRef.current?.focus(), 50); + const timer = setTimeout(() => searchInputRef.current?.focus(), 100); return () => clearTimeout(timer); } else { setKeyword(""); @@ -81,101 +81,108 @@ export function ModelIconPicker({ value, onChange }: { value?: string; onChange? return query ? iconOptions.filter((item) => `${item.id} ${item.title}`.toLowerCase().includes(query)) : iconOptions; }, [keyword]); - const content = ( -
event.stopPropagation()} - onClick={(event) => event.stopPropagation()} - > -
- } - value={keyword} - onChange={(event) => setKeyword(event.target.value)} - placeholder="搜索 Logo 名称或品牌..." - allowClear - /> - {value ? ( - - ) : null} -
-
event.stopPropagation()} - > - {filteredIcons.length ? ( - filteredIcons.map((item) => { - const selected = value === item.id; - return ( - - ); - }) - ) : ( -
- 未找到与 “{keyword}” 相关的 Logo -
- )} -
-
- 共 {filteredIcons.length} 个可用 Logo - 点击即选定并应用 -
-
- ); + const selectedOption = useMemo(() => (value ? iconOptions.find((item) => item.id === value) : undefined), [value]); return ( - trigger.closest(".ant-modal-content, .ant-drawer-content, .admin-modal, body") || document.body} - classNames={{ root: "model-logo-picker-popover" }} - content={content} - > + <> - + + setOpen(false)} + width={540} + centered + destroyOnClose + footer={ +
+ 共 {filteredIcons.length} 个可用 Logo +
+ {value ? ( + + ) : null} + +
+
+ } + > +
+ } + value={keyword} + onChange={(event) => setKeyword(event.target.value)} + placeholder="搜索品牌或模型名称(如 OpenAI, Claude, Google, Flux...)" + allowClear + /> +
+ {filteredIcons.length ? ( + filteredIcons.map((item) => { + const selected = value === item.id; + return ( + + ); + }) + ) : ( +
+ 未找到与 “{keyword}” 相关的 Logo +
+ )} +
+
+
+ ); } diff --git a/web/test/project-chapter-storyboard.test.ts b/web/test/project-chapter-storyboard.test.ts index 808f38cdc..e75146d9e 100644 --- a/web/test/project-chapter-storyboard.test.ts +++ b/web/test/project-chapter-storyboard.test.ts @@ -15,7 +15,7 @@ describe("章节分镜写入分镜制作", () => { expect(shots).toHaveLength(1); expect(shots[0]).toMatchObject({ - title: "SC.01", + title: "镜头01", description: "林默推门进入雨夜的旧屋。", durationMs: 5000, revision: {