diff --git a/src/lib/board-factory.ts b/src/lib/board-factory.ts index fb14162..8fab7ed 100644 --- a/src/lib/board-factory.ts +++ b/src/lib/board-factory.ts @@ -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") { diff --git a/src/lib/import-export.ts b/src/lib/import-export.ts index 0fe7c93..4999d52 100644 --- a/src/lib/import-export.ts +++ b/src/lib/import-export.ts @@ -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, }; diff --git a/src/lib/schemas.ts b/src/lib/schemas.ts index 98ef95f..2ebd2f5 100644 --- a/src/lib/schemas.ts +++ b/src/lib/schemas.ts @@ -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([]), }); diff --git a/src/stores/board-store.ts b/src/stores/board-store.ts index 462a70f..ee1be72 100644 --- a/src/stores/board-store.ts +++ b/src/stores/board-store.ts @@ -132,6 +132,8 @@ export const useBoardStore = create()( cardIds: [], width: "standard" as ColumnWidth, color: null, + collapsed: false, + wipLimit: null, }, ], })); @@ -204,6 +206,8 @@ export const useBoardStore = create()( dueDate: null, attachments: [], coverColor: null, + priority: "none", + comments: [], createdAt: now(), updatedAt: now(), }; diff --git a/src/types/board.ts b/src/types/board.ts index 36a91a6..20aa308 100644 --- a/src/types/board.ts +++ b/src/types/board.ts @@ -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; }