feat: Phase 0 data model - add Comment, Priority, collapsed, wipLimit fields

This commit is contained in:
Your Name
2026-02-16 14:31:56 +02:00
parent c6fea186ef
commit 02ef3acbfe
5 changed files with 35 additions and 0 deletions

View File

@@ -27,6 +27,8 @@ export function createBoard(
cardIds: [] as string[], cardIds: [] as string[],
width: w, width: w,
color: null as string | null, color: null as string | null,
collapsed: false,
wipLimit: null as number | null,
}); });
if (template === "kanban") { if (template === "kanban") {

View File

@@ -154,6 +154,8 @@ export function importFromTrelloJson(jsonString: string): Board {
cardIds: [], cardIds: [],
width: "standard" as const, width: "standard" as const,
color: null, color: null,
collapsed: false,
wipLimit: null,
}; };
}); });
@@ -203,6 +205,8 @@ export function importFromTrelloJson(jsonString: string): Board {
dueDate: tCard.due ?? null, dueDate: tCard.due ?? null,
attachments: [], attachments: [],
coverColor: null, coverColor: null,
priority: "none",
comments: [],
createdAt: ts, createdAt: ts,
updatedAt: ts, updatedAt: ts,
}; };

View File

@@ -6,6 +6,12 @@ export const checklistItemSchema = z.object({
checked: z.boolean(), checked: z.boolean(),
}); });
export const commentSchema = z.object({
id: z.string(),
text: z.string(),
createdAt: z.string(),
});
export const attachmentSchema = z.object({ export const attachmentSchema = z.object({
id: z.string(), id: z.string(),
name: z.string(), name: z.string(),
@@ -28,6 +34,8 @@ export const cardSchema = z.object({
dueDate: z.string().nullable().default(null), dueDate: z.string().nullable().default(null),
attachments: z.array(attachmentSchema).default([]), attachments: z.array(attachmentSchema).default([]),
coverColor: z.string().nullable().default(null), coverColor: z.string().nullable().default(null),
priority: z.enum(["none", "low", "medium", "high", "urgent"]).default("none"),
comments: z.array(commentSchema).default([]),
createdAt: z.string(), createdAt: z.string(),
updatedAt: z.string(), updatedAt: z.string(),
}); });
@@ -38,6 +46,8 @@ export const columnSchema = z.object({
cardIds: z.array(z.string()).default([]), cardIds: z.array(z.string()).default([]),
width: z.enum(["narrow", "standard", "wide"]).default("standard"), width: z.enum(["narrow", "standard", "wide"]).default("standard"),
color: z.string().nullable().default(null), color: z.string().nullable().default(null),
collapsed: z.boolean().default(false),
wipLimit: z.number().nullable().default(null),
}); });
export const boardSettingsSchema = z.object({ export const boardSettingsSchema = z.object({
@@ -74,4 +84,6 @@ export const appSettingsSchema = z.object({
density: z.enum(["compact", "comfortable", "spacious"]).default("comfortable"), density: z.enum(["compact", "comfortable", "spacious"]).default("comfortable"),
defaultColumnWidth: z.enum(["narrow", "standard", "wide"]).default("standard"), defaultColumnWidth: z.enum(["narrow", "standard", "wide"]).default("standard"),
windowState: windowStateSchema.nullable().default(null), windowState: windowStateSchema.nullable().default(null),
boardSortOrder: z.enum(["manual", "title", "created", "updated"]).default("updated"),
boardManualOrder: z.array(z.string()).default([]),
}); });

View File

@@ -132,6 +132,8 @@ export const useBoardStore = create<BoardState & BoardActions>()(
cardIds: [], cardIds: [],
width: "standard" as ColumnWidth, width: "standard" as ColumnWidth,
color: null, color: null,
collapsed: false,
wipLimit: null,
}, },
], ],
})); }));
@@ -204,6 +206,8 @@ export const useBoardStore = create<BoardState & BoardActions>()(
dueDate: null, dueDate: null,
attachments: [], attachments: [],
coverColor: null, coverColor: null,
priority: "none",
comments: [],
createdAt: now(), createdAt: now(),
updatedAt: now(), updatedAt: now(),
}; };

View File

@@ -16,10 +16,14 @@ export interface Column {
cardIds: string[]; cardIds: string[];
width: ColumnWidth; width: ColumnWidth;
color: string | null; color: string | null;
collapsed: boolean;
wipLimit: number | null;
} }
export type ColumnWidth = "narrow" | "standard" | "wide"; export type ColumnWidth = "narrow" | "standard" | "wide";
export type Priority = "none" | "low" | "medium" | "high" | "urgent";
export interface Card { export interface Card {
id: string; id: string;
title: string; title: string;
@@ -29,6 +33,8 @@ export interface Card {
dueDate: string | null; dueDate: string | null;
attachments: Attachment[]; attachments: Attachment[];
coverColor: string | null; coverColor: string | null;
priority: Priority;
comments: Comment[];
createdAt: string; createdAt: string;
updatedAt: string; updatedAt: string;
} }
@@ -45,6 +51,12 @@ export interface ChecklistItem {
checked: boolean; checked: boolean;
} }
export interface Comment {
id: string;
text: string;
createdAt: string;
}
export interface Attachment { export interface Attachment {
id: string; id: string;
name: string; name: string;
@@ -63,5 +75,6 @@ export interface BoardMeta {
color: string; color: string;
cardCount: number; cardCount: number;
columnCount: number; columnCount: number;
createdAt: string;
updatedAt: string; updatedAt: string;
} }