Skip to content

Exclude cancelled TODOs from checklist progress bar - #2183

Open
ctrl-q wants to merge 1 commit into
callumalpass:mainfrom
ctrl-q:fix/2182-exclude-cancelled-todos-from-progress
Open

Exclude cancelled TODOs from checklist progress bar#2183
ctrl-q wants to merge 1 commit into
callumalpass:mainfrom
ctrl-q:fix/2182-exclude-cancelled-todos-from-progress

Conversation

@ctrl-q

@ctrl-q ctrl-q commented Aug 1, 2026

Copy link
Copy Markdown

Summary

Fixes #2182

Cancelled inline checklist items (- [-]) were being counted toward the checklist progress bar's denominator, but never its numerator. This made tasks with cancelled TODO items appear less complete than they actually are.

Example from the issue: a task with one - [x] (completed) and one - [-] (cancelled) item showed 1/2 in the progress bar, when it should show 1/1 since the cancelled item shouldn't count at all.

Changes

  • src/ui/taskCardProperties.ts: In calculateChecklistProgress, skip list items whose marker is - (cancelled) before incrementing total, so cancelled items are excluded from both the numerator and denominator.
  • tests/unit/issues/issue-1576-display-progress-bar.test.ts:
    • Renamed/adjusted the existing "treats non-x task markers as incomplete" test to use a marker other than - (e.g. /), since - is no longer treated as merely "incomplete."
    • Added a test verifying cancelled (-) items are excluded from both numerator and denominator (1 done + 1 cancelled1/1, 100%).
    • Added a test verifying that when all items are cancelled, no progress bar is rendered (matches existing "no items" behavior).

Testing

  • npx jest tests/unit/issues/issue-1576-display-progress-bar.test.ts — all 6 tests pass.
  • Full test suite run: no new failures introduced (pre-existing unrelated failures are due to a generated src/releaseNotes.ts file not being present outside of the build process).
  • npx eslint src/ui/taskCardProperties.ts --max-warnings=0 — clean.

Cancelled inline checklist items (- [-]) were being counted toward
the progress bar's denominator but never the numerator, making
tasks with cancelled items appear less complete than they actually
are (e.g. 1 done + 1 cancelled showed as 1/2 instead of 1/1).

Cancelled items are now excluded entirely from both the numerator
and denominator of the checklist progress calculation.

Fixes callumalpass#2182
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.

[Bug]: Cancelled TODOs should not be counted in task progress bar

1 participant