(07ac4e1) Filter campaign ls by state, and lay its listing out as a table, and bump to 0.33.6
campaign ls printed every campaign and offered no way to narrow it, and the row was assembled by hand, so a long title pushed the standing out of line with the row above it and the created date the file already carries was not shown at all. --state takes open, done or empty and matches against Standing::state(), so the derived value keeps one definition: a campaign reads [open] in the listing if and only if --state open lists it. --state rather than --status, which names one of the five ticket statuses everywhere else and would invite --state backlog here. empty is the third value because an empty campaign derives None deliberately, and a filter that could not reach those would leave what has been filed and forgotten answerable only by reading the whole listing. A filter that matches nothing names the value back, since a silent listing reads as the other empty case. The filter reaches --ids as well, the way ls --ids keeps its own, and is the only thing that makes that path count members: an unfiltered completion is as cheap as it was. The columns are measured on the raw values and padded before anything is painted, the rule metadata_cells follows. The codename is measured with the title rather than given a column of its own: a campaign filed without one spends nothing on it, so a column for it would be one most rows pad into and some leave empty, and what a reader lines up is where a name ends and its progress begins. A flag's possible values now come off the command that holds the flag, so campaign ls --state reaches ls's own arguments rather than campaign's. The prompt offered nothing there while fish offered the three values, which made a liar of the rule that a ValueEnum added anywhere is typeable on the board the day it is added. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
3e732535f8
commit
634a1f44c4
@@ -168,6 +168,7 @@ fields; a goal is a campaign.
|
||||
|
||||
```
|
||||
worklane campaign ls
|
||||
worklane campaign ls --state empty # filed against nothing, which is the one to ask about
|
||||
worklane campaign show v1
|
||||
worklane campaign add --title "..." --codename v1 --description "..."
|
||||
worklane campaign set v1 --title "..." # or --description or --codename, on one already filed
|
||||
@@ -183,6 +184,12 @@ tui is usable on a narrow terminal" is a campaign. "The tui tickets" is a tag.
|
||||
them in a container says nothing that the tag did not already say.
|
||||
- **Check what exists first.** `campaign ls` before proposing a new one, or you will
|
||||
propose a second container for a goal that already has one.
|
||||
- **`--state empty` finds the containers nothing was ever filed against.** A campaign with
|
||||
no members is neither open nor done, so it is invisible to `--state open` and reads as
|
||||
just another row in the full listing. Either the tickets for that goal exist and were
|
||||
never assigned to it, which is an `assign` away, or the goal is one nobody is working,
|
||||
which is worth saying out loud. A campaign cannot be discarded, so an empty one stays on
|
||||
the board until it has members.
|
||||
- **A ticket is in at most one campaign**, and `assign` moves it rather than adding a
|
||||
second. So two proposed campaigns that overlap are really one proposal to take members
|
||||
out of the other, and it has to say so.
|
||||
|
||||
@@ -302,6 +302,7 @@ there is no such thing as a done campaign holding an open ticket.
|
||||
worklane campaign add --title "First public release" --codename v1 \
|
||||
--description "Everything that has to ship before the tag."
|
||||
worklane campaign ls # every campaign, its codename, how far it has got
|
||||
worklane campaign ls --state open # only the ones with work left: open, done, empty
|
||||
worklane campaign ls --ids # id and title, tab separated, like ls --ids
|
||||
worklane campaign show v1 # its body, then its members by status
|
||||
worklane campaign set v1 --title "..." # replace the title, description or codename
|
||||
|
||||
+8
-1
@@ -726,8 +726,14 @@ export const campaign_append = tool({
|
||||
|
||||
export const campaign_ls = tool({
|
||||
description:
|
||||
"List campaigns with how far each has got: id, codename or title, owner, and done members against total. Open until every member is done or discarded.",
|
||||
"List campaigns with how far each has got: created, id, codename or title, and done members against total. Open until every member is done or discarded.",
|
||||
args: {
|
||||
state: tool.schema
|
||||
.enum(["open", "done", "empty"])
|
||||
.describe(
|
||||
"Only campaigns in this state. A campaign with no members is neither open nor done, which is what 'empty' reaches.",
|
||||
)
|
||||
.optional(),
|
||||
ids: tool.schema
|
||||
.boolean()
|
||||
.describe("Print only id and title, tab separated, one per line, for parsing.")
|
||||
@@ -735,6 +741,7 @@ export const campaign_ls = tool({
|
||||
},
|
||||
async execute(args: Record<string, any>, context: ToolContext) {
|
||||
const cmd = ["campaign", "ls"];
|
||||
if (args.state) cmd.push("--state", String(args.state));
|
||||
if (args.ids) cmd.push("--ids");
|
||||
try {
|
||||
return await run(cmd, context);
|
||||
|
||||
Reference in New Issue
Block a user