(dca0b61) Add priority as a ticket field
Priority lived in tags, as p1 to p3, which ls could neither sort nor filter on, nothing validated, and a typo like P1 passed silently. ls sorted by title only, so a backlog of any size gave no ordering signal. Levels are 1 to 5 with 1 most urgent, matching what the tags meant. Omitting the flag leaves the field _Not set_, like Due and Owner: there is no implicit middle level, because a priority nobody chose is worse than none. clap rejects anything outside the range before a ticket is written. Priority parses to three states rather than two. A stored value outside the range is Invalid, kept distinct from Unset, so a typo cannot read as "no priority": it shows as ? and sorts just ahead of the unset tail. ls sorts on priority and falls back to the old title sort, and --priority filters, composing with the status filter in both the grouped and the filtered listing. TicketItem becomes a struct, since a sixth tuple field was past reading. Migrated the 31 tickets already carrying p1 to p3 tags: the level moves to the field and the tag is dropped. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
b7781a830c
commit
ddbd45e332
@@ -37,6 +37,7 @@ Add a new ticket to the backlog.
|
||||
- `--tags` (or `-g`): Tags (comma-separated)
|
||||
- `--due` (or `--due`): Due date in YYYY-MM-DD format
|
||||
- `--owner` (or `-o`): Owner name
|
||||
- `--priority`: Priority level, 1 (most urgent) to 5 (least). Unset if omitted
|
||||
|
||||
```bash
|
||||
worklane add -t "Implement login" -d "Add user login page" -t login,auth -p "Design UI" "Build backend" "Write tests" --due 2026-06-01 --owner "ilya"
|
||||
@@ -56,11 +57,15 @@ List tickets, optionally filtered by status.
|
||||
**Valid statuses:** `backlog`, `committed`, `reviewing`, `done`
|
||||
|
||||
```
|
||||
worklane ls # List all tickets
|
||||
worklane ls backlog # List tickets in backlog
|
||||
worklane ls done # List completed tickets
|
||||
worklane ls # List all tickets
|
||||
worklane ls backlog # List tickets in backlog
|
||||
worklane ls done # List completed tickets
|
||||
worklane ls --priority 1 # Only the most urgent, any status
|
||||
worklane ls backlog --priority 2 # Composes with the status filter
|
||||
```
|
||||
|
||||
Tickets are listed priority first, then by title. Tickets with no priority sort last.
|
||||
|
||||
### `worklane show`
|
||||
|
||||
Show the full details of a single ticket by UUID or title.
|
||||
|
||||
@@ -76,6 +76,10 @@ export const add = tool({
|
||||
owner: tool.schema
|
||||
.string()
|
||||
.describe("Ticket owner name. If omitted, defaults to the git user."),
|
||||
priority: tool.schema
|
||||
.string()
|
||||
.describe("Priority level, 1 (most urgent) to 5 (least). Left unset if omitted.")
|
||||
.optional(),
|
||||
},
|
||||
async execute(args: Record<string, any>, context: ToolContext) {
|
||||
if (!args.title) {
|
||||
@@ -109,6 +113,7 @@ export const add = tool({
|
||||
if (args.tags) cmd.push("--tags", args.tags);
|
||||
if (args.due) cmd.push("--due", args.due);
|
||||
if (args.owner) cmd.push("--owner", args.owner);
|
||||
if (args.priority) cmd.push("--priority", String(args.priority));
|
||||
|
||||
try {
|
||||
return await run(cmd, context);
|
||||
@@ -120,15 +125,20 @@ export const add = tool({
|
||||
|
||||
export const ls = tool({
|
||||
description:
|
||||
"List all worklane tickets. Optionally filter by status (backlog, committed, reviewing, done).",
|
||||
"List all worklane tickets, sorted by priority then title. Optionally filter by status and by priority.",
|
||||
args: {
|
||||
status: tool.schema
|
||||
.enum(["backlog", "committed", "reviewing", "done"])
|
||||
.describe("Filter by status")
|
||||
.optional(),
|
||||
priority: tool.schema
|
||||
.string()
|
||||
.describe("Only show tickets at this priority, 1 (most urgent) to 5 (least)")
|
||||
.optional(),
|
||||
},
|
||||
async execute(args: Record<string, any>, context: ToolContext) {
|
||||
const cmd = args.status ? ["ls", args.status] : ["ls"];
|
||||
if (args.priority) cmd.push("--priority", String(args.priority));
|
||||
try {
|
||||
return await run(cmd, context);
|
||||
} catch (err: any) {
|
||||
|
||||
Reference in New Issue
Block a user