feat: implement project setup dialog and refactor sidebar integration

- Added a new ProjectSetupDialog component to facilitate project specification generation, enhancing user experience by guiding users through project setup.
- Refactored the Sidebar component to integrate the new ProjectSetupDialog, replacing the previous inline dialog implementation for improved code organization and maintainability.
- Updated the sidebar to handle project overview and feature generation options, streamlining the project setup process.
- Removed the old dialog implementation from the Sidebar, reducing code duplication and improving clarity.
This commit is contained in:
Cody Seibert
2025-12-15 01:07:47 -05:00
parent 919e08689a
commit f25d62fe25
13 changed files with 724 additions and 332 deletions

View File

@@ -14,23 +14,32 @@ export async function parseAndCreateFeatures(
content: string,
events: EventEmitter
): Promise<void> {
logger.debug("========== parseAndCreateFeatures() started ==========");
logger.debug("Content length:", `${content.length} chars`);
logger.info("========== parseAndCreateFeatures() started ==========");
logger.info(`Content length: ${content.length} chars`);
logger.info("========== CONTENT RECEIVED FOR PARSING ==========");
logger.info(content);
logger.info("========== END CONTENT ==========");
try {
// Extract JSON from response
logger.debug("Extracting JSON from response...");
logger.info("Extracting JSON from response...");
logger.info(`Looking for pattern: /{[\\s\\S]*"features"[\\s\\S]*}/`);
const jsonMatch = content.match(/\{[\s\S]*"features"[\s\S]*\}/);
if (!jsonMatch) {
logger.error("❌ No valid JSON found in response");
logger.error("Content preview:", content.substring(0, 500));
logger.error("Full content received:");
logger.error(content);
throw new Error("No valid JSON found in response");
}
logger.debug(`JSON match found (${jsonMatch[0].length} chars)`);
logger.info(`JSON match found (${jsonMatch[0].length} chars)`);
logger.info("========== MATCHED JSON ==========");
logger.info(jsonMatch[0]);
logger.info("========== END MATCHED JSON ==========");
const parsed = JSON.parse(jsonMatch[0]);
logger.info(`Parsed ${parsed.features?.length || 0} features`);
logger.info("Parsed features:", JSON.stringify(parsed.features, null, 2));
const featuresDir = path.join(projectPath, ".automaker", "features");
await fs.mkdir(featuresDir, { recursive: true });