From fbf8d34f45bf1ebc5856fa98203cff7b661832cd Mon Sep 17 00:00:00 2001 From: Linghong Date: Tue, 15 Sep 2026 12:14:03 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20AGC=20=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E7=AD=96=E5=88=92=E8=A1=A5=E5=85=A8=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 首页做游戏入口增加策划补全勾选项 勾选后复用 planning Agent Runtime 启动模式 补充首页启动模式回归测试与实施计划 --- .../src/view/home/homeStartMode.ts | 12 +++++++ .../src/view/home/index.tsx | 31 ++++++++++++++++--- .../tests/homeStartMode.test.ts | 18 +++++++++++ ...实施计划】AGC首页策划补全入口-2026-09-15.md | 16 ++++++++++ ...里程碑】AGC首页策划补全入口-2026-09-15.md | 20 ++++++++++++ 5 files changed, 93 insertions(+), 4 deletions(-) create mode 100644 apps/ai-game-creator-shell/src/view/home/homeStartMode.ts create mode 100644 apps/ai-game-creator-shell/tests/homeStartMode.test.ts create mode 100644 docs/project-memory/plans/【实施计划】AGC首页策划补全入口-2026-09-15.md create mode 100644 docs/project-memory/plans/【里程碑】AGC首页策划补全入口-2026-09-15.md diff --git a/apps/ai-game-creator-shell/src/view/home/homeStartMode.ts b/apps/ai-game-creator-shell/src/view/home/homeStartMode.ts new file mode 100644 index 000000000..4724c1066 --- /dev/null +++ b/apps/ai-game-creator-shell/src/view/home/homeStartMode.ts @@ -0,0 +1,12 @@ +import type { ProjectStartMode } from '../../app/types'; +import type { HomeCreationType } from './useHomeDraftStore'; + +export function resolveHomeStartMode( + creationType: HomeCreationType, + planningCompletionEnabled: boolean, +): ProjectStartMode { + return creationType === 'doc' || + (creationType === 'game' && planningCompletionEnabled) + ? 'planning' + : 'direct-build'; +} diff --git a/apps/ai-game-creator-shell/src/view/home/index.tsx b/apps/ai-game-creator-shell/src/view/home/index.tsx index d1470cb25..74f596b64 100644 --- a/apps/ai-game-creator-shell/src/view/home/index.tsx +++ b/apps/ai-game-creator-shell/src/view/home/index.tsx @@ -20,6 +20,7 @@ import { richTextToAttachments, richTextToPrompt, } from './components/RichInputArea/richTextToPrompt'; +import { resolveHomeStartMode } from './homeStartMode'; import InspirationGallery from './InspirationGallery'; import { type HomeCreationType, @@ -145,14 +146,18 @@ export default function HomeView({ (state) => state.setRichText, ); const [homeCreationBusy, setHomeCreationBusy] = useState(false); + const [planningCompletionEnabled, setPlanningCompletionEnabled] = + useState(false); const homeCreationBusyRef = useRef(false); const activeCreationType = HOME_CREATION_TYPE_ITEMS.find( (item) => item.creationType === homeCreationType, ) ?? HOME_CREATION_TYPE_ITEMS[0]!; // 做方案走立项策划链路,做游戏 / 做素材维持既有的直接开建路由。 - const startMode: ProjectStartMode = - homeCreationType === 'doc' ? 'planning' : 'direct-build'; + const startMode = resolveHomeStartMode( + homeCreationType, + planningCompletionEnabled, + ); async function createFromHome() { if (homeCreationBusyRef.current || creationBusy) { @@ -241,7 +246,12 @@ export default function HomeView({ type="button" key={item.creationType} aria-pressed={isActive} - onClick={() => setHomeCreationType(item.creationType)} + onClick={() => { + setHomeCreationType(item.creationType); + if (item.creationType !== 'game') { + setPlanningCompletionEnabled(false); + } + }} >