feat(ui): add export and import features functionality

- Introduced new routes for exporting and importing features, enhancing project management capabilities.
- Added UI components for export and import dialogs, allowing users to easily manage feature data.
- Updated HTTP API client to support export and import operations with appropriate options and responses.
- Enhanced board view with controls for triggering export and import actions, improving user experience.
- Defined new types for feature export and import, ensuring type safety and clarity in data handling.
This commit is contained in:
Shirone
2026-01-21 13:00:34 +01:00
parent db71dc9aa5
commit 2214c2700b
16 changed files with 2431 additions and 15 deletions

View File

@@ -1631,6 +1631,64 @@ export class HttpApiClient implements ElectronAPI {
results?: Array<{ featureId: string; success: boolean; error?: string }>;
error?: string;
}>;
export: (
projectPath: string,
options?: {
featureIds?: string[];
format?: 'json' | 'yaml';
includeHistory?: boolean;
includePlanSpec?: boolean;
category?: string;
status?: string;
prettyPrint?: boolean;
metadata?: Record<string, unknown>;
}
) => Promise<{
success: boolean;
data?: string;
format?: 'json' | 'yaml';
contentType?: string;
filename?: string;
error?: string;
}>;
import: (
projectPath: string,
data: string,
options?: {
overwrite?: boolean;
preserveBranchInfo?: boolean;
targetCategory?: string;
}
) => Promise<{
success: boolean;
importedCount?: number;
failedCount?: number;
results?: Array<{
success: boolean;
featureId?: string;
importedAt: string;
warnings?: string[];
errors?: string[];
wasOverwritten?: boolean;
}>;
error?: string;
}>;
checkConflicts: (
projectPath: string,
data: string
) => Promise<{
success: boolean;
hasConflicts?: boolean;
conflicts?: Array<{
featureId: string;
title?: string;
existingTitle?: string;
hasConflict: boolean;
}>;
totalFeatures?: number;
conflictCount?: number;
error?: string;
}>;
} = {
getAll: (projectPath: string) => this.post('/api/features/list', { projectPath }),
get: (projectPath: string, featureId: string) =>
@@ -1663,6 +1721,64 @@ export class HttpApiClient implements ElectronAPI {
this.post('/api/features/bulk-update', { projectPath, featureIds, updates }),
bulkDelete: (projectPath: string, featureIds: string[]) =>
this.post('/api/features/bulk-delete', { projectPath, featureIds }),
export: (
projectPath: string,
options?: {
featureIds?: string[];
format?: 'json' | 'yaml';
includeHistory?: boolean;
includePlanSpec?: boolean;
category?: string;
status?: string;
prettyPrint?: boolean;
metadata?: Record<string, unknown>;
}
): Promise<{
success: boolean;
data?: string;
format?: 'json' | 'yaml';
contentType?: string;
filename?: string;
error?: string;
}> => this.post('/api/features/export', { projectPath, ...options }),
import: (
projectPath: string,
data: string,
options?: {
overwrite?: boolean;
preserveBranchInfo?: boolean;
targetCategory?: string;
}
): Promise<{
success: boolean;
importedCount?: number;
failedCount?: number;
results?: Array<{
success: boolean;
featureId?: string;
importedAt: string;
warnings?: string[];
errors?: string[];
wasOverwritten?: boolean;
}>;
error?: string;
}> => this.post('/api/features/import', { projectPath, data, ...options }),
checkConflicts: (
projectPath: string,
data: string
): Promise<{
success: boolean;
hasConflicts?: boolean;
conflicts?: Array<{
featureId: string;
title?: string;
existingTitle?: string;
hasConflict: boolean;
}>;
totalFeatures?: number;
conflictCount?: number;
error?: string;
}> => this.post('/api/features/check-conflicts', { projectPath, data }),
};
// Auto Mode API