Files
stack/workers/kanban-add-task-prompt.txt

39 lines
2.5 KiB
Plaintext

Add "Add Task" functionality to the Kanban board in ~/src/mosaic-stack.
## Problem
The Kanban page (/kanban) shows tasks and allows drag-drop between columns, but there is NO way to create a new task. Users can't add tasks directly to the queue.
## What Exists
- File: apps/web/src/app/(authenticated)/kanban/page.tsx (765 lines)
- API client: apps/web/src/lib/api/tasks.ts — already has fetchTasks, updateTask, and a newly added createTask function
- API endpoint: POST /api/tasks (accepts: title, description?, status?, priority?, dueDate?, projectId?)
- Shared types: @mosaic/shared — Task, TaskStatus, TaskPriority enums
- Project fetch: fetchProjects already imported in kanban page
## What to Build
Add an "Add Task" button (+ icon) to each Kanban column header that:
1. Opens an inline form or small dialog directly in that column
2. Form fields: title (required), description (optional), priority (optional, defaults to MEDIUM), dueDate (optional)
3. On submit: calls createTask({ title, description, priority, status: <column_status>, projectId: currentProjectFilter })
4. On success: adds the new task to the column without full page reload (optimistic or refetch)
5. On cancel: dismisses form
6. Matches existing visual style (same inline styles / design tokens as rest of page — it uses CSS-in-JS inline styles with rgb(var(--color-*)) tokens)
## Key Constraints
- The page uses inline styles throughout (rgb(var(--surface-*)), rgb(var(--text-*)), rgb(var(--border-*))) — match this pattern, no Tailwind classes
- KanbanColumn component receives config and tasks — you'll need to wire the add button into it or add it at column-header level
- createTask is exported from apps/web/src/lib/api/tasks.ts — import and use it
- Use useWorkspaceId() hook (already imported) for workspace context
- Keep it minimal — a simple inline card input (like Trello's "+Add a card" at bottom of column) is perfect
## Process
1. git checkout main && git pull --ff-only origin main
2. git checkout -b feat/kanban-add-task
3. Implement the feature
4. Run: pnpm turbo lint typecheck --filter=@mosaic/web
5. Commit --no-verify: "feat(web): add task creation to Kanban board"
6. Push and PR: ~/.config/mosaic/tools/git/pr-create.sh -t "feat(web): add task creation to Kanban board" -b "Adds inline Add Task button to each Kanban column. Clicking opens a quick-add form at the bottom of the column. Uses createTask API to persist, then refreshes tasks."
When done:
openclaw system event --text "Done: kanban add-task PR ready" --mode now