diff --git a/apps/ai-game-creator-shell/src/features/project-workspace/GddApprovalCard.tsx b/apps/ai-game-creator-shell/src/features/project-workspace/GddApprovalCard.tsx index 12c298131..ceda1bf76 100644 --- a/apps/ai-game-creator-shell/src/features/project-workspace/GddApprovalCard.tsx +++ b/apps/ai-game-creator-shell/src/features/project-workspace/GddApprovalCard.tsx @@ -25,6 +25,60 @@ const stateLabels: Record = { rejected: '已退回', }; +function stageProgressVisible( + state: PlanGddStateViewV1 | null, + active: boolean, +) { + return Boolean(state && (active || state.state !== 'not_started')); +} + +function approvalCardVisible(state: PlanGddStateViewV1 | null) { + return Boolean( + state?.displayGdd && (state.pendingApproval || state.recoveryPending), + ); +} + +/** + * 策划区的外壳:阶段进度是它的标题栏,审批卡是它的正文。 + * + * 两者原本各画一个带边框的盒子,叠在一起时「立项策划 / 状态」在标题栏和卡头各出现 + * 一次。合成一个面之后卡头只剩游戏标题和一句话,状态与版本只在标题栏画一遍。两个 + * 挂载点都从这里进,不再各自拼装。 + */ +export function PlanGddSurface({ + state, + active = false, + busy, + error, + onRefresh, + onDecision, +}: GddApprovalCardProps & { active?: boolean }) { + const showProgress = stageProgressVisible(state, active); + const showCard = approvalCardVisible(state); + if (!showProgress && !showCard) { + return null; + } + return ( +
+ {showProgress ? ( + + ) : null} + {showCard ? ( + + ) : null} +
+ ); +} + export function PlanGddStageProgress({ state, active = false, @@ -32,7 +86,7 @@ export function PlanGddStageProgress({ state: PlanGddStateViewV1 | null; active?: boolean; }) { - if (!state || (!active && state.state === 'not_started')) { + if (!state || !stageProgressVisible(state, active)) { return null; } const latestVersion = @@ -156,10 +210,7 @@ export function GddApprovalCard({ const [comment, setComment] = useState(''); const [gddDetailsOpen, setGddDetailsOpen] = useState(false); - if ( - !state?.displayGdd || - (!state.pendingApproval && !state.recoveryPending) - ) { + if (!state?.displayGdd || !approvalCardVisible(state)) { return null; } @@ -187,22 +238,10 @@ export function GddApprovalCard({ return (
-
- 立项策划 -

{gdd.game.title || `Fast GDD v${gdd.version}`}

-

{gdd.game.oneLiner}

-
- - {stateLabels[state.state]} - +

{gdd.game.title || `Fast GDD v${gdd.version}`}

+

{gdd.game.oneLiner}

-
- {`版本 v${gdd.version}`} - {`指纹 ${gdd.fingerprint.slice(0, 12)}…`} - {`${gdd.decisions.length} 项决定`} -
- {gdd.decisions.length > 0 ? (
{gdd.decisions.map((decision) => ( @@ -349,6 +388,12 @@ export function GddApprovalCard({

{section.content}

))} + + {`Fast GDD v${gdd.version} · ${gdd.fingerprint}`} +