feat: implement spec synchronization feature for improved project management

- Added a new `/sync` endpoint to synchronize the project specification with the current codebase and feature state.
- Introduced `syncSpec` function to handle the synchronization logic, updating technology stack, implemented features, and roadmap phases.
- Enhanced the running state management to track synchronization tasks alongside existing generation tasks.
- Updated UI components to support synchronization actions, including loading indicators and status updates.
- Improved logging and error handling for better visibility during sync operations.

These changes enhance project management capabilities by ensuring that the specification remains up-to-date with the latest code and feature developments.
This commit is contained in:
webdevcody
2026-01-17 01:45:45 -05:00
parent 616e2ef75f
commit aa35eb3d3a
20 changed files with 940 additions and 98 deletions

View File

@@ -56,6 +56,9 @@ export function SpecView() {
// Feature generation
isGeneratingFeatures,
// Sync
isSyncing,
// Status
currentPhase,
errorMessage,
@@ -63,6 +66,8 @@ export function SpecView() {
// Handlers
handleCreateSpec,
handleRegenerate,
handleGenerateFeatures,
handleSync,
} = useSpecGeneration({ loadSpec });
// Reset hasChanges when spec is reloaded
@@ -86,10 +91,9 @@ export function SpecView() {
);
}
// Empty state - no spec exists or generation is running
// When generation is running, we skip loading the spec to avoid 500 errors,
// so we show the empty state with generation indicator
if (!specExists || isGenerationRunning) {
// Empty state - only show when spec doesn't exist AND no generation is running
// If generation is running but no spec exists, show the generating UI
if (!specExists) {
// If generation is running (from loading hook check), ensure we show the generating UI
const showAsGenerating = isCreating || isGenerationRunning;
@@ -127,14 +131,17 @@ export function SpecView() {
<div className="flex-1 flex flex-col overflow-hidden content-bg" data-testid="spec-view">
<SpecHeader
projectPath={currentProject.path}
isRegenerating={isRegenerating}
isRegenerating={isRegenerating || isGenerationRunning}
isCreating={isCreating}
isGeneratingFeatures={isGeneratingFeatures}
isSyncing={isSyncing}
isSaving={isSaving}
hasChanges={hasChanges}
currentPhase={currentPhase}
currentPhase={currentPhase || (isGenerationRunning ? 'working' : '')}
errorMessage={errorMessage}
onRegenerateClick={() => setShowRegenerateDialog(true)}
onGenerateFeaturesClick={handleGenerateFeatures}
onSyncClick={handleSync}
onSaveClick={saveSpec}
showActionsPanel={showActionsPanel}
onToggleActionsPanel={() => setShowActionsPanel(!showActionsPanel)}