Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion windows/src/components/BoardView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
} from "@dnd-kit/core";
import { arrayMove, SortableContext, horizontalListSortingStrategy } from "@dnd-kit/sortable";
import { useState } from "react";
import { useShallow } from "zustand/react/shallow";
import { canMergeCards, mergeCards, useBoardStore } from "../store/boardStore";
import { COLUMNS, type CardDto, type KanbanColumn } from "../types";
import { useTheme, t } from "../theme";
Expand All @@ -21,7 +22,11 @@ const dropAnimation: DropAnimation = {

export default function BoardView() {
const { moveCard, reorderCards, reorderPinnedCards, isLoading, cards, setNewTaskOpen, refresh, setMergeTargetId } = useBoardStore();
const pinnedCards = useBoardStore((s) => s.pinnedCards());
// useShallow keeps the selector's new-array-per-call shape from triggering
// an infinite loop under Zustand v5's stricter useSyncExternalStore snapshot
// contract. Array element identity is preserved across renders (cards are
// memoized in the store), so a shallow compare is all React needs.
const pinnedCards = useBoardStore(useShallow((s) => s.pinnedCards()));
const [draggingCard, setDraggingCard] = useState<CardDto | null>(null);
const { theme } = useTheme();
const c = t(theme);
Expand Down