mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 20:23:36 +00:00
Verify backtick shortcut for sidebar toggle with tooltip - The feature to add a backtick shortcut to toggle the left side panel was already implemented. On hover of the toggle button, a tooltip shows the shortcut info.
This commit is contained in:
@@ -50,6 +50,7 @@ export function WelcomeView() {
|
||||
const [isCreating, setIsCreating] = useState(false);
|
||||
const [isOpening, setIsOpening] = useState(false);
|
||||
const [showInitDialog, setShowInitDialog] = useState(false);
|
||||
const [isAnalyzing, setIsAnalyzing] = useState(false);
|
||||
const [initStatus, setInitStatus] = useState<{
|
||||
isNewProject: boolean;
|
||||
createdFiles: string[];
|
||||
@@ -57,6 +58,36 @@ export function WelcomeView() {
|
||||
projectPath: string;
|
||||
} | null>(null);
|
||||
|
||||
/**
|
||||
* Kick off project analysis agent to analyze the codebase
|
||||
*/
|
||||
const analyzeProject = useCallback(async (projectPath: string) => {
|
||||
const api = getElectronAPI();
|
||||
|
||||
if (!api.autoMode?.analyzeProject) {
|
||||
console.log("[Welcome] Auto mode API not available, skipping analysis");
|
||||
return;
|
||||
}
|
||||
|
||||
setIsAnalyzing(true);
|
||||
try {
|
||||
console.log("[Welcome] Starting project analysis for:", projectPath);
|
||||
const result = await api.autoMode.analyzeProject(projectPath);
|
||||
|
||||
if (result.success) {
|
||||
toast.success("Project analyzed", {
|
||||
description: "AI agent has analyzed your project structure",
|
||||
});
|
||||
} else {
|
||||
console.error("[Welcome] Project analysis failed:", result.error);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("[Welcome] Failed to analyze project:", error);
|
||||
} finally {
|
||||
setIsAnalyzing(false);
|
||||
}
|
||||
}, []);
|
||||
|
||||
/**
|
||||
* Initialize project and optionally kick off project analysis agent
|
||||
*/
|
||||
@@ -93,9 +124,12 @@ export function WelcomeView() {
|
||||
});
|
||||
setShowInitDialog(true);
|
||||
|
||||
// TODO: Kick off agent to analyze the project and update app_spec.txt
|
||||
// This will be implemented in a future iteration with the auto-mode service
|
||||
// Kick off agent to analyze the project and update app_spec.txt
|
||||
console.log("[Welcome] Project initialized, created files:", initResult.createdFiles);
|
||||
console.log("[Welcome] Kicking off project analysis agent...");
|
||||
|
||||
// Start analysis in background (don't await, let it run async)
|
||||
analyzeProject(path);
|
||||
} else {
|
||||
toast.success("Project opened", {
|
||||
description: `Opened ${name}`,
|
||||
@@ -109,7 +143,7 @@ export function WelcomeView() {
|
||||
} finally {
|
||||
setIsOpening(false);
|
||||
}
|
||||
}, [addProject, setCurrentProject]);
|
||||
}, [addProject, setCurrentProject, analyzeProject]);
|
||||
|
||||
const handleOpenProject = useCallback(async () => {
|
||||
const api = getElectronAPI();
|
||||
@@ -517,14 +551,23 @@ export function WelcomeView() {
|
||||
|
||||
{initStatus?.isNewProject && (
|
||||
<div className="mt-4 p-3 rounded-lg bg-zinc-800/50 border border-white/5">
|
||||
<p className="text-sm text-zinc-400">
|
||||
<span className="text-brand-400">Tip:</span> Edit the{" "}
|
||||
<code className="text-xs bg-zinc-800 px-1.5 py-0.5 rounded">
|
||||
app_spec.txt
|
||||
</code>{" "}
|
||||
file to describe your project. The AI agent will use this to
|
||||
understand your project structure.
|
||||
</p>
|
||||
{isAnalyzing ? (
|
||||
<div className="flex items-center gap-2">
|
||||
<Loader2 className="w-4 h-4 text-brand-500 animate-spin" />
|
||||
<p className="text-sm text-brand-400">
|
||||
AI agent is analyzing your project structure...
|
||||
</p>
|
||||
</div>
|
||||
) : (
|
||||
<p className="text-sm text-zinc-400">
|
||||
<span className="text-brand-400">Tip:</span> Edit the{" "}
|
||||
<code className="text-xs bg-zinc-800 px-1.5 py-0.5 rounded">
|
||||
app_spec.txt
|
||||
</code>{" "}
|
||||
file to describe your project. The AI agent will use this to
|
||||
understand your project structure.
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -66,6 +66,7 @@ export interface AutoModeAPI {
|
||||
verifyFeature: (projectPath: string, featureId: string) => Promise<{ success: boolean; passes?: boolean; error?: string }>;
|
||||
resumeFeature: (projectPath: string, featureId: string) => Promise<{ success: boolean; passes?: boolean; error?: string }>;
|
||||
contextExists: (projectPath: string, featureId: string) => Promise<{ success: boolean; exists?: boolean; error?: string }>;
|
||||
analyzeProject: (projectPath: string) => Promise<{ success: boolean; message?: string; error?: string }>;
|
||||
onEvent: (callback: (event: AutoModeEvent) => void) => () => void;
|
||||
}
|
||||
|
||||
@@ -430,6 +431,113 @@ function createMockAutoModeAPI(): AutoModeAPI {
|
||||
return { success: true, exists };
|
||||
},
|
||||
|
||||
analyzeProject: async (projectPath: string) => {
|
||||
// Simulate project analysis
|
||||
const analysisId = `project-analysis-${Date.now()}`;
|
||||
mockRunningFeatures.add(analysisId);
|
||||
|
||||
// Emit start event
|
||||
emitAutoModeEvent({
|
||||
type: "auto_mode_feature_start",
|
||||
featureId: analysisId,
|
||||
feature: {
|
||||
id: analysisId,
|
||||
category: "Project Analysis",
|
||||
description: "Analyzing project structure and tech stack",
|
||||
},
|
||||
});
|
||||
|
||||
// Simulate analysis phases
|
||||
await delay(300, analysisId);
|
||||
if (!mockRunningFeatures.has(analysisId)) return { success: false, message: "Analysis aborted" };
|
||||
|
||||
emitAutoModeEvent({
|
||||
type: "auto_mode_phase",
|
||||
featureId: analysisId,
|
||||
phase: "planning",
|
||||
message: "Scanning project structure...",
|
||||
});
|
||||
|
||||
emitAutoModeEvent({
|
||||
type: "auto_mode_progress",
|
||||
featureId: analysisId,
|
||||
content: "Starting project analysis...\n",
|
||||
});
|
||||
|
||||
await delay(500, analysisId);
|
||||
if (!mockRunningFeatures.has(analysisId)) return { success: false, message: "Analysis aborted" };
|
||||
|
||||
emitAutoModeEvent({
|
||||
type: "auto_mode_tool",
|
||||
featureId: analysisId,
|
||||
tool: "Glob",
|
||||
input: { pattern: "**/*" },
|
||||
});
|
||||
|
||||
await delay(300, analysisId);
|
||||
if (!mockRunningFeatures.has(analysisId)) return { success: false, message: "Analysis aborted" };
|
||||
|
||||
emitAutoModeEvent({
|
||||
type: "auto_mode_progress",
|
||||
featureId: analysisId,
|
||||
content: "Detected tech stack: Next.js, TypeScript, Tailwind CSS\n",
|
||||
});
|
||||
|
||||
await delay(300, analysisId);
|
||||
if (!mockRunningFeatures.has(analysisId)) return { success: false, message: "Analysis aborted" };
|
||||
|
||||
// Write mock app_spec.txt
|
||||
mockFileSystem[`${projectPath}/.automaker/app_spec.txt`] = `<project_specification>
|
||||
<project_name>Demo Project</project_name>
|
||||
|
||||
<overview>
|
||||
A demo project analyzed by the Automaker AI agent.
|
||||
</overview>
|
||||
|
||||
<technology_stack>
|
||||
<frontend>
|
||||
<framework>Next.js</framework>
|
||||
<language>TypeScript</language>
|
||||
<styling>Tailwind CSS</styling>
|
||||
</frontend>
|
||||
</technology_stack>
|
||||
|
||||
<core_capabilities>
|
||||
- Web application
|
||||
- Component-based architecture
|
||||
</core_capabilities>
|
||||
|
||||
<implemented_features>
|
||||
- Basic page structure
|
||||
- Component library
|
||||
</implemented_features>
|
||||
</project_specification>`;
|
||||
|
||||
// Ensure feature_list.json exists
|
||||
if (!mockFileSystem[`${projectPath}/.automaker/feature_list.json`]) {
|
||||
mockFileSystem[`${projectPath}/.automaker/feature_list.json`] = "[]";
|
||||
}
|
||||
|
||||
emitAutoModeEvent({
|
||||
type: "auto_mode_phase",
|
||||
featureId: analysisId,
|
||||
phase: "verification",
|
||||
message: "Project analysis complete",
|
||||
});
|
||||
|
||||
emitAutoModeEvent({
|
||||
type: "auto_mode_feature_complete",
|
||||
featureId: analysisId,
|
||||
passes: true,
|
||||
message: "Project analyzed successfully",
|
||||
});
|
||||
|
||||
mockRunningFeatures.delete(analysisId);
|
||||
mockAutoModeTimeouts.delete(analysisId);
|
||||
|
||||
return { success: true, message: "Project analyzed successfully" };
|
||||
},
|
||||
|
||||
onEvent: (callback: (event: AutoModeEvent) => void) => {
|
||||
mockAutoModeCallbacks.push(callback);
|
||||
return () => {
|
||||
|
||||
Reference in New Issue
Block a user