feat: refactor spec-view to folder pattern and add feature count selector

Closes #151

- Refactor spec-view.tsx from 1,230 lines to ~170 lines following folder-pattern.md
- Create unified CreateSpecDialog with all features from both dialogs:
  - featureCount selector (20/50/100) - was missing in spec-view
  - analyzeProject checkbox - was missing in sidebar
- Extract components: spec-header, spec-editor, spec-empty-state
- Extract hooks: use-spec-loading, use-spec-save, use-spec-generation
- Extract dialogs: create-spec-dialog, regenerate-spec-dialog
- Update sidebar to use new CreateSpecDialog with analyzeProject state
- Delete deprecated project-setup-dialog.tsx

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Kacper
2025-12-18 00:14:44 +01:00
parent 3eac848d4f
commit e78bfc80ec
15 changed files with 1510 additions and 1231 deletions

View File

@@ -0,0 +1,29 @@
import type { FeatureCount } from "./types";
// Delay before reloading spec file to ensure it's written to disk
export const SPEC_FILE_WRITE_DELAY = 500;
// Interval for polling backend status during generation
export const STATUS_CHECK_INTERVAL_MS = 2000;
// Feature count options with labels and warnings
export const FEATURE_COUNT_OPTIONS: {
value: FeatureCount;
label: string;
warning?: string;
}[] = [
{ value: 20, label: "20" },
{ value: 50, label: "50", warning: "May take up to 5 minutes" },
{ value: 100, label: "100", warning: "May take up to 5 minutes" },
];
// Phase display labels for UI
export const PHASE_LABELS: Record<string, string> = {
initialization: "Initializing...",
setup: "Setting up tools...",
analysis: "Analyzing project structure...",
spec_complete: "Spec created! Generating features...",
feature_generation: "Creating features from roadmap...",
complete: "Complete!",
error: "Error occurred",
};