Skip to content

refactor: share small helpers and the --when read-back verdict - #433

Merged
ryanlewis merged 2 commits into
mainfrom
refactor/cmd-dedupe
Oct 9, 2026
Merged

ryanlewis merged 2 commits into
mainfrom
refactor/cmd-dedupe

Conversation

@ryanlewis

Copy link
Copy Markdown
Owner

Post-v0.10.0 cleanup of small repeated helpers in cmd/things and internal.

  • The "task"/"project" word comes from model.TaskType.String(). kindWord, taskKind and importCreate.kind are gone, along with three inline copies.
  • model.Status.Closed() replaces the four "completed or cancelled" checks.
  • New helpers: taskUUIDs for the uuid-list loops, thingsCmd for things plus the global flags, and withReason/detailLines for the import error's per-reason sections. importCreates reads the payload's type once.
  • The four AppleScript complete/cancel scripts are now one setStatus, which quotes the uuid with appleScriptString.
  • add and import judge a new item's --when with one whenCheck.verdict, so the two read-backs cannot drift apart again (7e44e33, 5b4262d). newMisfiled builds misfiledError for both add and edit.

The only behaviour change is deliberate: the agent brief's singleLine now folds every line break oneLine does, not just \n and \r\n, so a title with a bare \r, a tab or a Unicode line separator cannot break the Markdown. A new test covers it.

make test and make lint pass.

Use TaskType.String for the task/project word, add Status.Closed,
taskUUIDs, thingsCmd and a reason filter for import errors, and fold
the four AppleScript status scripts into setStatus, which now quotes
the uuid. add and import judge a new item's --when with one
whenCheck.verdict, and misfiledError is built by newMisfiled.

singleLine in the agent brief now folds every line break oneLine
does, so a title with a bare \r or a Unicode separator cannot break
the Markdown.
@ryanlewis
ryanlewis force-pushed the refactor/cmd-dedupe branch from b365951 to 3bd5e0c Compare October 9, 2026 23:16
@ryanlewis
ryanlewis merged commit c78ad8f into main Oct 9, 2026
8 checks passed
@ryanlewis
ryanlewis deleted the refactor/cmd-dedupe branch October 9, 2026 23:19
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.

1 participant