Skip to content

fix(import): read back each created item's when as add does - #428

Merged
ryanlewis merged 2 commits into
mainfrom
fix/import-when-readback
Oct 9, 2026
Merged

ryanlewis merged 2 commits into
mainfrom
fix/import-when-readback

Conversation

@ryanlewis

Copy link
Copy Markdown
Owner

import read back each created item's title, kind and list or heading, but not its start placement. So it confirmed an item that Things filed somewhere other than its when put it, where add reports the same request as misfiled.

Two cases, both seen in Things 3:

  • A to-do with "when": "today" and a deadline already past. Things files it in the Inbox with no start date. import said confirmed: true; add --when today --deadline <past> exits 1 with misfiled.
  • A to-do with a when phrase Things does not understand, such as "blorp". It lands in the Inbox. import said confirmed: true; add warns that Things did not understand the phrase.

What changes

After an item is matched, its row is checked against its when with the same placement logic add uses (whenCheck, placeWhen, whenPhrase).

  • A keyword or date when that did not land: confirmed: false, reason misfiled, with its uuid and landed (where Things filed it, worded as add words it). The import exits non-zero with import partially applied, like completion-date-dropped: the item is there, so the error says to move it with things edit rather than import it again.
  • A free phrase that left the item with no start date: confirmed: false, reason when, with uuid and landed. The import exits 0, as add does.
  • Items without a when are unchanged. Items the payload completes or cancels, and to-dos inside a project it completes or cancels, are not checked: Things was not measured filing a closed item by its when.

Also fixes the deadline rule in the start section of commands.md: since #421, any undated open to-do or project in the Inbox, Anytime or Someday with a deadline today or past, and no suppression, is in Today and Anytime and leaves the Inbox or Someday.

Docs updated in commands.md, agents.md and the bundled SKILL.md.

Notes

  • The reason token when is used by edit for a different case (a phrase Things may not understand on an edit). It is kept here because it is public JSON and the meaning is close; worth knowing when matching on it.
  • Timed values such as today@18:00 are not checked, because placeWhen does not work out where they land. That is shared with add and edit and needs measuring; left for a follow-up.

Testing

  • Table-driven test for both cases plus controls that still confirm (a today that landed, no when, a completed item), in plain and JSON output.
  • Test for to-dos in a completed, canceled and open project.
  • make test and make lint pass.

An import confirmed a to-do Things filed somewhere other than its when put
it, such as when today with a deadline already past, which Things files in
the Inbox. Each confirmed item with a when is now checked with the same
placement logic add uses: a keyword or date that did not land is reported
misfiled with landed and fails the import, and a free phrase Things ignored
is reported with reason when. Also corrects the deadline rule in the start
docs.
Skip the when check for to-dos inside a project the payload completes or
cancels, as for closed items. Share the things prefix between the search
and edit hints, name project edit for projects in the docs, and tighten the
checkWhens comment.
@ryanlewis
ryanlewis merged commit 5b4262d into main Oct 9, 2026
10 checks passed
@ryanlewis
ryanlewis deleted the fix/import-when-readback branch October 9, 2026 18:36
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