feat: add column color, card coverColor, and board background to data model

This commit is contained in:
Your Name
2026-02-15 20:28:16 +02:00
parent f303d61677
commit 1556529307
5 changed files with 25 additions and 3 deletions

View File

@@ -26,6 +26,7 @@ interface BoardActions {
deleteColumn: (columnId: string) => void;
moveColumn: (fromIndex: number, toIndex: number) => void;
setColumnWidth: (columnId: string, width: ColumnWidth) => void;
setColumnColor: (columnId: string, color: string | null) => void;
addCard: (columnId: string, title: string) => string;
updateCard: (cardId: string, updates: Partial<Card>) => void;
@@ -130,6 +131,7 @@ export const useBoardStore = create<BoardState & BoardActions>()(
title,
cardIds: [],
width: "standard" as ColumnWidth,
color: null,
},
],
}));
@@ -179,6 +181,16 @@ export const useBoardStore = create<BoardState & BoardActions>()(
}));
},
setColumnColor: (columnId, color) => {
mutate(get, set, (b) => ({
...b,
updatedAt: now(),
columns: b.columns.map((c) =>
c.id === columnId ? { ...c, color } : c
),
}));
},
// -- Card actions --
addCard: (columnId, title) => {
@@ -191,6 +203,7 @@ export const useBoardStore = create<BoardState & BoardActions>()(
checklist: [],
dueDate: null,
attachments: [],
coverColor: null,
createdAt: now(),
updatedAt: now(),
};