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 91483c865..077a53437 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 @@ -25,23 +25,20 @@ type DesignAgentSurfaceProps = { onRetry: () => void; }; -export function DesignAgentSurface({ +type DesignAgentControlsProps = Pick< + DesignAgentSurfaceProps, + 'view' | 'busy' | 'error' | 'onApprove' | 'onClarify' | 'onRetry' +>; + +export function DesignAgentPhaseStatus({ view, - busy, error, - onApprove, - onClarify, onRetry, -}: DesignAgentSurfaceProps) { - const [clarifyText, setClarifyText] = useState(''); + busy, +}: DesignAgentControlsProps) { const phase = view?.session.currentPhase ?? 'concept'; - const pending = view?.session.pendingApproval; - const clarification = view?.session.pendingClarification; - useLayoutEffect(() => { - setClarifyText(''); - }, [clarification?.requestId]); return ( -
+
当前阶段 @@ -54,6 +51,42 @@ export function DesignAgentSurface({ ) : null}
{error ?

{error}

: null} + {view?.canRetry ? ( + + ) : null} +
+ ); +} + +export function DesignAgentPendingActions({ + view, + busy, + onApprove, + onClarify, +}: DesignAgentControlsProps) { + const [clarifyText, setClarifyText] = useState(''); + const phase = view?.session.currentPhase ?? 'concept'; + const pending = view?.session.pendingApproval; + const clarification = view?.session.pendingClarification; + useLayoutEffect(() => { + setClarifyText(''); + }, [clarification?.requestId]); + if (!pending || phase === 'consultant') { + if (!clarification) return null; + } + return ( +
{pending && phase !== 'consultant' ? (

当前阶段产物已提交,是否批准进入下一阶段?

@@ -110,17 +143,26 @@ export function DesignAgentSurface({
) : null} - {view?.canRetry ? ( - - ) : null}
); } + +export function DesignAgentSurface({ + view, + busy, + error, + onApprove, + onClarify, + onRetry, +}: DesignAgentSurfaceProps) { + return ( + + ); +} 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 41bb6d564..a42ef3ab1 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 @@ -33,7 +33,10 @@ import { ConversationModelSelect, type ConversationModelSelectHandle, } from './ConversationModelSelect'; -import { DesignAgentSurface } from './DesignAgentSurface'; +import { + DesignAgentPendingActions, + DesignAgentPhaseStatus, +} from './DesignAgentSurface'; import { PlanGddSurface } from './GddApprovalCard'; import { pendingCommandDetail, @@ -178,7 +181,7 @@ export function ProjectSupervisorView({ >
{designView || onDesignApprove ? ( -
) : null} + {designView || onDesignApprove ? ( + undefined)} + onClarify={onDesignClarify ?? (() => undefined)} + onRetry={onDesignRetry ?? (() => undefined)} + /> + ) : null}
{ diff --git a/apps/ai-game-creator-shell/src/styles.css b/apps/ai-game-creator-shell/src/styles.css index 1e7d46c69..3496054f5 100644 --- a/apps/ai-game-creator-shell/src/styles.css +++ b/apps/ai-game-creator-shell/src/styles.css @@ -8521,6 +8521,12 @@ button.design-workspace-tree__entry:hover, padding: 0; } +.design-agent-pending-actions { + display: grid; + gap: 10px; + margin-top: 2px; +} + .design-agent-approval p, .design-agent-clarify p { margin: 0;