mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-05 01:50:27 +08:00
- Implemented `DiscoveryPage` with session management and findings display. - Added tests for `DiscoveryPage` to ensure proper rendering and functionality. - Created `QueuePage` for managing issue execution queues with stats and actions. - Added tests for `QueuePage` to verify UI elements and translations. - Introduced `useIssues` hooks for fetching and managing issue data. - Added loading skeletons and error handling for better user experience. - Created `vite-env.d.ts` for TypeScript support in Vite environment.
60 lines
1.9 KiB
Diff
60 lines
1.9 KiB
Diff
diff --git a/ccw/frontend/src/stores/workflowStore.ts b/ccw/frontend/src/stores/workflowStore.ts
|
|
index 66419b2e..7ae5b1bf 100644
|
|
--- a/ccw/frontend/src/stores/workflowStore.ts
|
|
+++ b/ccw/frontend/src/stores/workflowStore.ts
|
|
@@ -4,7 +4,7 @@
|
|
// Manages workflow sessions, tasks, and related data
|
|
|
|
import { create } from 'zustand';
|
|
-import { devtools } from 'zustand/middleware';
|
|
+import { devtools, persist } from 'zustand/middleware';
|
|
import type {
|
|
WorkflowStore,
|
|
WorkflowState,
|
|
@@ -60,8 +60,9 @@ const initialState: WorkflowState = {
|
|
|
|
export const useWorkflowStore = create<WorkflowStore>()(
|
|
devtools(
|
|
- (set, get) => ({
|
|
- ...initialState,
|
|
+ persist(
|
|
+ (set, get) => ({
|
|
+ ...initialState,
|
|
|
|
// ========== Session Actions ==========
|
|
|
|
@@ -510,7 +511,32 @@ export const useWorkflowStore = create<WorkflowStore>()(
|
|
getSessionByKey: (key: string) => {
|
|
return get().sessionDataStore[key];
|
|
},
|
|
- }),
|
|
+ }),
|
|
+ {
|
|
+ name: 'ccw-workflow-store',
|
|
+ partialize: (state) => ({
|
|
+ projectPath: state.projectPath,
|
|
+ }),
|
|
+ onRehydrateStorage: () => {
|
|
+ console.log('[WorkflowStore] Hydrating from localStorage...');
|
|
+ return (state, error) => {
|
|
+ if (error) {
|
|
+ console.error('[WorkflowStore] Rehydration error:', error);
|
|
+ return;
|
|
+ }
|
|
+ if (state?.projectPath) {
|
|
+ console.log('[WorkflowStore] Found persisted projectPath, re-initializing workspace:', state.projectPath);
|
|
+ // Use setTimeout to ensure the store is fully initialized before calling switchWorkspace
|
|
+ setTimeout(() => {
|
|
+ if (state.switchWorkspace) {
|
|
+ state.switchWorkspace(state.projectPath);
|
|
+ }
|
|
+ }, 0);
|
|
+ }
|
|
+ };
|
|
+ },
|
|
+ }
|
|
+ ),
|
|
{ name: 'WorkflowStore' }
|
|
)
|
|
);
|