diff --git a/components/sprint/sprint-hydration-wrapper.tsx b/components/sprint/sprint-hydration-wrapper.tsx index 625d634..47bebb0 100644 --- a/components/sprint/sprint-hydration-wrapper.tsx +++ b/components/sprint/sprint-hydration-wrapper.tsx @@ -1,12 +1,10 @@ 'use client' -// PBI-74 / Story 9 / T-880: Sprint workspace hydration wrapper. +// PBI-74 / Story 9: Sprint workspace hydration wrapper. // // Server-component (sprint page) fetcht initial sprint snapshot; deze wrapper // hydreert useSprintWorkspaceStore op client-mount, mount de SSE-hook en de -// resync-laag. Tijdens T-880 (schaduw-fase) blijft useSprintStore parallel -// werken in sprint-board components — beide stores naast elkaar tot T-881 -// componenten omzet en T-883 de oude store opruimt. +// resync-laag. import { useEffect, useRef } from 'react' import { useSprintRealtime } from '@/lib/realtime/use-sprint-realtime' diff --git a/stores/sprint-store.ts b/stores/sprint-store.ts deleted file mode 100644 index c332eea..0000000 --- a/stores/sprint-store.ts +++ /dev/null @@ -1,57 +0,0 @@ -import { create } from 'zustand' - -interface SprintStore { - // sprintId → storyId[] - sprintStoryOrder: Record - // storyId → taskId[] - taskOrder: Record - - initSprint: (sprintId: string, storyIds: string[]) => void - addStoryToSprint: (sprintId: string, storyId: string) => void - removeStoryFromSprint: (sprintId: string, storyId: string) => void - reorderSprintStories: (sprintId: string, storyIds: string[]) => void - rollbackSprint: (sprintId: string, storyIds: string[]) => void - - initTasks: (storyId: string, taskIds: string[]) => void - reorderTasks: (storyId: string, taskIds: string[]) => void - rollbackTasks: (storyId: string, taskIds: string[]) => void -} - -export const useSprintStore = create((set) => ({ - sprintStoryOrder: {}, - taskOrder: {}, - - initSprint: (sprintId, storyIds) => - set((s) => ({ sprintStoryOrder: { ...s.sprintStoryOrder, [sprintId]: storyIds } })), - - addStoryToSprint: (sprintId, storyId) => - set((s) => ({ - sprintStoryOrder: { - ...s.sprintStoryOrder, - [sprintId]: [...(s.sprintStoryOrder[sprintId] ?? []), storyId], - }, - })), - - removeStoryFromSprint: (sprintId, storyId) => - set((s) => ({ - sprintStoryOrder: { - ...s.sprintStoryOrder, - [sprintId]: (s.sprintStoryOrder[sprintId] ?? []).filter((id) => id !== storyId), - }, - })), - - reorderSprintStories: (sprintId, storyIds) => - set((s) => ({ sprintStoryOrder: { ...s.sprintStoryOrder, [sprintId]: storyIds } })), - - rollbackSprint: (sprintId, storyIds) => - set((s) => ({ sprintStoryOrder: { ...s.sprintStoryOrder, [sprintId]: storyIds } })), - - initTasks: (storyId, taskIds) => - set((s) => ({ taskOrder: { ...s.taskOrder, [storyId]: taskIds } })), - - reorderTasks: (storyId, taskIds) => - set((s) => ({ taskOrder: { ...s.taskOrder, [storyId]: taskIds } })), - - rollbackTasks: (storyId, taskIds) => - set((s) => ({ taskOrder: { ...s.taskOrder, [storyId]: taskIds } })), -}))