Repository navigation
fix(add): match --list and --heading titles untrimmed, as Things does - #359
Merged
Merged
Conversation
Things ignores case in things:///add's list and heading, but not surrounding space: throwaway to-dos with list=" Personal " and a padded project name went to the Inbox, and a padded heading was dropped. AddTarget trimmed them, so add gave no warning. AddTarget now folds titles without trimming. A uuid still matches with surrounding space trimmed, since it goes to Things as list-id and the CLI sends that trimmed; project add --area now does the same for area-id. Tags are trimmed by Things, so FoldTag stays for them; its comment no longer claims area names are trimmed.
This was referenced Oct 3, 2026
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.
What was wrong
addwarns when--list/--project/--headingwon't land where you asked (#343). The check (db.AddTarget) trimmed surrounding space before matching, on the assumption that Things does the same. It doesn't. I tested with throwaway items, sendingthings:///addURLs straight to the app:list= Personal(an area, padded) went to the Inbox.list= zz things-cli test E proj(a project, padded) went to the Inbox.heading= Setupwas dropped, and the to-do went to the project with no heading.list=ZZ THINGS-CLI TEST E PROJandheading=setupmatched, so case is ignored.So a padded
--listor--headinggot no warning and landed somewhere else.Tags are different.
tags= Ideas,tags=ideasandtags=Ideas, Callsall got the right tags, so Things trims tags and ignores their case.FoldTagwas already right for them, but its comment claimed area names are trimmed too.What changed
AddTargetcompares project, area and heading titles withFoldCaseand no trim, so a padded name now gets the warning. The add is still sent.list-id, which the CLI sends trimmed, so a padded uuid keeps working as it did before.project add --areanow trims a uuid the same way forarea-id. Before this, a padded uuid fell through as an area title and got no area.FoldTagcomment now says the trim is for tags only.FindAreaUUIDstays:things open --areastill uses it.How it was tested
TestAddTarget: padded project, area and heading; a padded uuid; an area whose stored title has a trailing space. Also padded--list/--headingwarning cases and padded-uuidlist-id/area-idcases in the cmd tests. They failed before the change and pass now.make testandmake lintpass.add --list " Personal "warned and went to the Inbox.add --list personalgave no warning and was filed under Personal. All throwaway items are in the Trash.