diff --git a/docs/content/docs/progress/pending-test.mdx b/docs/content/docs/progress/pending-test.mdx index a842e71a7..2d0fc3fdb 100644 --- a/docs/content/docs/progress/pending-test.mdx +++ b/docs/content/docs/progress/pending-test.mdx @@ -5,6 +5,12 @@ description: 当前项目已实现功能的手工验证清单与未确认边界 # 待测试 +## Agent 对话模型选择器复用创造页样式 + +- Agent 底部 Composer 与设置页「对话模型」改为复用画布节点 / 创造页的 `ModelPicker` `variant="creation"`:先选品牌、再选模型,不再把品牌挤成一行。 +- 目录只展示文本模型;图片、视频、音频模型不进入 Agent 对话选择。当前选中若不是文本模型,回退到第一个可用文本模型。 +- 待登录后打开画布 Agent:核对品牌列表为纵向卡片、点入后出现双栏模型列表且高度跟品牌列表走、不再被 300px 最小高度撑空;设置页同样;深浅主题与窄面板不裁切。 + ## 设置页页头与生成偏好精简 - 设置页去掉「创作偏好 / 配置默认模型、生成参数和素材存储。」页头;仅在 `?continue=1` 时保留返回创作按钮。 diff --git a/web/src/components/canvas/canvas-cloud-agent-panel.tsx b/web/src/components/canvas/canvas-cloud-agent-panel.tsx index 297c1dd17..f72038b01 100644 --- a/web/src/components/canvas/canvas-cloud-agent-panel.tsx +++ b/web/src/components/canvas/canvas-cloud-agent-panel.tsx @@ -21,7 +21,7 @@ import type { AgentMediaSettings } from "@/services/api/agent"; import { CanvasAgentImageApprovalSettings } from "./canvas-agent-image-approval-settings"; import { addSkill, listAddedSkills, listSkills, type Skill, type SkillCategory } from "@/services/api/skills"; import { clearCloudAgentPendingSubmission, cloudAgentConversationTitle, loadCloudAgentConversations, loadCloudAgentPendingSubmission, saveCloudAgentConversations, saveCloudAgentPendingSubmission, type CloudAgentConversation, type CloudAgentPendingSubmission } from "@/services/cloud-agent-conversations"; -import { logicalModelIDForConfig, modelOptionName, resolveModelRequestConfig, useConfigStore, useEffectiveConfig } from "@/stores/use-config-store"; +import { logicalModelIDForConfig, modelOptionName, resolveModelRequestConfig, selectableModelsByCapability, useConfigStore, useEffectiveConfig } from "@/stores/use-config-store"; import { useActiveTheme } from "@/stores/canvas/use-canvas-theme-store"; import { applyAgentCanvasPatches, refreshCanvasAfterAgent, saveRemoteUserDataNow } from "@/services/user-data-sync"; import { createAgentCanvasSync } from "@/services/agent-canvas-sync"; @@ -99,7 +99,11 @@ export function CanvasCloudAgentPanel({ canvasId, domainProjectId, nodeCount, re const currentScope = useRef(conversationScope); currentScope.current = conversationScope; const running = Boolean(run?.cleanupPending) || run?.status === "running" || run?.status === "queued" || run?.status === "waiting_approval"; - const selectedModel = config.textModel || config.model || ""; + const selectedModel = useMemo(() => { + const textModels = selectableModelsByCapability(config, "text"); + const preferred = config.textModel || config.model || ""; + return textModels.includes(preferred) ? preferred : (textModels[0] || ""); + }, [config]); const reasoningSupported = Boolean(modelCapabilityConfigFor(config, selectedModel).text?.thinking); useEffect(() => { if (!reasoningSupported && reasoningMode !== "off") setReasoningMode("off"); }, [reasoningSupported, reasoningMode]); const installedSkills = useMemo(() => skills.filter((skill) => skill.isAdded), [skills]); @@ -946,11 +950,12 @@ function ComposerControls({ value={selectedModel} capability="text" onChange={onModelChange} + variant="creation" className="!h-8 !min-w-0 !w-36 !max-w-full !border-0 !bg-transparent !px-1.5 !shadow-none" popoverClassName="agent-model-picker-popover" showSelectedPrice={false} showOptionPrices - placeholder="选择模型" + placeholder="选择文本模型" /> {reasoningSupported ?