From 95c16a4168791f2fc18e4cb63aa9f476c3218205 Mon Sep 17 00:00:00 2001 From: kvtodev Date: Mon, 13 Jul 2026 19:08:00 +0800 Subject: [PATCH 1/6] extract home view from App.tsx , rewrite style with tailwindcss --- apps/ai-game-creator-shell/package.json | 2 + apps/ai-game-creator-shell/src/App.tsx | 219 ++------- apps/ai-game-creator-shell/src/styles.css | 416 +----------------- .../src/view/home/index.tsx | 307 +++++++++++++ apps/ai-game-creator-shell/vite.config.ts | 2 + 5 files changed, 345 insertions(+), 601 deletions(-) create mode 100644 apps/ai-game-creator-shell/src/view/home/index.tsx diff --git a/apps/ai-game-creator-shell/package.json b/apps/ai-game-creator-shell/package.json index 74f901d6f..a646241ab 100644 --- a/apps/ai-game-creator-shell/package.json +++ b/apps/ai-game-creator-shell/package.json @@ -21,9 +21,11 @@ "vite": "^6.2.0" }, "devDependencies": { + "@tailwindcss/vite": "^4.1.14", "@tauri-apps/cli": "^2.11.2", "@types/react": "^19.2.14", "@types/react-dom": "^19.2.3", + "tailwindcss": "^4.1.14", "typescript": "~5.8.2" } } diff --git a/apps/ai-game-creator-shell/src/App.tsx b/apps/ai-game-creator-shell/src/App.tsx index e42f5e595..df134d4ff 100644 --- a/apps/ai-game-creator-shell/src/App.tsx +++ b/apps/ai-game-creator-shell/src/App.tsx @@ -23,14 +23,16 @@ import { Image, LogOut, MessageSquare, - Plus, Settings, - Sparkles, - Upload, User, - X, Zap, } from 'lucide-react'; +import HomeView, { + type HomeAgentMode, + type HomeAgentModeItem, + type HomeAttachmentDraft, + type HomeShowcaseResource, +} from './view/home'; import type { AuthEntryResponse, @@ -105,13 +107,6 @@ type LauncherView = | 'contact' | 'news' | 'project-development'; -type HomeAgentMode = 'game' | 'art' | 'doc'; - -type HomeAttachmentDraft = { - id: string; - file: File; -}; - type LauncherImportedAttachment = { fileName: string; mediaType: string; @@ -149,7 +144,7 @@ type PendingNonEmptyProject = projectPath: string; }; -type EditorShowcaseResource = { +type EditorShowcaseResource = HomeShowcaseResource & { resourceId: string; showcaseId?: string | null; label?: string | null; @@ -1267,13 +1262,7 @@ function listClientShowcaseResources() { ); } -const homeAgentModeItems: Array<{ - mode: HomeAgentMode; - label: string; - placeholder: string; - emptyPrompt: string; - icon: typeof Gamepad2; -}> = [ +const homeAgentModeItems: HomeAgentModeItem[] = [ { mode: 'game', label: '做游戏', @@ -3189,10 +3178,6 @@ export function WorkspaceLauncher({ const recentProjectRows = projectRows .filter((project) => project.canOpen) .slice(0, 3); - const activeHomeMode = - homeAgentModeItems.find((item) => item.mode === homeAgentMode) ?? - homeAgentModeItems[0]!; - const ActiveHomeModeIcon = activeHomeMode.icon; const currentAgentChatAgent = selectedLauncherAgentChatAgent(); const currentAgentChatLlmWarning = getCurrentAgentChatLlmWarning( currentAgentChatAgent, @@ -3407,171 +3392,29 @@ export function WorkspaceLauncher({ {launcherView === 'home' ? ( - <> -
-
- - -
-

陶泥儿 GameAgent

-

{activeHomeMode.placeholder}

-
-
-
- {homeAgentModeItems.map((item) => { - const ModeIcon = item.icon; - return ( - - ); - })} -
-
-