feat: todo done accepts multiple task numbers and prints completed task #96

Merged
kfickel merged 1 commit from 95_todo-done-variadic-and-print-completed into main 2026-04-24 20:13:53 +02:00
Owner

Closes #95

Summary

  • Variadic done command: streamd todo done <N>... now accepts one or more task numbers in a single invocation, collected from the same snapshot — fixing the unstable index problem when running sequential done calls
  • Highest-index-first processing: Multiple numbers are sorted descending before processing, so lower indices remain valid as higher-indexed tasks are removed from the list
  • Upfront validation: All numbers are validated before any file is mutated, preventing partial completion on invalid input
  • Print completed task: After writing @Done, the full task block is printed (same format as todo list) so the user gets visual confirmation

Before / After

Before:

$ streamd todo done 1
Marked task 1 as done

After:

$ streamd todo done 1 2
Done: [2] --- notes/work.md:55 ---
## Second task @Task @Done

Done: [1] --- notes/work.md:42 ---
## First task @Task @Done

Test plan

  • cargo test — all 197 tests pass
  • nix flake check — clippy, fmt, tests, pre-commit all green
  • New unit tests for mark_task_done (file mutation, invalid number validation)
  • New unit tests for sort/dedup logic of multi-number processing
Closes #95 ## Summary - **Variadic `done` command**: `streamd todo done <N>...` now accepts one or more task numbers in a single invocation, collected from the same snapshot — fixing the unstable index problem when running sequential `done` calls - **Highest-index-first processing**: Multiple numbers are sorted descending before processing, so lower indices remain valid as higher-indexed tasks are removed from the list - **Upfront validation**: All numbers are validated before any file is mutated, preventing partial completion on invalid input - **Print completed task**: After writing `@Done`, the full task block is printed (same format as `todo list`) so the user gets visual confirmation ## Before / After Before: ``` $ streamd todo done 1 Marked task 1 as done ``` After: ``` $ streamd todo done 1 2 Done: [2] --- notes/work.md:55 --- ## Second task @Task @Done Done: [1] --- notes/work.md:42 --- ## First task @Task @Done ``` ## Test plan - [x] `cargo test` — all 197 tests pass - [x] `nix flake check` — clippy, fmt, tests, pre-commit all green - [x] New unit tests for `mark_task_done` (file mutation, invalid number validation) - [x] New unit tests for sort/dedup logic of multi-number processing
kfickel added 1 commit 2026-04-24 20:06:55 +02:00
feat: todo done accepts multiple task numbers and prints completed task
All checks were successful
Release / Build and Release (push) Successful in 5s
Continuous Integration / Build Package (push) Successful in 44s
Continuous Integration / Lint, Check & Test (push) Successful in 1m16s
4d4118f4ce
- Change `todo done <N>` to variadic `todo done <N>...` for stable
  indices across sequential calls
- Process multiple numbers highest-index-first so lower indices remain
  valid as tasks are removed
- Validate all numbers upfront before mutating any files
- After marking done, print the full task block (same format as list)
  so the user gets visual confirmation of what was completed
- Extract `mark_task_done` as a testable helper; add unit tests
kfickel merged commit 4d4118f4ce into main 2026-04-24 20:13:53 +02:00
kfickel deleted branch 95_todo-done-variadic-and-print-completed 2026-04-24 20:13:54 +02:00
Sign in to join this conversation.
No reviewers
No labels
planned
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference: kfickel/streamd#96
No description provided.