feat: integrate project setup onboarding
Some checks failed
Electron E2E / Electron E2E (macos-latest) (push) Has been cancelled
Electron E2E / Electron E2E (ubuntu-latest) (push) Has been cancelled
Electron E2E / Electron E2E (windows-latest) (push) Has been cancelled

This commit is contained in:
2026-09-06 14:43:22 +08:00
17 changed files with 956 additions and 29 deletions

View File

@@ -14,6 +14,7 @@ import { useProjectConfigStore } from '@/stores/project-config';
import { useSettingsStore } from '@/stores/settings';
import { cn } from '@/lib/utils';
import type { SidebarPeekSource } from './sidebar-peek';
import { isCodingProjectConversationReady } from '../../../shared/coding-project-contracts';
const SIDEBAR_PEEK_CLOSE_DELAY_MS = 180;
@@ -88,7 +89,11 @@ export function MainLayout() {
if (activeProject && isProgrammingModule) void load(activeProject.id).catch(() => undefined);
}, [activeProject, isProgrammingModule, load]);
const initializationBlocked = Boolean(activeProject && (!config || !config.initialized) && !isInitializationSafeRoute);
const initializationBlocked = Boolean(
activeProject
&& (!config || !isCodingProjectConversationReady(config))
&& !isInitializationSafeRoute,
);
return (
<div data-testid="main-layout" className="relative flex h-[100dvh] flex-col overflow-hidden bg-transparent font-sans">
{/* Title bar: drag region on macOS, icon + controls on Windows */}
@@ -121,8 +126,8 @@ export function MainLayout() {
<div data-testid="project-initialization-gate" className="glass-surface absolute inset-0 z-[100] flex items-center justify-center bg-background/90 p-6">
<div className="surface-card max-w-md rounded-2xl border border-border/80 bg-background p-8 text-center shadow-float">
<LockKeyhole className="mx-auto h-10 w-10" />
<h1 className="mt-4 text-2xl font-semibold"></h1>
<p className="mt-3 text-sm font-medium text-muted-foreground"> Agent </p>
<h1 className="mt-4 text-2xl font-semibold"></h1>
<p className="mt-3 text-pretty text-sm font-medium leading-6 text-muted-foreground"></p>
<Button onClick={() => navigate('/project-config')} className="mt-6 border border-brand/20 bg-brand font-semibold text-primary-foreground"><Settings2 className="mr-2 h-4 w-4" /></Button>
</div>
</div>

View File

@@ -55,7 +55,10 @@ import { isCanonicalCodingProjectId } from '@/lib/coding-projects';
import type { CodingProjectSummary } from '@/types/coding-project';
import { useProjectConfigStore } from '@/stores/project-config';
import type { ProjectType } from '../../../shared/project-config';
import type { ProjectIdentityChoice } from '../../../shared/coding-project-contracts';
import {
isCodingProjectConversationReady,
type ProjectIdentityChoice,
} from '../../../shared/coding-project-contracts';
import { toast } from 'sonner';
type OpenDialogResult = {
@@ -439,7 +442,7 @@ export function Sidebar({ workspaceLayout = false, sidebarPeekOpen = false, onSi
return;
}
await setActiveProject(project.id);
navigate(result.config.initialized
navigate(isCodingProjectConversationReady(result.config)
? '/chat'
: projectConfigPath);
};