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 12c8209042
commit 2ac59fa202
5 changed files with 35 additions and 0 deletions

View File

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

View File

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

View File

@@ -6,6 +6,12 @@ export const checklistItemSchema = z.object({
checked: z.boolean(),
});
export const commentSchema = z.object({
id: z.string(),
text: z.string(),
createdAt: z.string(),
});
export const attachmentSchema = z.object({
id: z.string(),
name: z.string(),
@@ -28,6 +34,8 @@ export const cardSchema = z.object({
dueDate: z.string().nullable().default(null),
attachments: z.array(attachmentSchema).default([]),
coverColor: z.string().nullable().default(null),
priority: z.enum(["none", "low", "medium", "high", "urgent"]).default("none"),
comments: z.array(commentSchema).default([]),
createdAt: z.string(),
updatedAt: z.string(),
});
@@ -38,6 +46,8 @@ export const columnSchema = z.object({
cardIds: z.array(z.string()).default([]),
width: z.enum(["narrow", "standard", "wide"]).default("standard"),
color: z.string().nullable().default(null),
collapsed: z.boolean().default(false),
wipLimit: z.number().nullable().default(null),
});
export const boardSettingsSchema = z.object({
@@ -74,4 +84,6 @@ export const appSettingsSchema = z.object({
density: z.enum(["compact", "comfortable", "spacious"]).default("comfortable"),
defaultColumnWidth: z.enum(["narrow", "standard", "wide"]).default("standard"),
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: [],
width: "standard" as ColumnWidth,
color: null,
collapsed: false,
wipLimit: null,
},
],
}));
@@ -204,6 +206,8 @@ export const useBoardStore = create<BoardState & BoardActions>()(
dueDate: null,
attachments: [],
coverColor: null,
priority: "none",
comments: [],
createdAt: now(),
updatedAt: now(),
};

View File

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