Repository navigation
feat(list): say why a repeating project template lists nothing - #272
Merged
Merged
Conversation
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
force-pushed
the
fix/issue-174-repeating-project-note
branch
from
September 10, 2026 16:18
24e3091 to
e3af568
Compare
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.
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 projectsdoes not report.things --project <template>therefore returns an empty list and said nothing about why.An empty listing whose
--projectmatched a repeating project template now carries a one-line note on the warning stream. It goes to stderr in both modes, so a--jsonconsumer still reads a well-formed empty array on stdout.The note is held back on
trash,logbookandrepeating, 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
--projectfilter 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.RepeatingorcheckRepeatingon 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 lintandmake fmtall clean.New tests in
internal/dbcover 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/thingscover 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--jsonstdout 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.mdandinternal/skill/SKILL.mdboth describe the note and the views it is held back on.Review
/code-review --fixraised 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.