Add task priority enum and rename priority to rank
The existing integer priority field represents positional ordering within a state, not semantic importance. Rename it to rank and introduce a new priority field with enum values URGENT, HIGH, MEDIUM and LOW across the entire stack. Rank is now scoped to (state, priority) so tasks are ordered within each priority group. A generated priority_rank column combines both fields into a single sortable integer for cursor pagination. Dragging a task across priority groups updates its priority automatically based on the drop position neighbors. The backend first moves the task to the new group then repositions it at the target rank. The migration defaults existing rows to MEDIUM priority and backfills ranks per (state, priority) group. Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -1896,6 +1896,7 @@ func (r *Resolver) UpdateTaskTool(ctx context.Context, req *mcp.CallToolRequest,
|
||||
Description: UnwrapOmittable(input.Description),
|
||||
State: input.State,
|
||||
Priority: input.Priority,
|
||||
Rank: input.Rank,
|
||||
TimeEstimate: UnwrapOmittable(input.TimeEstimate),
|
||||
Deadline: UnwrapOmittable(input.Deadline),
|
||||
AssignedToID: UnwrapOmittable(input.AssignedToID),
|
||||
|
||||
@@ -4621,7 +4621,7 @@ components:
|
||||
TaskOrderField:
|
||||
type: string
|
||||
enum:
|
||||
- PRIORITY
|
||||
- PRIORITY_RANK
|
||||
- CREATED_AT
|
||||
go.probo.inc/mcpgen/type: go.probo.inc/probo/pkg/coredata.TaskOrderField
|
||||
|
||||
@@ -4638,6 +4638,15 @@ components:
|
||||
$ref: "#/components/schemas/OrderDirection"
|
||||
description: Task order direction
|
||||
|
||||
TaskPriority:
|
||||
type: string
|
||||
enum:
|
||||
- URGENT
|
||||
- HIGH
|
||||
- MEDIUM
|
||||
- LOW
|
||||
go.probo.inc/mcpgen/type: go.probo.inc/probo/pkg/coredata.TaskPriority
|
||||
|
||||
Task:
|
||||
type: object
|
||||
required:
|
||||
@@ -4646,6 +4655,7 @@ components:
|
||||
- name
|
||||
- state
|
||||
- priority
|
||||
- rank
|
||||
- created_at
|
||||
- updated_at
|
||||
properties:
|
||||
@@ -4676,8 +4686,11 @@ components:
|
||||
$ref: "#/components/schemas/TaskState"
|
||||
description: Task state
|
||||
priority:
|
||||
$ref: "#/components/schemas/TaskPriority"
|
||||
description: Task priority level
|
||||
rank:
|
||||
type: integer
|
||||
description: Task priority within state
|
||||
description: Task rank within state
|
||||
time_estimate:
|
||||
anyOf:
|
||||
- $ref: "#/components/schemas/Duration"
|
||||
@@ -4830,8 +4843,15 @@ components:
|
||||
description: No state
|
||||
description: Task state
|
||||
priority:
|
||||
anyOf:
|
||||
- $ref: "#/components/schemas/TaskPriority"
|
||||
description: Task priority level
|
||||
- type: "null"
|
||||
description: No priority
|
||||
description: Task priority level
|
||||
rank:
|
||||
type: integer
|
||||
description: Task priority within state
|
||||
description: Task rank within state
|
||||
time_estimate:
|
||||
anyOf:
|
||||
- $ref: "#/components/schemas/Duration"
|
||||
|
||||
@@ -26,6 +26,7 @@ func NewTask(t *coredata.Task) *Task {
|
||||
Description: t.Description,
|
||||
State: t.State,
|
||||
Priority: t.Priority,
|
||||
Rank: t.Rank,
|
||||
TimeEstimate: t.TimeEstimate,
|
||||
CreatedAt: t.CreatedAt,
|
||||
UpdatedAt: t.UpdatedAt,
|
||||
|
||||
Reference in New Issue
Block a user