Skip to content

fix(today): exclude completed tasks by default, add --include-completed#109

Merged
ryanlewis merged 2 commits into
mainfrom
issue-106-today-completed
Jun 22, 2026
Merged

fix(today): exclude completed tasks by default, add --include-completed#109
ryanlewis merged 2 commits into
mainfrom
issue-106-today-completed

Conversation

@ryanlewis

Copy link
Copy Markdown
Owner

What

things today now returns only open tasks by default. Completed/cancelled items that Things keeps on screen until it logs them out of Today are available behind a new opt-in flag:

things today                      # open tasks only (new default)
things today --include-completed  # + completed/cancelled not yet logged (UI-parity)

Closes #106.

Why

The today view kept completed/cancelled items visible until Things logged them out of Today (UI-parity, added in #74). For automation this over-reports: "in today" stopped meaning "still to do", and consumers had to filter on the bare status: 3 themselves. Defaulting to open tasks is the least-surprising behaviour; --include-completed restores the UI-parity view for anyone who wants it.

How

  • internal/db: TaskFilter.IncludeCompleted + a todayWhere(includeCompleted) helper. Default today filters status = 0; with the flag it keeps status IN (2,3) items whose stopDate post-dates manualLogDate (the same logged-out signal as before).
  • cmd/things: --include-completed flag. It only affects today, so it's rejected with an error on any other view (including when a trailing project name promotes today → project), matching how --on/--from/--to reject unsupported views — no silent no-ops.
  • internal/skill/SKILL.md: documented the new default and flag.

Tests

  • DB: default excludes completed and cancelled; --include-completed surfaces unlogged completed + cancelled items pre-log, then drops them once manualLogDate advances.
  • CLI: flag parses; rejected on non-today views and on the promoted-project path.

Review

Ran /code-review --fix (xhigh). Applied: the non-today rejection, a start=1 cancelled (status=2) fixture closing a coverage gap, and month-boundary-safe date arithmetic in the test helper.

Knowingly not changed (out of scope / pre-existing):

  • --on/--from/--to filter --include-completed items by startDate, not completion date — consistent date-filter semantics across all views.
  • TMSettings LIMIT 1 (no ORDER BY) and the NULL stopDate three-valued-logic drop are carried over verbatim from the prior inline clause; not introduced here.

`things today` kept completed/cancelled items visible until Things logged
them out of Today (UI-parity from #74). For automation this over-reports:
"in today" no longer means "still to do". Default to open tasks only and
gate the UI-parity view behind --include-completed.

Closes #106
…lled

Address code-review findings on the --include-completed feature:
- Error (instead of silently ignoring) when --include-completed is used on
  any view other than today, including when a trailing project name promotes
  today → project. Mirrors how --on/--from/--to reject unsupported views.
- Add a start=1 cancelled (status=2) fixture so the `status IN (2,3)` branch
  is actually exercised; the prior fixtures only covered status=3.
- Compute the test's "yesterday" via AddDate so it stays a valid ThingsDate
  across month boundaries (raw bit subtraction underflowed on the 1st).
@ryanlewis ryanlewis merged commit d8e556d into main Jun 22, 2026
1 check passed
@ryanlewis ryanlewis deleted the issue-106-today-completed branch June 22, 2026 22:26
ryanlewis added a commit that referenced this pull request Jun 22, 2026
Release-notes header for the upcoming `v0.5.0` tag (required at the
tagged commit by `.goreleaser.yaml`).

Covers the two behaviour changes in this release:
- JSON `status` now emits a string instead of the raw int (#107, closes
#105)
- `things today` excludes completed by default; `--include-completed`
restores UI-parity (#109, closes #106)

Plus dependency maintenance (#100, #108).

Part of cutting v0.5.0 via `/release minor`.
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.

things today returns completed tasks that Things.app has already dropped from Today

1 participant