feat(backlog): migrate PbiList to store-driven via useBacklogStore

Removes pbis prop; reads from useBacklogStore(s => s.pbis) so SSE
updates reflect in real-time without prop drilling.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Janpeter Visser 2026-04-30 17:27:21 +02:00
parent 6ed341fb63
commit 33d1c2312a

View file

@ -27,6 +27,7 @@ import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover
import { PanelNavBar } from '@/components/shared/panel-nav-bar'
import { useSelectionStore } from '@/stores/selection-store'
import { usePlannerStore } from '@/stores/planner-store'
import { useBacklogStore } from '@/stores/backlog-store'
import { deletePbiAction } from '@/actions/pbis'
import { reorderPbisAction, updatePbiPriorityAction } from '@/actions/stories'
import { cn } from '@/lib/utils'
@ -116,7 +117,6 @@ interface Pbi {
interface PbiListProps {
productId: string
pbis: Pbi[]
isDemo: boolean
}
@ -195,7 +195,8 @@ function SortablePbiRow({
}
// --- Main component ---
export function PbiList({ productId, pbis, isDemo }: PbiListProps) {
export function PbiList({ productId, isDemo }: PbiListProps) {
const pbis = useBacklogStore((s) => s.pbis)
const { selectedPbiId, selectPbi } = useSelectionStore()
const { pbiOrder, pbiPriority, initPbis, reorderPbis, rollbackPbis, updatePbiPriority } = usePlannerStore()
// Defaults match SSR; persisted values applied post-mount in the loader effect below.