Commit Graph
11 Commits
Author SHA1 Message Date
Ansho ReiandClaude Opus 5 73ffcad733 Reformat with cargo fmt, and nothing else
Layout only, no behaviour and no wording. 161 hunks across 22 files, 98 of them
rustfmt joining a call or a message onto the one line it fits on. The config it
formats to, and how its four numbers were arrived at, is the commit before this
one.

Separate so that it is reviewable by not being read: nothing here is a decision,
and every decision is next door.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-23 00:23:04 +02:00
Ansho ReiandClaude Opus 5 139c9b012f (a6023e2) Stamp the time a ticket entered its status, and bump to 0.17.1
mv writes Committed On, Submitted On or Completed On for the status it
enters, so the board answers how long a ticket has been where it is
without guessing from file mtimes.

The three are mutually exclusive: entering stamps, leaving removes and
re-entering restamps, so a backward move under -f leaves no stale
Completed On behind. These fields are current state, like Status itself;
the trail of how the ticket got there belongs to the history log.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-22 20:31:53 +02:00
Ansho ReiandClaude Opus 5 373ba519b3 Add a worklane completions command, and bump to 0.17.0
Every argument worklane takes names a ticket, a status, a shell or a skill, and
the shell offered a directory listing for all of them. `completions <shell>`
prints a script for fish, bash, zsh, elvish and powershell, following what frig
does, which is where the shape of this comes from.

Two halves, because neither alone is enough. `clap_complete` generates the
structure from the clap definition, so a flag added to `command.rs` is completed
without anyone touching `completions.rs`, and fish gets a hand-written block
appended for what only the board knows. That block runs `worklane ls --ids` in a
command substitution, one run per keypress, 2.5ms in release on a board of
seventy-five tickets.

A status is a `util::Status` value enum now rather than a string, which was the
plan's third step and pays for itself three ways. clap refuses an unknown one at
parse time naming the four, so `cmd_mv`'s `valid_statuses` and the status half of
`cmd_ls`'s error are gone and exit 2 is what an unreal status gets, the bargain
`--due` and `--priority` already take. `status_dirs()` and `DONE` are derived
from `Status::ALL`, so the flow is written once. And clap emits the four for `mv
--status` itself. Only half free: the fish generator emits nothing for the
possible values of a *positional*, so `ls <status>` and `completions <shell>` are
listed in the appended half after all, read off the enums with `possible_values`
rather than by hand.

`ls --ids` is the machine-readable listing, and prints the short id, a tab and
the title rather than the id alone. Both readers want both fields: fish takes
what follows a tab as the description, which is what makes `worklane show <TAB>`
a list of titles instead of hex, and a script takes the id back with `cut -f1`.
It includes done, where the decorated listing leaves done out, because a
completion has to be able to name a finished ticket and `show` is most often
pointed at one. It skips a missing status directory rather than refusing, since
an error printed over a shell prompt is worse than no candidates, and the
listing still refuses one so a person can act on it. The filters all still
apply, and an unknown `--campaign` is still refused ahead of everything.

Adding the mode tipped `cmd_ls` over the boundary AGENTS.md names, so it takes an
`LsArgs`, the way `add` took `AddArgs`.

More than the criteria asked, since the cost of each was a name in a list:
tickets are completed for `set`, `append`, `relate`, `check`, `uncheck`, the
second argument of `chown` and `assign`, and `relate`'s three target flags, plus
the skill names read off `install::SKILLS`. The three lists are kept honest by
tests that walk the clap definition and fail on a ticket-taking subcommand
missing from them, or listed at the wrong position. Nested subcommands are not
walked: `campaign` is the only one, none of its three takes a ticket, and the
token counting could not tell them apart if one did.

Position is counted rather than inferred. `__worklane_first_arg_of` reads
`$tokens[2]` and the token count instead of `__fish_seen_subcommand_from`,
because `campaign ls` and `campaign show` are also an `ls` and a `show` that fish
has seen, and matching against the ticket list to find the position would run
worklane again inside the condition.

Files are turned off for the command and back on for `tui`, which is the one
argument that really is a path. The ticket said worklane takes no file arguments;
it takes those.

Campaigns and tags are completed nowhere, which needs a listing they do not have:
55ee6e3. And since fish runs whatever is on PATH, the completions are only as
current as the installed binary, an older one without `--ids` completing
nothing. That is in the README beside the install line.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-22 20:02:37 +02:00
Ansho ReiandClaude Opus 5 c437d87e9e (2f3796e) Add a --tag filter to worklane ls, and bump to 0.14.0
Tickets carry a Tags field, but ls could not select on it: finding what is
tagged bug meant reading the board. Step 1 of the plan was already done by
e41802b, which put tags: Vec<String> on TicketItem through parse_tags, so this
is the flag, the filter and the tests.

Whole values, not the field. parse_tags has already split and trimmed the
comma-separated field, so filter_by_tag compares against those values: --tag
bug is not answered by a ticket tagged bugfix, --tag "cli, filter" matches
nothing because the field as written is not itself a tag, and a ticket with no
tags matches none, however it spells it.

Case sensitive, which is the opinion the field already takes everywhere else.
tag_color draws Bug and bug in two colours because they are two tags to the
field, and a filter that folded them would list tickets carrying a tag nobody
asked for while hiding exactly the split a grooming sweep is looking for.

