Skip to content

fix(add): check the list Things picks when titles fold together - #390

Merged
ryanlewis merged 6 commits into
mainfrom
fix/name-collisions
Oct 7, 2026
Merged

ryanlewis merged 6 commits into
mainfrom
fix/name-collisions

Conversation

@ryanlewis

Copy link
Copy Markdown
Owner

When two projects, or two areas, share a title under the CLI's folding (case, full case folding, NFC/NFD, compatibility forms), the CLI preferred the exact-case title, and since #383 the read-back accepted any list sharing the title. Things does neither: it files into the matching row whose uuid sorts first, byte by byte.

What I measured in Things 3

  • 16 pairs of zz projects differing only in case, created in either order and with differing index: things:///add with list= went to the smallest uuid every time, including when the other project's title matched exactly. Creation order and index made no difference.
  • A pair where byte order and case-insensitive order disagree (HUq6…, QbEp…, dPXM…): Things took HUq6…, so it is byte order. A 21-character uuid VQjv… lost to HGL4…, so it is string order, not numeric.
  • 6 pairs of zz areas: add list= and add-project area= both took the smallest uuid, again ignoring the exact-case title. So did json and update (project area=, to-do list=).
  • NFC/NFD (Café) and fullwidth (WIDE/wide) collisions follow the same rule.
  • A project completed or cancelled today (not yet logged) still counts. Things files into it, even when it is the only match, and reopens it; update with list= and list-id= does the same. A project completed two days ago (logged) or trashed does not count.

Change

  • AddTarget picks the smallest uuid among projects that are open or closed but not yet logged (repeating templates excluded), then areas.
  • project add --area, project edit --area and import's area pick the same area (titledArea), so project edit --area now tells two same-titled areas apart.
  • The add and import read-backs check that one list again; ListTitleShared is removed.
  • Docs and the bundled skill say what Things picks.

Verification

make test and make lint pass. I also ran the built binary against the zz items: add --project "…Fold" was confirmed in FOLD; add --list into the canceled-today min-uuid project and a lone completed-today project was confirmed without a warning; project add --area "…Aa1" was confirmed in AA1; import of a to-do and a project was confirmed; project edit --area moved a project from the larger-uuid area to the one Things picks, and a re-run naming the other case was a no-op.

When two projects, or two areas, share a title under the CLI's folding,
Things files into the one whose uuid sorts first byte by byte, even when
another one's title matches exactly. Measured in Things 3 with add,
add-project's area, update and json, over pairs that differ in case,
normalisation and compatibility forms, created in either order. A
project completed or cancelled today, which Things still shows, takes
part too, and Things files into it even with no other match; a logged
or trashed one does not.

AddTarget and project add/edit's area match now pick that row, so the
read-back checks the list Things filed into instead of any list sharing
the title, and project edit --area tells two same-titled areas apart.
ListTitleShared goes, since nothing is left unknown.
…project by uuid

Review fixes for the list Things picks:
- a repeating template is left out of the title match only, so its uuid
  still names it (edit --heading in a template project, add --list
  <template-uuid>)
- by uuid Things files into any project, closed, logged or trashed, and
  reopens a closed one (measured with list-id)
- AddTarget returns a Target, and AreaTarget is the one area pick for
  add, project add/edit --area and import
- add, edit, project add and project edit note on stderr when several
  lists share the title and which one Things will use, and when the
  project is closed or trashed
- tests for the other "Move completed items to Logbook" choices, which
  the docs now say were not measured, and for unreadable areas
- the docs no longer say only open projects match
@ryanlewis
ryanlewis force-pushed the fix/name-collisions branch from cad6fb5 to 36e9001 Compare October 7, 2026 22:30
…y real moves

Review fixes, round 3:
- db.Target carries ByUUID, set by AddTarget and AreaTarget, in place of
  comparing the target with the trimmed reference at each call site; an
  import area given as a padded uuid is no longer taken for that area,
  since Things takes area by title and does not trim it
- a project and an area sharing a title get a note naming the project,
  which Things picks whichever uuid sorts first (measured)
- edit and project edit only note when the item moves somewhere new
- project edit --area "" counts as a possible change again
- checkAreaID uses AreaTarget, and checkMove keeps one target
- measured: update moves a to-do into a logged or trashed project by
  list-id, reopening a closed one, and --heading alone moves it under a
  heading of its own logged or trashed project; tests pin both
- docs describe the notes for edit and project edit
@ryanlewis
ryanlewis merged commit e7dd9cf into main Oct 7, 2026
10 checks passed
@ryanlewis
ryanlewis deleted the fix/name-collisions branch October 7, 2026 22:42
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