diff --git a/src/components/agent/chat/hooks/agentChatShared.ts b/src/components/agent/chat/hooks/agentChatShared.ts index 39795875c..e8b65c0b0 100644 --- a/src/components/agent/chat/hooks/agentChatShared.ts +++ b/src/components/agent/chat/hooks/agentChatShared.ts @@ -130,7 +130,7 @@ function extractToolCallPreview(message: Message): string { if (latestToolCall.status === "failed") { return `执行失败:${toolName}`; } - if (latestToolCall.status === "streaming") { + if (latestToolCall.status === "running") { return `正在执行:${toolName}`; } return `最近执行:${toolName}`; diff --git a/src/components/image-gen/tabs/AiImageGenTab.tsx b/src/components/image-gen/tabs/AiImageGenTab.tsx index 6e9955a4e..fc05eabc2 100644 --- a/src/components/image-gen/tabs/AiImageGenTab.tsx +++ b/src/components/image-gen/tabs/AiImageGenTab.tsx @@ -34,14 +34,14 @@ import { useActiveSkill } from "@/components/agent/chat/components/Inputbar/hook import { skillsApi, type Skill } from "@/lib/api/skills"; import { useGlobalMediaGenerationDefaults } from "@/hooks/useGlobalMediaGenerationDefaults"; import { resolveMediaGenerationPreference } from "@/lib/mediaGeneration"; -import type { Page } from "@/types/page"; +import type { Page, PageParams } from "@/types/page"; import { SettingsTabs } from "@/types/settings"; export interface AiImageGenTabProps { /** 目标项目 ID(可选) */ projectId?: string | null; /** 导航回调 */ - onNavigate?: (page: Page) => void; + onNavigate?: (page: Page, params?: PageParams) => void; } type ResolutionPreset = "1k" | "2k" | "4k"; diff --git a/src/components/projects/ProjectSelector.tsx b/src/components/projects/ProjectSelector.tsx index 4d505547c..f706d58d9 100644 --- a/src/components/projects/ProjectSelector.tsx +++ b/src/components/projects/ProjectSelector.tsx @@ -36,7 +36,8 @@ import { import { ScrollArea } from "@/components/ui/scroll-area"; import { useProjects } from "@/hooks/useProjects"; import type { ProjectType } from "@/lib/api/project"; -import { USER_PROJECT_TYPES, getProjectTypeLabel } from "@/lib/api/project"; +import { USER_PROJECT_TYPES } from "@/lib/api/project"; +import { WorkspaceTypeLabels } from "@/types/workspace"; import { cn } from "@/lib/utils"; import { CreateProjectDialog } from "./CreateProjectDialog"; import { @@ -328,7 +329,9 @@ export function ProjectSelector({ : null; const projectSummaryBadges = [ selectedProject?.isDefault ? "默认项目" : "普通项目", - selectedProject ? getProjectTypeLabel(selectedProject.workspaceType) : "待选择", + selectedProject + ? WorkspaceTypeLabels[selectedProject.workspaceType] + : "待选择", ]; return ( @@ -462,7 +465,7 @@ export function ProjectSelector({ variant="outline" className="border-slate-200/80 bg-white/80 text-[10px] text-slate-600" > - {getProjectTypeLabel(project.workspaceType)} + {WorkspaceTypeLabels[project.workspaceType]} {project.tags.slice(0, 2).map((tag) => ( ({ deleteOutlineNode: mockDeleteOutlineNode, buildOutlineTree: vi.fn((nodes: Array>) => { const byId = new Map( - nodes.map((node) => [String(node.id), { ...node, children: [] as Array> }]), + nodes.map((node) => [ + String(node.id), + { ...node, children: [] } as OutlineTreeNodeMock, + ]), ); - const roots: Array> = []; + const roots: OutlineTreeNodeMock[] = []; byId.forEach((node) => { const parentId = typeof node.parent_id === "string" ? node.parent_id : undefined;