mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 08:13:37 +00:00
style: refine sidebar and dropdown menu components for improved UI
- Simplified the sidebar button's class structure by removing unnecessary overflow styling. - Enhanced the visual representation of the trashed projects count with updated styling for better visibility. - Wrapped the dropdown menu's subcontent in a portal for improved rendering and performance.
This commit is contained in:
@@ -13,15 +13,18 @@ import { parseAndCreateFeatures } from "./parse-and-create-features.js";
|
||||
|
||||
const logger = createLogger("SpecRegeneration");
|
||||
|
||||
const MAX_FEATURES = 100;
|
||||
const DEFAULT_MAX_FEATURES = 50;
|
||||
|
||||
export async function generateFeaturesFromSpec(
|
||||
projectPath: string,
|
||||
events: EventEmitter,
|
||||
abortController: AbortController
|
||||
abortController: AbortController,
|
||||
maxFeatures?: number
|
||||
): Promise<void> {
|
||||
const featureCount = maxFeatures ?? DEFAULT_MAX_FEATURES;
|
||||
logger.debug("========== generateFeaturesFromSpec() started ==========");
|
||||
logger.debug("projectPath:", projectPath);
|
||||
logger.debug("maxFeatures:", featureCount);
|
||||
|
||||
// Read existing spec
|
||||
const specPath = path.join(projectPath, ".automaker", "app_spec.txt");
|
||||
@@ -73,7 +76,7 @@ Format as JSON:
|
||||
]
|
||||
}
|
||||
|
||||
Generate ${MAX_FEATURES} features that build on each other logically.
|
||||
Generate ${featureCount} features that build on each other logically.
|
||||
|
||||
IMPORTANT: Do not ask for clarification. The specification is provided above. Generate the JSON immediately.`;
|
||||
|
||||
|
||||
@@ -20,7 +20,8 @@ export async function generateSpec(
|
||||
events: EventEmitter,
|
||||
abortController: AbortController,
|
||||
generateFeatures?: boolean,
|
||||
analyzeProject?: boolean
|
||||
analyzeProject?: boolean,
|
||||
maxFeatures?: number
|
||||
): Promise<void> {
|
||||
logger.info("========== generateSpec() started ==========");
|
||||
logger.info("projectPath:", projectPath);
|
||||
@@ -28,6 +29,7 @@ export async function generateSpec(
|
||||
logger.info("projectOverview preview:", projectOverview.substring(0, 300));
|
||||
logger.info("generateFeatures:", generateFeatures);
|
||||
logger.info("analyzeProject:", analyzeProject);
|
||||
logger.info("maxFeatures:", maxFeatures);
|
||||
|
||||
// Build the prompt based on whether we should analyze the project
|
||||
let analysisInstructions = "";
|
||||
@@ -252,7 +254,8 @@ ${getAppSpecFormatInstruction()}`;
|
||||
await generateFeaturesFromSpec(
|
||||
projectPath,
|
||||
events,
|
||||
featureAbortController
|
||||
featureAbortController,
|
||||
maxFeatures
|
||||
);
|
||||
// Final completion will be emitted by generateFeaturesFromSpec -> parseAndCreateFeatures
|
||||
} catch (featureError) {
|
||||
|
||||
@@ -22,12 +22,13 @@ export function createCreateHandler(events: EventEmitter) {
|
||||
logger.debug("Request body:", JSON.stringify(req.body, null, 2));
|
||||
|
||||
try {
|
||||
const { projectPath, projectOverview, generateFeatures, analyzeProject } =
|
||||
const { projectPath, projectOverview, generateFeatures, analyzeProject, maxFeatures } =
|
||||
req.body as {
|
||||
projectPath: string;
|
||||
projectOverview: string;
|
||||
generateFeatures?: boolean;
|
||||
analyzeProject?: boolean;
|
||||
maxFeatures?: number;
|
||||
};
|
||||
|
||||
logger.debug("Parsed params:");
|
||||
@@ -38,6 +39,7 @@ export function createCreateHandler(events: EventEmitter) {
|
||||
);
|
||||
logger.debug(" generateFeatures:", generateFeatures);
|
||||
logger.debug(" analyzeProject:", analyzeProject);
|
||||
logger.debug(" maxFeatures:", maxFeatures);
|
||||
|
||||
if (!projectPath || !projectOverview) {
|
||||
logger.error("Missing required parameters");
|
||||
@@ -68,7 +70,8 @@ export function createCreateHandler(events: EventEmitter) {
|
||||
events,
|
||||
abortController,
|
||||
generateFeatures,
|
||||
analyzeProject
|
||||
analyzeProject,
|
||||
maxFeatures
|
||||
)
|
||||
.catch((error) => {
|
||||
logError(error, "Generation failed with error");
|
||||
|
||||
@@ -22,9 +22,13 @@ export function createGenerateFeaturesHandler(events: EventEmitter) {
|
||||
logger.debug("Request body:", JSON.stringify(req.body, null, 2));
|
||||
|
||||
try {
|
||||
const { projectPath } = req.body as { projectPath: string };
|
||||
const { projectPath, maxFeatures } = req.body as {
|
||||
projectPath: string;
|
||||
maxFeatures?: number;
|
||||
};
|
||||
|
||||
logger.debug("projectPath:", projectPath);
|
||||
logger.debug("maxFeatures:", maxFeatures);
|
||||
|
||||
if (!projectPath) {
|
||||
logger.error("Missing projectPath parameter");
|
||||
@@ -45,7 +49,12 @@ export function createGenerateFeaturesHandler(events: EventEmitter) {
|
||||
setRunningState(true, abortController);
|
||||
logger.info("Starting background feature generation task...");
|
||||
|
||||
generateFeaturesFromSpec(projectPath, events, abortController)
|
||||
generateFeaturesFromSpec(
|
||||
projectPath,
|
||||
events,
|
||||
abortController,
|
||||
maxFeatures
|
||||
)
|
||||
.catch((error) => {
|
||||
logError(error, "Feature generation failed with error");
|
||||
events.emit("spec-regeneration:event", {
|
||||
|
||||
@@ -27,11 +27,13 @@ export function createGenerateHandler(events: EventEmitter) {
|
||||
projectDefinition,
|
||||
generateFeatures,
|
||||
analyzeProject,
|
||||
maxFeatures,
|
||||
} = req.body as {
|
||||
projectPath: string;
|
||||
projectDefinition: string;
|
||||
generateFeatures?: boolean;
|
||||
analyzeProject?: boolean;
|
||||
maxFeatures?: number;
|
||||
};
|
||||
|
||||
logger.debug("Parsed params:");
|
||||
@@ -42,6 +44,7 @@ export function createGenerateHandler(events: EventEmitter) {
|
||||
);
|
||||
logger.debug(" generateFeatures:", generateFeatures);
|
||||
logger.debug(" analyzeProject:", analyzeProject);
|
||||
logger.debug(" maxFeatures:", maxFeatures);
|
||||
|
||||
if (!projectPath || !projectDefinition) {
|
||||
logger.error("Missing required parameters");
|
||||
@@ -71,7 +74,8 @@ export function createGenerateHandler(events: EventEmitter) {
|
||||
events,
|
||||
abortController,
|
||||
generateFeatures,
|
||||
analyzeProject
|
||||
analyzeProject,
|
||||
maxFeatures
|
||||
)
|
||||
.catch((error) => {
|
||||
logError(error, "Generation failed with error");
|
||||
|
||||
Reference in New Issue
Block a user