Skip to content

fix(edit): guard --complete and --cancel on closed items like complete and cancel - #388

Merged
ryanlewis merged 3 commits into
mainfrom
fix/edit-closed-guard
Oct 7, 2026
Merged

ryanlewis merged 3 commits into
mainfrom
fix/edit-closed-guard

Conversation

@ryanlewis

@ryanlewis ryanlewis commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

things edit --complete and --cancel now use the same already-closed check that things complete and things cancel got in #384. The check is shared, not copied.

  • --complete on a completed item, or --cancel on a cancelled one: the status is left out of the write. If nothing else would change the item and there is no --reveal, nothing is sent: the item is printed with a note and the command exits 0. Otherwise the other flags are sent and read back as usual, so --complete --title x on a completed item still renames it.
  • --cancel on a completed item, or --complete on a cancelled one: the whole edit is refused and nothing is sent, other flags included. This matches complete/cancel. Before this change, Things applied the switch: a completed item became cancelled.

Checked in Things 3: things:///update with completed=true on a completed item changes nothing (same stop date, same modification date). canceled=true on a completed item switches it to cancelled. A title change on a completed item applies and keeps the stop date. --duplicate of a cancelled item makes a cancelled copy.

With --duplicate the guard is skipped and the status is sent as asked: the edit applies to the copy, and the item stays as it is, so --duplicate --cancel on a completed item gives a cancelled copy. Only completed and cancelled count as closed; any other raw status passes as before.

project edit shares the code path and gets the same behaviour. SKILL.md and docs/content/commands.md are updated.

…e and cancel

edit --complete on an item already completed, or --cancel on one already
cancelled, now leaves the status out of the write: with no other flags
nothing is sent and the item is printed with a note, and with other flags
those are sent and read back as usual. Completing a cancelled item, or
cancelling a completed one, refuses the whole edit and sends nothing.
Before, edit sent the status anyway, and Things switched a completed item
to cancelled. The check is shared with complete and cancel.
--duplicate edits a copy Things makes with the item's status and leaves the
item alone, so its status flag is sent as asked. Only completed and
cancelled count as closed; any other status passes as before. The
nothing-sent note is shared with complete and cancel, and applyEdit takes
the target status runEdit works out instead of the two flags.
@ryanlewis
ryanlewis merged commit 2eada30 into main Oct 7, 2026
10 checks passed
@ryanlewis
ryanlewis deleted the fix/edit-closed-guard branch October 7, 2026 22:10
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