Repository navigation
fix(open): match --tag and --area names case-insensitively - #284
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KDj3L9Q1zCh4WDnvTC2CCj
SQLite's NOCASE folds ASCII only, so `open --tag ärger` missed a tag named "Ärger" while Things itself matches it. Match in Go with the same fold UnknownTags uses, keeping UUID-first and exact-case-first.
ToLower misses case variants such as final sigma, and a blank ref folded onto an untitled row. Found by /code-review.
ryanlewis
force-pushed
the
claude/optimistic-johnson-gmuoy3
branch
from
September 30, 2026 03:11
a9aa262 to
07f965a
Compare
This was referenced Sep 30, 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.
Symptom
things open --tag workfails with "tag not found" when the tag is titledWork, andthings open --area workfails the same way for an area titledWork. Things.app itself matches these names ignoring case, and so does the CLI's own tag check on writes (UnknownTags, behind--strict-tagsand--create-tags). So a tag name that--strict-tagsaccepts could still fail inopen.Fix
FindTagUUIDandFindAreaUUIDnow match titles ignoring case and surrounding space, withstrings.EqualFold. A blank ref never matches an untitled row. Which row wins: a UUID match first, then an exact-case title, then the first title that matches ignoring case, in Things' list order. Before this change,LIMIT 1with noORDER BYleft ties to SQLite.The match happens in Go, not with SQLite's
COLLATE NOCASE, because NOCASE only folds ASCII. With NOCASE,open --tag ärgerwould still miss a tag namedÄrger. Things does match it: read-only AppleScript lookups resolvetag "BOOKINGS"to the tagBookings, and resolve a to-do named…Bifröstwhen asked for…BIFRÖST.This folds in #285, which fixed the tag half with NOCASE and an exact-match preference. Its extra
URGENTtest case is included here.openis the only caller of these two lookups.docs/content/commands.mdandinternal/skill/SKILL.mdnow say names match case-insensitively.Testing
ärger/ÄRGER→Ärger,CAFÉ→Café,ΚΟΣ→κος). The non-ASCII cases fail with the NOCASE version.make testandmake lintpass.Ran as part of a weekly bughunt routine.