feat(PBI-74): cleanup oude sprint-store (Story 9 / T-883)

- rm stores/sprint-store.ts — alle componenten lezen nu via
  useSprintWorkspaceStore (T-881 voltooide imports-migratie)
- update SprintHydrationWrapper-comment: schaduw-fase referenties
  verwijderd

Verify: 671 tests groen, typecheck clean, build groen.
Grep useSprintStore = 0.
This commit is contained in:
Janpeter Visser 2026-05-10 06:48:07 +02:00
parent fa8b21ebe4
commit d3eb1a193d
2 changed files with 2 additions and 61 deletions

View file

@ -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'

View file

@ -1,57 +0,0 @@
import { create } from 'zustand'
interface SprintStore {
// sprintId → storyId[]
sprintStoryOrder: Record<string, string[]>
// storyId → taskId[]
taskOrder: Record<string, string[]>
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<SprintStore>((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 } })),
}))