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 f60c95354..6c6b2718e 100644 --- a/apps/ai-game-creator-shell/src/view/home/index.tsx +++ b/apps/ai-game-creator-shell/src/view/home/index.tsx @@ -2,6 +2,8 @@ import { FileText, FolderKanban, FolderOpen, + Gamepad2, + type LucideIcon, Plus, Sparkles, } from 'lucide-react'; @@ -19,6 +21,31 @@ import { type HomeDraft, useLauncherHomeDraftStore } from './useHomeDraftStore'; export type { HomeAttachmentDraft, HomeDraft } from './useHomeDraftStore'; +// 首页只在做游戏与做方案之间分叉:做素材已被 master 并进直连构建,与做游戏同链, +// 再列一枚 chip 就是两个按钮干同一件事。做方案要委派子 Agent、挂澄清 pending、过 +// GDD 审批,是另一条 runtime 链,必须在建项目之前就把 startMode 定下来,所以两个 +// 选项都常驻可见,而不是拿一枚开关把默认态藏起来。 +const HOME_START_MODES: readonly ProjectStartMode[] = [ + 'direct-build', + 'planning', +]; + +const HOME_START_MODE_ITEMS: Record< + ProjectStartMode, + { label: string; placeholder: string; icon: LucideIcon } +> = { + 'direct-build': { + label: '做游戏', + placeholder: '今天想把什么灵感做成游戏', + icon: Gamepad2, + }, + planning: { + label: '做方案', + placeholder: '今天有什么设计需要帮你整理', + icon: FileText, + }, +}; + export type HomeProjectRow = { path: string; name: string; @@ -56,13 +83,8 @@ export default function HomeView({ ); const [homeCreationBusy, setHomeCreationBusy] = useState(false); const homeCreationBusyRef = useRef(false); - // 首页只保留「做方案」一个开关:做游戏 / 做素材 沿用 master 的直连默认,走 - // direct-build;立项策划要委派子 Agent、挂澄清 pending、过 GDD 审批,只能由 - // planning 起链,所以必须在建项目之前就把 startMode 定下来。 - const [planningSelected, setPlanningSelected] = useState(false); - const startMode: ProjectStartMode = planningSelected - ? 'planning' - : 'direct-build'; + const [startMode, setStartMode] = useState('direct-build'); + const activeStartMode = HOME_START_MODE_ITEMS[startMode]; async function createFromHome() { if (homeCreationBusyRef.current) { @@ -118,6 +140,34 @@ export default function HomeView({

+
+ {HOME_START_MODES.map((mode) => { + const item = HOME_START_MODE_ITEMS[mode]; + const ModeIcon = item.icon; + const isActive = mode === startMode; + return ( + + ); + })} +
{status} @@ -127,38 +177,20 @@ export default function HomeView({ > { void createFromHome(); }} >
- - - - +