Skip to content

fix: reject whitespace-only descriptions and report them once - #70

Draft
alycda wants to merge 2 commits into
taskbook-sh:masterfrom
alycda:fix/quoted-board-input
Draft

alycda wants to merge 2 commits into
taskbook-sh:masterfrom
alycda:fix/quoted-board-input

Conversation

@alycda

@alycda alycda commented Oct 28, 2026

Copy link
Copy Markdown

Summary

This implements the proposal in #69. A quoted argument starting with @ stays a single board name, because it’s the only way to create a board containing spaces from the CLI, and it’s the PowerShell workaround from klaudiosinani/taskbook#41. The fix closes the gaps around that rule:

  • Blank descriptions are rejected. get_options trims the parsed description and checks it once, replacing the two duplicate checks in create_task / create_note. tb -t " " and tb -n " " are rejected, and padded descriptions are stored trimmed.
  • edit_description is trimmed too, so tb --edit @1 " " no longer blanks a description. This wasn’t in the issue; it’s the same hole.
  • TaskbookError::MissingDescription replaces InvalidId(0), and main no longer prints it a second time, so users stop seeing Invalid item ID: 0 after the missing-description message.
  • The quoting rules are documented in docs/cli-reference.md.

Testing

Node taskbook 0.3.0 stores a task with an empty description for
tb -t "@coding Fix the bug" because the quoted argument is taken
whole as a board name. These tests pin how the Rust client behaves
today: the same misparse happens, the empty-description guard
rejects the bare case, and one extra argument gets a board name
with spaces stored.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UhcvUKe8trrHnccV9XVYq5
A quoted argument starting with @ stays a single board name, which
is the only CLI way to create a board containing spaces and the
PowerShell workaround for @. Pin that with parser tests and fix the
gaps around it:

- Trim the parsed description before the empty check, so tb -t "   "
  and tb --edit @1 "   " no longer store blank descriptions.
- Return a dedicated MissingDescription error instead of
  InvalidId(0), and skip re-printing it in main, so users no longer
  see "Invalid item ID: 0" after the missing-description message.
- Document the quoting rules in docs/cli-reference.md.

Refs taskbook-sh#69

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UhcvUKe8trrHnccV9XVYq5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants