Repository navigation
fix(import): read back each created item's when as add does - #428
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
importread 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 itswhenput it, whereaddreports the same request as misfiled.Two cases, both seen in Things 3:
"when": "today"and a deadline already past. Things files it in the Inbox with no start date.importsaidconfirmed: true;add --when today --deadline <past>exits 1 withmisfiled.whenphrase Things does not understand, such as"blorp". It lands in the Inbox.importsaidconfirmed: true;addwarns that Things did not understand the phrase.What changes
After an item is matched, its row is checked against its
whenwith the same placement logicadduses (whenCheck,placeWhen,whenPhrase).whenthat did not land:confirmed: false, reasonmisfiled, with itsuuidandlanded(where Things filed it, worded asaddwords it). The import exits non-zero withimport partially applied, likecompletion-date-dropped: the item is there, so the error says to move it withthings editrather than import it again.confirmed: false, reasonwhen, withuuidandlanded. The import exits 0, asadddoes.whenare 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 itswhen.Also fixes the deadline rule in the
startsection ofcommands.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.mdand the bundledSKILL.md.Notes
whenis used byeditfor 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.today@18:00are not checked, becauseplaceWhendoes not work out where they land. That is shared withaddandeditand needs measuring; left for a follow-up.Testing
todaythat landed, nowhen, a completed item), in plain and JSON output.make testandmake lintpass.