{filterPriority !== 'all' && (
)}
{filterStatus !== 'all' && (
)}
{
setFilterPriority('all')
setFilterStatus('all')
setSortMode('priority')
setSortDir('asc')
}}
/>
{pbis.length === 0 ? (
setDialogState({ mode: 'create', productId, defaultPriority: 2 }), disabled: isDemo }}
/>
) : (
p.id)}
strategy={verticalListSortingStrategy}
>
{filtered.map(pbi => (
useProductWorkspaceStore.getState().setActivePbi(pbi.id)}
onToggle={togglePbiInDraft}
onEdit={() => setDialogState({ mode: 'edit', productId, pbi })}
onDelete={() => handleDelete(pbi.id)}
/>
))}
{activePbi && (
)}
)}
setDialogState(null)}
isDemo={isDemo}
/>
)
}
// PBI-79 / ST-1337: wrapper rond SortablePbiRow die zijn tri-state uit de
// workspace-store leest. Subscribed per PBI zodat alleen de relevante rij
// re-rendert bij pbiIntent/storyOverrides-mutaties.
function SortablePbiRowWithTriState({
pbi,
isSelected,
isDemo,
selectionMode,
productId,
onSelect,
onToggle,
onEdit,
onDelete,
}: {
pbi: Pbi
isSelected: boolean
isDemo: boolean
selectionMode: boolean
productId: string
onSelect: () => void
onToggle: (id: string, currentState: PbiTriState) => void
onEdit: () => void
onDelete: () => void
}) {
// Tri-state uit pendingSprintDraft (state A′) of pbiSummary (state B).
// Wanneer geen draft: leid af van pbiSummary; wanneer wel: uit pbiIntent.
const triState = useUserSettingsStore((s) => {
const draft = s.entities.settings.workflow?.pendingSprintDraft?.[productId]
if (draft) {
const intent = draft.pbiIntent[pbi.id] ?? 'none'
const override = draft.storyOverrides[pbi.id]
if (intent === 'all') {
if (override?.remove.length) return 'partial'
return 'full'
}
if (override?.add.length) return 'partial'
return 'empty'
}
return null
})
const summaryTriState = useProductWorkspaceStore((s) =>
selectPbiTriState(s, pbi.id),
)
const effectiveTriState: PbiTriState =
triState ?? (selectionMode ? summaryTriState : 'empty')
return (