diff --git a/apps/ai-game-creator-shell/src/App.tsx b/apps/ai-game-creator-shell/src/App.tsx index e6d659cea..0bb65ee89 100644 --- a/apps/ai-game-creator-shell/src/App.tsx +++ b/apps/ai-game-creator-shell/src/App.tsx @@ -55,7 +55,6 @@ import type { DesignClarificationRequest, DesignEvent, DesignView, - DesignWorkspaceEntry, GameCreatorAgentRuntimeUpdateEvent, GameCreatorChatAgentReply, GameCreatorDirectTurnUpdateEvent, @@ -569,13 +568,6 @@ export function App({ projectPath: string; clientTurnId: string; } | null>(null); - const [designWorkspaceFiles, setDesignWorkspaceFiles] = useState< - DesignWorkspaceEntry[] - >([]); - const [designPreviewPath, setDesignPreviewPath] = useState( - null, - ); - const [designPreviewText, setDesignPreviewText] = useState(''); // 做方案入口独立成链:立项策划需要委派、澄清 pending 与 GDD 审批,这些只存在于 // Supervisor Runtime;direct-codex 是单回合「生成→试玩→修」循环,没有对应机制。 // 因此策划入口不走产品默认的 direct-codex,做游戏与做素材保持 master 的新默认。 @@ -895,26 +887,6 @@ export function App({ latestMessagesRef.current = conversation; } - async function refreshDesignWorkspace(nextProjectPath: string) { - const invoke = resolveTauriInvoke(); - if (!invoke || !nextProjectPath.trim()) { - return; - } - try { - const files = await invoke( - 'list_design_workspace', - { projectPath: nextProjectPath }, - ); - if (localProjectPathRef.current === nextProjectPath) { - setDesignWorkspaceFiles(files); - } - } catch { - if (localProjectPathRef.current === nextProjectPath) { - setDesignWorkspaceFiles([]); - } - } - } - async function hydrateDesignAgentSession(nextProjectPath: string) { const invoke = resolveTauriInvoke(); if (!invoke || !nextProjectPath.trim()) { @@ -931,7 +903,6 @@ export function App({ return null; } applyDesignView(view, nextProjectPath); - await refreshDesignWorkspace(nextProjectPath); return view; } @@ -962,7 +933,6 @@ export function App({ return; } applyDesignView(view, nextProjectPath); - await refreshDesignWorkspace(nextProjectPath); } catch (error) { if (localProjectPathRef.current !== nextProjectPath) { return; @@ -1472,9 +1442,6 @@ export function App({ designAgentLaneRef.current = planningStartMode; designAgentTurnRef.current = null; setDesignAgentView(null); - setDesignWorkspaceFiles([]); - setDesignPreviewPath(null); - setDesignPreviewText(''); } function syncTerminalProjectSupervisorConversation( @@ -1924,7 +1891,6 @@ export function App({ } if (payload.view) { applyDesignView(payload.view, payload.projectPath); - void refreshDesignWorkspace(payload.projectPath); } }) .then((unlisten) => { @@ -1939,8 +1905,8 @@ export function App({ disposed = true; cleanup?.(); }; - // applyDesignView / refreshDesignWorkspace 读的是 refs 和当前项目路径, - // 把它们写进依赖会在每轮回复时重订事件。 + // applyDesignView 读的是 refs 和当前项目路径, + // 把它写进依赖会在每轮回复时重订事件。 // eslint-disable-next-line react-hooks/exhaustive-deps }, [planningV2Active]); @@ -11660,9 +11626,6 @@ export function App({ onPlanGddDecision={decidePlanGdd} planningLane={planningV2Active} designView={useDesignAgentSurface ? designAgentView : null} - designFiles={designWorkspaceFiles} - designPreviewPath={designPreviewPath} - designPreviewText={designPreviewText} onDesignApprove={ useDesignAgentSurface ? (requestId, approved) => { @@ -11687,7 +11650,6 @@ export function App({ }) .then((view) => { applyDesignView(view, nextProjectPath); - return refreshDesignWorkspace(nextProjectPath); }) .catch((error) => { setPlanGddError(String(error)); @@ -11737,28 +11699,6 @@ export function App({ } : undefined } - onDesignOpenFile={ - useDesignAgentSurface - ? (path) => { - const nextProjectPath = resolveChatProjectPath(localProject); - const invoke = resolveTauriInvoke(); - if (!nextProjectPath || !invoke) { - return; - } - void invoke('read_design_workspace_file', { - projectPath: nextProjectPath, - path, - }).then((text) => { - setDesignPreviewPath(path); - setDesignPreviewText(text); - }); - } - : undefined - } - onDesignClosePreview={() => { - setDesignPreviewPath(null); - setDesignPreviewText(''); - }} onMakeGameFromApprovedGdd={ onMakeGameFromApprovedGdd ? () => diff --git a/apps/ai-game-creator-shell/src/features/project-workspace/DesignAgentSurface.tsx b/apps/ai-game-creator-shell/src/features/project-workspace/DesignAgentSurface.tsx index 64851c1b0..78c586fa7 100644 --- a/apps/ai-game-creator-shell/src/features/project-workspace/DesignAgentSurface.tsx +++ b/apps/ai-game-creator-shell/src/features/project-workspace/DesignAgentSurface.tsx @@ -1,11 +1,7 @@ import { Check, RotateCcw, X } from 'lucide-react'; import { useLayoutEffect, useState } from 'react'; -import type { - DesignClarificationRequest, - DesignView, - DesignWorkspaceEntry, -} from '../../app/types'; +import type { DesignClarificationRequest, DesignView } from '../../app/types'; const PHASE_LABELS: Record = { concept: '概念设计', @@ -18,9 +14,6 @@ const PHASE_LABELS: Record = { type DesignAgentSurfaceProps = { view: DesignView | null; - files: DesignWorkspaceEntry[]; - previewPath: string | null; - previewText: string; busy: boolean; error: string | null; onApprove: (requestId: string, approved: boolean) => void; @@ -31,8 +24,6 @@ type DesignAgentSurfaceProps = { ) => void; onRetry: () => void; onMakeGame: () => void; - onOpenFile: (path: string) => void; - onClosePreview: () => void; }; export function DesignAgentSurface({ diff --git a/apps/ai-game-creator-shell/src/features/project-workspace/ProjectSupervisorView.tsx b/apps/ai-game-creator-shell/src/features/project-workspace/ProjectSupervisorView.tsx index 10a3c515c..ebbc51866 100644 --- a/apps/ai-game-creator-shell/src/features/project-workspace/ProjectSupervisorView.tsx +++ b/apps/ai-game-creator-shell/src/features/project-workspace/ProjectSupervisorView.tsx @@ -18,11 +18,7 @@ import type { PlanGddDecisionAction, PlanGddStateViewV1, } from '../../app/types'; -import type { - DesignClarificationRequest, - DesignView, - DesignWorkspaceEntry, -} from '../../app/types'; +import type { DesignClarificationRequest, DesignView } from '../../app/types'; import { ChatMarkdownMessage } from '../../components/ChatMarkdownMessage'; import { projectProfessionalAgentLabel, @@ -106,9 +102,6 @@ type ProjectSupervisorViewProps = RuntimePanelProps & { ) => Promise; onMakeGameFromApprovedGdd?: () => Promise; designView?: DesignView | null; - designFiles?: DesignWorkspaceEntry[]; - designPreviewPath?: string | null; - designPreviewText?: string; onDesignApprove?: (requestId: string, approved: boolean) => void; onDesignClarify?: ( question: DesignClarificationRequest, @@ -117,8 +110,6 @@ type ProjectSupervisorViewProps = RuntimePanelProps & { ) => void; onDesignRetry?: () => void; onDesignMakeGame?: () => void; - onDesignOpenFile?: (path: string) => void; - onDesignClosePreview?: () => void; }; export function ProjectSupervisorView({ @@ -156,15 +147,10 @@ export function ProjectSupervisorView({ onPlanGddDecision, onMakeGameFromApprovedGdd, designView = null, - designFiles = [], - designPreviewPath = null, - designPreviewText = '', onDesignApprove, onDesignClarify, onDesignRetry, onDesignMakeGame, - onDesignOpenFile, - onDesignClosePreview, ...runtimePanelProps }: ProjectSupervisorViewProps) { const planningSurfaceActive = @@ -196,17 +182,12 @@ export function ProjectSupervisorView({ {designView || onDesignApprove ? ( undefined)} onClarify={onDesignClarify ?? (() => undefined)} onRetry={onDesignRetry ?? (() => undefined)} onMakeGame={onDesignMakeGame ?? (() => undefined)} - onOpenFile={onDesignOpenFile ?? (() => undefined)} - onClosePreview={onDesignClosePreview ?? (() => undefined)} /> ) : (