One tag per invocation. Several would have to decide between and and or, and
that decision is its own ticket, along with substring or regex matching and a
tag filter on the board.

A tag nothing carries lists nothing rather than being refused, deliberately
the opposite of --campaign. A campaign is an object that exists or does not,
so it is resolved before anything is read; a tag is free text with no
registry, and refusing an unknown one would mean maintaining a vocabulary the
format does not have. An emptied status keeps the message ls already gives
rather than one per filter naming what excluded them, which is what --priority
and --campaign already do.

The filter goes through filtered, the one call the three collect sites share,
so the counts are filtered by the same set as the rows. Every filter is an
Option and none asked for keeps everything, which is what makes them compose
in any combination. cmd_ls is now at four filters and the directory, two of
them adjacent &Option<String> parameters a caller can swap silently: left as
positionals rather than refactored mid-feature, with AGENTS.md recording that
the next filter takes an LsArgs struct the way add took AddArgs.

assets/PLAN.md said in as many words that there was no tag filter yet, so it
would have been actively wrong. It now says what --tag can and cannot answer:
it finds what is tagged bug, it does not enumerate the vocabulary, which is
the question a grooming sweep starts from. The README's ls row also gained
--campaign, which had never been documented there.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-22 14:54:50 +02:00
Ansho ReiandClaude Opus 5 8013c2b74d (d8e78cd) Clear the clippy warnings, and bump to 0.8.1
`cargo clippy --all-targets` was reporting 96 warnings, 14 of them in the
binary. It is now clean from a cold cache, and the 211 tests still pass.

`clippy --fix` took the mechanical ones: needless borrows, `map_or` that is
`is_some_and`, `push_str` of a single character, manual `split_once`, and
`&PathBuf` parameters in the test fixtures. It also moved the `handlers.rs`
test module to the end of the file, which is what `items_after_test_module`
was pointing at.

Three by hand. `cmd_add` took nine parameters threaded from `main`, and now
takes `AddArgs`, which is how `set`, `append` and `check` already pass theirs;
the handler destructures it so the body reads as before, and `add --help` is
unchanged. The collapsed `if` in `content_trim` needed reindenting, since
`--fix` left its body at the old depth. And the two `split_once` rewrites read
as `.split_once(..).map(|(_, value)| value)` rather than clippy's `.map(|x|
x.1)`.

The two eight-argument `create_ticket` test fixtures keep an
`allow(too_many_arguments)` carrying the reason: the lint is right that
twenty-five positional call sites read as a wall of strings, but replacing them
with a named-field struct is a refactor and not a warning sweep. a34a316 tracks
it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-21 15:37:11 +02:00
Ansho ReiandClaude Opus 5 2503f9aee9 (3b7edd7) Show priority as a glyph, and bump to 0.2.0
A bare digit in a listing is easy to skip over. Levels render as a
two-segment meter that empties as the level rises: ●● 1, ●◐ 2, ●○ 3,
◐○ 4, ○○ 5, with ·· for unset and ?? for a value outside the range.

Only ●, ◐, ○ and · are used, because they are what frig draws for its
status indicators and so are known to be in the terminal font. The first
cut of this used the quadrant circles ◕ and ◔, which are in a quarter as
many fonts, so terminals substituted them from a fallback that drew them
oversized and the column came out ragged. Two cells of a three-level ramp
gives five steps of ink, 2, 1.5, 1, 0.5, 0, without leaving that safe set.
Tests pin the safe set, the equal width and the monotonic emptying.

The mark carries the level on its own, because colour cannot. Output is
colourless whenever it is piped, which is how the opencode tools and every
script read it, and NO_COLOR turns it off in a terminal too. Colour only
accentuates: brightred, red, orange, cyan, grey, skipping green because
green means title.

The number counts up while the meter empties, since 1 is the most urgent.
That is the convention, but it reads as a bug unless written down, so it
is in AGENTS.md and in the legend.

Both the ramp and the legend come from priority_mark, and `ls --help`
prints the legend, since nothing in a listing explains a mark. brightred
is indexed like grey, for the same reason: it is the spelling that
renders.

Minor bump: two new flags, a new metadata field and a changed ls row,
covering dca0b61 and this ticket.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-20 15:50:09 +02:00
Ansho ReiandClaude Opus 5 ddbd45e332 (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>
2026-08-20 15:36:19 +02:00
Ansho ReiandClaude Opus 5 c675da1d2a (7ac39e3) Fix byte-slice panics in id shortening and date formatting
Three places sliced strings by byte offset on values that come from a
filename or a file field, neither of which is validated.

The disambiguation list took &short_id[..7], so two tickets whose names
were shorter than that aborted the process while printing the options.
collect_ticket_items guarded on length but still cut at byte 7, so a
multibyte character straddling the cut panicked. format_created_at read
four fixed offsets after a length check that a multibyte value passes.

Add short_id, which counts characters, and use it in both display paths.
Parse the timestamp with chrono instead of slicing, dropping the column
when the value will not parse. The format string it writes and the one it
reads are now the same constant, so they cannot drift.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-20 13:56:10 +02:00
Anshorei 94da69a1b2 Make ls status non-flag argument 2026-05-14 22:32:17 +02:00
Anshorei 7d40159959 (e97d55) Add show command 2026-05-14 22:28:00 +02:00
Anshorei fd216b056c (177665) Add ls command 2026-05-14 21:37:11 +02:00