Add in-progress state to tasks
Introduce IN_PROGRESS as a new task state between TODO and DONE across the full stack: database enum, Go backend, GraphQL, MCP, and frontend. The task state icon now cycles forward on click (TODO → IN_PROGRESS → DONE → TODO), and the action dropdown provides explicit "Move to" options for any state transition. The "All" tab supports drag-and-drop between state sections to change a task's state. Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
15
pkg/coredata/migrations/20260402T120000Z.sql
Normal file
15
pkg/coredata/migrations/20260402T120000Z.sql
Normal file
@@ -0,0 +1,15 @@
|
||||
-- Copyright (c) 2025-2026 Probo Inc <hello@getprobo.com>.
|
||||
--
|
||||
-- Permission to use, copy, modify, and/or distribute this software for any
|
||||
-- purpose with or without fee is hereby granted, provided that the above
|
||||
-- copyright notice and this permission notice appear in all copies.
|
||||
--
|
||||
-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||||
-- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
-- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
-- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||||
-- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||
-- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
-- PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
ALTER TYPE task_state ADD VALUE 'IN_PROGRESS' BEFORE 'DONE';
|
||||
@@ -20,17 +20,19 @@ import (
|
||||
)
|
||||
|
||||
type (
|
||||
TaskState uint8
|
||||
TaskState string
|
||||
)
|
||||
|
||||
const (
|
||||
TaskStateTodo TaskState = iota
|
||||
TaskStateDone
|
||||
TaskStateTodo TaskState = "TODO"
|
||||
TaskStateInProgress TaskState = "IN_PROGRESS"
|
||||
TaskStateDone TaskState = "DONE"
|
||||
)
|
||||
|
||||
func TaskStates() []TaskState {
|
||||
return []TaskState{
|
||||
TaskStateTodo,
|
||||
TaskStateInProgress,
|
||||
TaskStateDone,
|
||||
}
|
||||
}
|
||||
@@ -40,13 +42,11 @@ func (ts TaskState) MarshalText() ([]byte, error) {
|
||||
}
|
||||
|
||||
func (ts *TaskState) UnmarshalText(data []byte) error {
|
||||
val := string(data)
|
||||
val := TaskState(data)
|
||||
|
||||
switch val {
|
||||
case TaskStateTodo.String():
|
||||
*ts = TaskStateTodo
|
||||
case TaskStateDone.String():
|
||||
*ts = TaskStateDone
|
||||
case TaskStateTodo, TaskStateInProgress, TaskStateDone:
|
||||
*ts = val
|
||||
default:
|
||||
return fmt.Errorf("invalid TaskState value: %q", val)
|
||||
}
|
||||
@@ -55,16 +55,7 @@ func (ts *TaskState) UnmarshalText(data []byte) error {
|
||||
}
|
||||
|
||||
func (ts TaskState) String() string {
|
||||
var val string
|
||||
|
||||
switch ts {
|
||||
case TaskStateTodo:
|
||||
val = "TODO"
|
||||
case TaskStateDone:
|
||||
val = "DONE"
|
||||
}
|
||||
|
||||
return val
|
||||
return string(ts)
|
||||
}
|
||||
|
||||
func (ts *TaskState) Scan(value any) error {
|
||||
|
||||
Reference in New Issue
Block a user