Skip to content

feat(list): say why a repeating project template lists nothing - #272

Merged
ryanlewis merged 3 commits into
mainfrom
fix/issue-174-repeating-project-note
Sep 10, 2026
Merged

ryanlewis merged 3 commits into
mainfrom
fix/issue-174-repeating-project-note

Conversation

@ryanlewis

Copy link
Copy Markdown
Owner

Part of #174. This ships part (b) only. Part (a) is left open, for the reason below.

What changed

Since #171 the to-dos inside a repeating project template are held out of every open view, because they would otherwise list against a project things projects does not report. things --project <template> therefore returns an empty list and said nothing about why.

An empty listing whose --project matched a repeating project template now carries a one-line note on the warning stream. It goes to stderr in both modes, so a --json consumer still reads a well-formed empty array on stdout.

The note is held back on trash, logbook and repeating, which keep templates and with them their contents. An empty logbook there means nothing has closed yet, not that the view hides the rows, and claiming otherwise would send the reader away from the one view that would show the row. The check reads the same flag the query builder uses, so the message and the SQL cannot drift apart.

The reference is matched the way a --project filter matches it, uuid exactly or title literally and case-insensitively, so the note appears for exactly the listings the filter emptied. A failed lookup for the note is swallowed: the listing already succeeded, and an explanation that could not be worked out is no reason to fail a read that did.

Why part (a) is not here

Part (a) needs to know how a to-do inside a repeating project template is actually laid out, and this machine has no such row to read.

I checked all ten daily backups from 2026-09-01 to 2026-09-10. No repeating project exists in any of them: zero rows of project type carry either a recurrence rule or a template pointer. Only three of the backups hold repeating rows at all, and in those the two templates are both to-dos sitting inside an ordinary non-repeating project. Those two templates had produced 17 generated instance rows between them, and not one of the 17 was open.

So there is nothing to confirm whether such a child carries a recurrence rule or a template pointer of its own, and changing Task.Repeating or checkRepeating on a guess is exactly what the issue asks not to do. I have written up the probe that would settle it.

How tested

make test, make lint and make fmt all clean.

New tests in internal/db cover the reference predicate: matched by uuid and by title, case-insensitively, refused for an ordinary project and for a repeating to-do, matched literally so a title carrying LIKE wildcards cannot claim a template it does not name, and false throughout on a schema with no recurrence column. Another pins the three views that keep templates.

New tests in cmd/things cover the note itself: it appears for the template by title and by uuid; it stays quiet for an ordinary project, an unknown project, an unfiltered listing, and the logbook and trash views; and under --json stdout is still an empty array while the note is on stderr.

Manually against a fixture database, naming the template prints the note and nothing else, naming an ordinary project lists its tasks with no note, and the JSON run prints [] on stdout with the note on stderr.

Docs

docs/content/commands.md and internal/skill/SKILL.md both describe the note and the views it is held back on.

Review

/code-review --fix raised three findings and all three were fixed. The note fired on the views that keep templates, giving an empty result there a false explanation; the new docs paragraph contradicted the sentence directly above it for the same reason; and an overlong line in the shipped skill file needed rewrapping. Nothing was skipped.

@ryanlewis ryanlewis closed this Sep 10, 2026
@ryanlewis ryanlewis reopened this Sep 10, 2026
Since issue #171 the to-dos inside a repeating project template are held
out of every open view, because they would otherwise list against a
project `things projects` does not report. `things --project <template>`
therefore returns an empty list, and said nothing about why.

An empty listing whose --project matched a repeating project template now
carries a one-line note on the warning stream. It goes to stderr in both
modes, so a --json consumer still reads a well-formed empty array on
stdout. A failed lookup for the note is swallowed: the listing itself
already succeeded, and an explanation that could not be worked out is no
reason to fail a read that did.

The reference is matched the way a --project filter matches it, uuid
exactly or title literally and case-insensitively, so the note appears
for exactly the listings the filter emptied.

Refs #174
trash, logbook and repeating keep repeating templates and, with them,
their contents, so a to-do out of a project template does list there once
it is trashed or closed. The note claimed otherwise on those views: an
empty logbook while the template's to-dos are all still open means
nothing has closed yet, and saying its to-dos are not listed sent the
reader away from the one view that would show the row.

The note now consults db.HidesTemplateContentsView, which reads the same
includesTemplates flag buildListQuery does, so the message and the SQL
cannot drift apart. Found by code review.
The pull_request event did not start the CI workflow for this branch;
only CodeQL ran. This commit exists to fire it. It is empty and the
squash merge discards it.
@ryanlewis
ryanlewis force-pushed the fix/issue-174-repeating-project-note branch from 24e3091 to e3af568 Compare September 10, 2026 16:18
@ryanlewis
ryanlewis merged commit 27c6a1a into main Sep 10, 2026
10 checks passed
@ryanlewis
ryanlewis deleted the fix/issue-174-repeating-project-note branch September 10, 2026 16:21
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