diff --git a/src/components/SprintBoard.tsx b/src/components/SprintBoard.tsx index 4ea9437..d1845d0 100644 --- a/src/components/SprintBoard.tsx +++ b/src/components/SprintBoard.tsx @@ -25,6 +25,7 @@ import { Plus, Calendar, Flag, GripVertical } from "lucide-react" import { format, parseISO } from "date-fns" const statusColumns = ["backlog", "in-progress", "review", "done"] as const +type SprintColumnStatus = typeof statusColumns[number] const statusLabels: Record = { backlog: "To Do", @@ -149,7 +150,6 @@ export function SprintBoard() { selectedSprintId, selectSprint, selectedProjectId, - selectedTaskId, updateTask, selectTask, addSprint, @@ -224,7 +224,7 @@ export function SprintBoard() { const overId = over.id as string // Check if dropped over a column - if (statusColumns.includes(overId as any)) { + if (statusColumns.includes(overId as SprintColumnStatus)) { updateTask(taskId, { status: overId as Task["status"] }) return } diff --git a/src/components/ui/textarea.tsx b/src/components/ui/textarea.tsx index c61fd6e..855b0f9 100644 --- a/src/components/ui/textarea.tsx +++ b/src/components/ui/textarea.tsx @@ -1,8 +1,7 @@ import * as React from "react" import { cn } from "@/lib/utils" -export interface TextareaProps - extends React.TextareaHTMLAttributes {} +export type TextareaProps = React.TextareaHTMLAttributes const Textarea = React.forwardRef( ({ className, ...props }, ref) => { diff --git a/src/stores/useTaskStore.ts b/src/stores/useTaskStore.ts index c498043..a5beb3b 100644 --- a/src/stores/useTaskStore.ts +++ b/src/stores/useTaskStore.ts @@ -485,21 +485,23 @@ const normalizeCommentAuthor = (value: unknown): CommentAuthor => { const normalizeComments = (value: unknown): Comment[] => { if (!Array.isArray(value)) return [] - return value - .map((entry) => { - if (!entry || typeof entry !== 'object') return null - const candidate = entry as Partial - if (typeof candidate.id !== 'string' || typeof candidate.text !== 'string') return null + const comments: Comment[] = [] + + for (const entry of value) { + if (!entry || typeof entry !== 'object') continue + const candidate = entry as Partial + if (typeof candidate.id !== 'string' || typeof candidate.text !== 'string') continue - return { - id: candidate.id, - text: candidate.text, - createdAt: typeof candidate.createdAt === 'string' ? candidate.createdAt : new Date().toISOString(), - author: normalizeCommentAuthor(candidate.author), - replies: normalizeComments(candidate.replies), - } + comments.push({ + id: candidate.id, + text: candidate.text, + createdAt: typeof candidate.createdAt === 'string' ? candidate.createdAt : new Date().toISOString(), + author: normalizeCommentAuthor(candidate.author), + replies: normalizeComments(candidate.replies), }) - .filter((comment): comment is Comment => comment !== null) + } + + return comments } const normalizeAttachments = (value: unknown): TaskAttachment[] => {