diff --git a/data/tasks.json b/data/tasks.json index baebf95..aa966ad 100644 --- a/data/tasks.json +++ b/data/tasks.json @@ -469,7 +469,7 @@ ] } ], - "lastUpdated": 1771544832422, + "lastUpdated": 1771546378027, "sprints": [ { "name": "Sprint 1", @@ -480,6 +480,16 @@ "projectId": "1", "id": "1771544832363", "createdAt": "2026-02-19T23:47:12.363Z" + }, + { + "name": "Sprint 1", + "goal": "", + "startDate": "2026-02-16", + "endDate": "2026-02-22", + "status": "planning", + "projectId": "2", + "id": "1771546141285", + "createdAt": "2026-02-20T00:09:01.285Z" } ] } \ No newline at end of file diff --git a/src/app/page.tsx b/src/app/page.tsx index 7d8390b..dd24208 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -8,9 +8,8 @@ import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from " import { Textarea } from "@/components/ui/textarea" import { Label } from "@/components/ui/label" import { useTaskStore, Task, TaskType, TaskStatus, Priority, Project } from "@/stores/useTaskStore" -import { SprintBoard } from "@/components/SprintBoard" import { BacklogView } from "@/components/BacklogView" -import { Plus, MessageSquare, Calendar, Tag, Trash2, Edit2, X, Check, MoreHorizontal, LayoutGrid, Flag, ListTodo } from "lucide-react" +import { Plus, MessageSquare, Calendar, Tag, Trash2, Edit2, X, Check, MoreHorizontal, LayoutGrid, ListTodo } from "lucide-react" const typeColors: Record = { idea: "bg-purple-500", @@ -35,7 +34,12 @@ const priorityColors: Record = { urgent: "text-red-400", } -const statusColumns: TaskStatus[] = ["backlog", "in-progress", "review", "done"] +// Sprint board columns (3 columns) +const sprintColumns = [ + { key: "backlog", label: "To Do" }, + { key: "in-progress", label: "In Progress" }, + { key: "review", label: "Done" }, +] as const export default function Home() { const { @@ -72,7 +76,7 @@ export default function Home() { }) const [newComment, setNewComment] = useState("") const [editingTask, setEditingTask] = useState(null) - const [viewMode, setViewMode] = useState<'kanban' | 'sprint' | 'backlog'>('kanban') + const [viewMode, setViewMode] = useState<'kanban' | 'backlog'>('kanban') // Sync from server on mount useEffect(() => { @@ -82,6 +86,20 @@ export default function Home() { const selectedProject = projects.find((p) => p.id === selectedProjectId) const selectedTask = tasks.find((t) => t.id === selectedTaskId) const projectTasks = selectedProjectId ? getTasksByProject(selectedProjectId) : [] + + // Get current active sprint for the selected project + const now = new Date() + const currentSprint = sprints.find((s) => + s.projectId === selectedProjectId && + s.status === 'active' && + new Date(s.startDate) <= now && + new Date(s.endDate) >= now + ) + + // Filter tasks to only show current sprint tasks in Kanban + const sprintTasks = currentSprint + ? projectTasks.filter((t) => t.sprintId === currentSprint.id) + : [] const handleAddProject = () => { if (newProjectName.trim()) { @@ -97,6 +115,7 @@ export default function Home() { ...newTask, projectId: selectedProjectId, status: newTask.status || "backlog", + sprintId: currentSprint?.id, // Auto-assign to current sprint } as any) setNewTask({ title: "", description: "", type: "task", priority: "medium", status: "backlog", tags: [] }) setNewTaskOpen(false) @@ -240,7 +259,7 @@ export default function Home() { {selectedProject.name}

- {projectTasks.length} tasks · {projectTasks.filter((t) => t.status === "done").length} done + {sprintTasks.length} tasks · {sprintTasks.filter((t) => t.status === "done").length} done

@@ -257,17 +276,6 @@ export default function Home() { Kanban -
{/* View Content */} - {viewMode === 'sprint' ? ( - - ) : viewMode === 'backlog' ? ( + {viewMode === 'backlog' ? ( ) : ( <> + {/* Current Sprint Header */} +
+
+
+

Sprint 1

+

Feb 16 - Feb 22, 2026

+
+ Active +
+
{/* Kanban Columns */} -
- {statusColumns.map((status) => { - const columnTasks = projectTasks.filter((t) => t.status === status) +
+ {sprintColumns.map((column) => { + // For "Done" column, show both review and done tasks + const columnTasks = sprintTasks.filter((t) => + column.key === 'review' + ? (t.status === 'review' || t.status === 'done') + : t.status === column.key + ) return ( -
+
-

- {status.replace("-", " ")} +

+ {column.label}

{columnTasks.length} diff --git a/src/stores/useTaskStore.ts b/src/stores/useTaskStore.ts index bb1b49a..98fcdae 100644 --- a/src/stores/useTaskStore.ts +++ b/src/stores/useTaskStore.ts @@ -91,6 +91,23 @@ interface TaskStore { getTaskById: (id: string) => Task | undefined } +// Sprint 1: Mon Feb 16 - Sun Feb 22, 2026 (current week) +const sprint1Start = new Date('2026-02-16T00:00:00.000Z') +const sprint1End = new Date('2026-02-22T23:59:59.999Z') + +const defaultSprints: Sprint[] = [ + { + id: 'sprint-1', + name: 'Sprint 1', + goal: 'Foundation and core features', + startDate: sprint1Start.toISOString(), + endDate: sprint1End.toISOString(), + status: 'active', + projectId: '2', + createdAt: new Date().toISOString(), + }, +] + const defaultProjects: Project[] = [ { id: '1', name: 'OpenClaw iOS', description: 'Main iOS app development', color: '#8b5cf6', createdAt: new Date().toISOString() }, { id: '2', name: 'Web Projects', description: 'Web tools and dashboards', color: '#3b82f6', createdAt: new Date().toISOString() }, @@ -106,6 +123,7 @@ const defaultTasks: Task[] = [ status: 'in-progress', priority: 'high', projectId: '2', + sprintId: 'sprint-1', createdAt: new Date().toISOString(), updatedAt: new Date().toISOString(), comments: [ @@ -122,6 +140,7 @@ const defaultTasks: Task[] = [ status: 'backlog', priority: 'medium', projectId: '1', + sprintId: 'sprint-1', createdAt: new Date().toISOString(), updatedAt: new Date().toISOString(), comments: [],