Repository navigation
fix(list): file closed items by the calendar day, not manualLogDate - #233
Merged
Merged
Conversation
Things moves a closed item out of Today and into the Logbook when the day rolls over, or sooner if you run "Log Completed Now". The CLI keyed both views on manualLogDate alone, so an item ticked off today appeared in the logbook while the app still had it under Today, and today --include-completed went on showing items closed days ago. Measured against the app on 10 Sep 2026 by uuid. manualLogDate was five days old. The app's Today held six closed items, all closed that day; its Logbook held forty items closed on the three previous days, every one of them with a stopDate after manualLogDate. So manualLogDate cannot be the boundary on its own, or those forty would still be under Today. Both conditions now hold together: an item stays under Today while it was closed on the current calendar day and its stopDate is after manualLogDate. Keeping manualLogDate is what leaves "Log Completed Now" an effect. The Logbook takes the complement over the set Today can actually hold, not over the calendar day. A to-do ticked off in the Inbox, in Anytime, or ahead of its date in Upcoming is never under Today, so the Logbook takes it the moment it closes; subtracting the day alone would have left those rows listed nowhere. The same argument covers a to-do whose parent project is trashed. COALESCE keeps the negation null-safe over the nullable scheduling columns. This narrows today --include-completed: it was every item closed since manualLogDate, and is now the items closed today that are still unlogged. After the change, today --include-completed returns 27 rows, uuid-identical to the app's Today, and the logbook drops exactly the 6 rows the app keeps under Today. No row moved in either direction beyond those. Four fixtures closed items an hour ago, which the day rule reads as today; they now close on an earlier day. The today fixture closes at the current instant rather than a minute back, so it cannot fall on the previous day when the suite runs near midnight. Closes #230
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.
Closes #230
What changed
Things moves a closed item out of Today and into the Logbook when the day rolls over, or sooner if you run "Log Completed Now". The CLI keyed both views on
TMSettings.manualLogDatealone, so an item ticked off today appeared inlogbookwhile the app still had it under Today.An item now stays under Today while it was closed on the current calendar day and its stop date is after
manualLogDate.logbookis the complement.This narrows
today --include-completed— worth a release note. It used to return every item closed sincemanualLogDate, which on this data was 39 rows spread over four days. It now returns the items closed today that are still unlogged, which is 6.Why the rule is a pair, not a swap
Measured against the app on 10 Sep 2026 by uuid, with
manualLogDatefive days old:manualLogDateSo
manualLogDatecannot be the boundary on its own, or those 40 would still be under Today. It stays as the second condition because it is what "Log Completed Now" sets: it files the day's closed items early instead of waiting for midnight, and dropping it would leave that command with no effect. Both conditions held for all 6 rows throughout, so they could only be told apart by closing something in the live app, which the measurement deliberately did not do.The complement is taken over what Today holds, not over the day
/code-review --fixcaught this and it is the substantive part of the change. Subtracting "closed today" from the Logbook unconditionally is wrong, because the today view only holds rows withstart = 1,startBucket IN (0,1)and a start date. A to-do ticked off in the Inbox, in Anytime, or ahead of its date in Upcoming is never under Today, so withholding it from the Logbook on the day would leave it listed nowhere at all. The same argument covers a to-do whose parent project is trashed, which every view buttrashandlogbookdrops.The Logbook therefore withholds exactly
heldByToday, andCOALESCE(..., 0) = 0keeps the negation null-safe over the nullable scheduling columns.One residual: this data had no item closed today from outside Today, so the app's same-day handling of that case is reasoned from the view definitions rather than measured. The failure mode is bounded — such an item reaches
logbookimmediately rather than at midnight — and the alternative left it in no list at all.How verified
By uuid against the app on live data:
today --include-completedvs the app's TodayTests: the today filtering test now asserts both views at each phase, so the partition is what is checked rather than one side of it.
TestTodayAndLogbookPartitionClosedItemsasserts a closed item is in exactly one list across the day andmanualLogDategrid.TestLogbookKeepsItemsClosedTodayOutsideTodayandTestLogbookKeepsClosedTodayUnderTrashedProjectcover the bug above; both fail against the first formulation, which I confirmed by reverting the clause.Four fixtures closed items an hour ago, which the day rule now reads as today, and were moved to an earlier day. The today fixture closes at the current instant rather than a minute back so it cannot fall on the previous day near midnight.
make testandmake lintare clean.Docs
internal/skill/SKILL.md,docs/content/commands.md,docs/content/agents.mdand the README describe the boundary and say that anything closed outside Today reacheslogbookat once. The agent-facing text now says a day's closes need both lists, not justtoday --include-completed.