-
Notifications
You must be signed in to change notification settings - Fork 3.1k
feat: decouple task priority from task order #652
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4e8a2c8
feat: decouple task priority from task order
leex279 63d9a13
feat: add priority column to complete_setup.sql for fresh installations
leex279 56e2e22
fix: include priority field in task creation payload
leex279 fb7a53d
feat: make priority migration safe and idempotent
leex279 52a2619
feat: enforce NOT NULL constraint on priority column
leex279 d47c0e6
feat: add priority support to task creation API
leex279 4d0e732
feat: implement clean slate priority migration (no backward compatibi…
leex279 68839c1
refactor: rename TaskPriority.tsx to TaskPriorityComponent.tsx for co…
Wirasm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 14 additions & 17 deletions
31
archon-ui-main/src/features/projects/tasks/types/priority.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,39 +1,36 @@ | ||
| /** | ||
| * Priority System Types | ||
| * | ||
| * Defines user-facing priority levels separate from task_order (which handles drag-and-drop positioning). | ||
| * Priority is for display and user understanding, not for ordering logic. | ||
| * Defines priority levels independent from task_order (which handles drag-and-drop positioning). | ||
| * Priority represents semantic importance and is stored directly in the database. | ||
| */ | ||
|
|
||
| export type TaskPriority = "critical" | "high" | "medium" | "low"; | ||
|
|
||
| export interface TaskPriorityOption { | ||
| value: number; // Maps to task_order values for backwards compatibility | ||
| value: TaskPriority; // Direct priority values from database enum | ||
| label: string; | ||
| color: string; | ||
| } | ||
|
|
||
| export const TASK_PRIORITY_OPTIONS: readonly TaskPriorityOption[] = [ | ||
| { value: 1, label: "Critical", color: "text-red-600" }, | ||
| { value: 25, label: "High", color: "text-orange-600" }, | ||
| { value: 50, label: "Medium", color: "text-blue-600" }, | ||
| { value: 100, label: "Low", color: "text-gray-600" }, | ||
| { value: "critical", label: "Critical", color: "text-red-600" }, | ||
| { value: "high", label: "High", color: "text-orange-600" }, | ||
| { value: "medium", label: "Medium", color: "text-blue-600" }, | ||
| { value: "low", label: "Low", color: "text-gray-600" }, | ||
| ] as const; | ||
|
|
||
| /** | ||
| * Convert task_order value to TaskPriority enum | ||
| * Get task priority display properties from priority value | ||
| */ | ||
| export function getTaskPriorityFromTaskOrder(taskOrder: number): TaskPriority { | ||
| if (taskOrder <= 1) return "critical"; | ||
| if (taskOrder <= 25) return "high"; | ||
| if (taskOrder <= 50) return "medium"; | ||
| return "low"; | ||
| export function getTaskPriorityOption(priority: TaskPriority): TaskPriorityOption { | ||
| const priorityOption = TASK_PRIORITY_OPTIONS.find((p) => p.value === priority); | ||
| return priorityOption || TASK_PRIORITY_OPTIONS[2]; // Default to 'Medium' | ||
| } | ||
|
|
||
| /** | ||
| * Get task priority display properties from task_order | ||
| * Validate priority value against allowed enum values | ||
| */ | ||
| export function getTaskPriorityOption(taskOrder: number): TaskPriorityOption { | ||
| const priority = TASK_PRIORITY_OPTIONS.find((p) => p.value >= taskOrder); | ||
| return priority || TASK_PRIORITY_OPTIONS[TASK_PRIORITY_OPTIONS.length - 1]; // Default to 'Low' | ||
| export function isValidTaskPriority(priority: string): priority is TaskPriority { | ||
| return ["critical", "high", "medium", "low"].includes(priority); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.