[feature] Kanban: add task status update (column move) via RPC #27
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_biz#27
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Identified in home#211: users get an RPC error
["Method not found"]when trying to move tasks between kanban columns. Currently the kanban is read-only.Current state
projects_kanbanhandler (handlers/mod.rs:4829) loads all tasks and the template (ProjectsKanbanTemplate) renders them grouped by status. There is no endpoint to update a task's status — no PATCH/POST for column moves.The kanban card renders a link to task detail but no client-side interaction for drag-and-drop or button-based column moves.
Work required
PATCH /c/:context/tasks/:id/statusendpoint that accepts{ "status": "in_progress" }and saves the updated taskdragstart/dropevents) or per-card "move" buttons withfetch()Notes
Implementation Spec for Issue #27
Objective
Make the Kanban board interactive by adding a
POST /c/:context/tasks/:id/statusendpoint that accepts a JSON body{ "status": "<status_string>" }, updates the task in the OSIS store, and returns a JSON result. Wire this endpoint into the Kanban card HTML so each card gains "move forward" and "move back" buttons that callfetch()and refresh the page on success.Requirements
task_update_statusinhandlers/mod.rsthat acceptsPOST /c/:context/tasks/:id/status, deserializes{ "status": "..." }, loads the existing task, updates only the status, saves it viastore.save_task, and returns JSONserver.rsProjectsKanbanTemplateto add per-card left/right arrow buttons that callfetch()on the new endpoint and reload on successprojects_kanbanhandler reads an optional?project=<sid>query param and filters tasks before passing to the templateFiles to Modify
crates/hero_biz_ui/src/web/handlers/mod.rsTaskStatusUpdateRequeststruct andtask_update_statushandlercrates/hero_biz_ui/src/web/server.rsPOST .../tasks/:id/statusroutecrates/hero_biz_ui/src/web/templates/mod.rsProjectsKanbanTemplate, add project filter dropdown, add move buttonsImplementation Plan
Step 1 — Add handler (
handlers/mod.rs)TaskStatusUpdateRequest { status: String }structtask_update_statusasync handler: loads task, mutates status, saves, returns JSONStep 2 — Register route (
server.rs).route("/c/:context/tasks/:id/status", post(handlers::task_update_status))Step 3 — Update kanban handler with project filter (
handlers/mod.rs)Query(params)extractor toprojects_kanban?project=param when presentselected_projectfield to templateStep 4 — Update
ProjectsKanbanTemplate(templates/mod.rs)selected_project: Stringfield to structrender_task_cardclosure with prev/next arrow buttonsmoveTask()JS function usingfetch()+window.location.reload()Acceptance Criteria
POST /c/:context/tasks/:id/statuswith{"status":"in_progress"}returns 200{"success":true}Notes
POST(notPATCH) for consistency with existing codebase routing patternsload_task_for_space(&id, &context)fetches by SID, consistent with existingtask_edit/task_updatehandlersrender()method onlyBuild Results
Status: Success
All crates compiled without errors on branch
development_casper.Implementation Summary
Changes Made
crates/hero_biz_ui/src/web/handlers/mod.rsTaskStatusUpdateRequest { status: String }structtask_update_statushandler: loads task by SID, maps status string toTaskStatusenum, saves viastore.save_task, returns JSON{success, status}— HTTP 400 for unknown status, 404 for missing task, 500 for save failureKanbanQuery { project: Option<String> }struct for the kanban filterprojects_kanbanhandler to accept?project=<sid>query param and filter tasks before passing to the template; passesselected_projectto the templatecrates/hero_biz_ui/src/web/server.rsPOST /c/:context/tasks/:id/statusroute mapped totask_update_statuscrates/hero_biz_ui/src/web/templates/mod.rsselected_project: Stringfield toProjectsKanbanTemplate<form>with auto-submitting<select>dropdown above the board; pre-selects the active filterdraggable="true"+ondragstarthandlerondragover/ondrophandlers to each kanban column, using the column's status stringdragStart()anddrop()JavaScript functions;drop()POSTs to the status endpoint viafetch()and reloads the page on successcursor: grabon cards and a drag-over highlight on columnsBuild Results
All crates compiled successfully with no errors.
Implemented in commit
9e796a9on development_casper.