Skip to content

Add "Move incomplete tasks to today" command to Desktop app#47

Merged
dannysmith merged 4 commits intomainfrom
tdn-desktop-move-uncompleted-tasks-to-today
Mar 23, 2026
Merged

Add "Move incomplete tasks to today" command to Desktop app#47
dannysmith merged 4 commits intomainfrom
tdn-desktop-move-uncompleted-tasks-to-today

Conversation

@dannysmith
Copy link
Owner

@dannysmith dannysmith commented Mar 22, 2026

Closes #38

Summary by CodeRabbit

  • New Features

    • Added a "Move incomplete to today" action: click the icon on today's header or use the command palette to reschedule overdue incomplete tasks to today with success/info/error feedback.
  • Documentation

    • Documented the new today-header button and command-palette action and their behavior.
  • Localization

    • Added localized strings for the command label, description, and toast messages.
  • Tests

    • Updated tests and test utilities to cover the new command behavior.

@coderabbitai
Copy link

coderabbitai bot commented Mar 22, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c13f028e-5a91-4b52-9e6f-68e510560189

📥 Commits

Reviewing files that changed from the base of the PR and between af835fe and 198e590.

📒 Files selected for processing (2)
  • tdn-desktop/src/components/calendar/DayColumn.tsx
  • tdn-desktop/src/lib/commands/task-commands.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • tdn-desktop/src/components/calendar/DayColumn.tsx
  • tdn-desktop/src/lib/commands/task-commands.ts

📝 Walkthrough

Walkthrough

Adds a "Move incomplete tasks to today" command: localization, day-header UI button for today's column, command implementation that reschedules overdue incomplete tasks to today, command-context task access, tests, and documentation.

Changes

Cohort / File(s) Summary
Localization
tdn-desktop/locales/en.json
Added commands.moveIncompleteToToday localization keys: label, description, success (with {{count}}), no-op, and error messages.
Calendar UI
tdn-desktop/src/components/calendar/DayColumn.tsx, tdn-desktop/src/components/calendar/WeekCalendar.tsx
Added optional onMoveIncompleteToToday?: () => void prop to DayColumn; renders a tooltip-wrapped CalendarArrowUp icon in today's header when provided. WeekCalendar supplies the handler for today's column by calling executeCommand('move-incomplete-to-today', commandContext).
Command implementation
tdn-desktop/src/lib/commands/task-commands.ts, tdn-desktop/src/lib/commands/types.ts
Introduced move-incomplete-to-today AppCommand: fetches tasks via context.getTasks(), filters overdue incomplete tasks, bulk-updates scheduled to today with mutation lifecycle handling, updates cache per successful update, and shows appropriate toasts. Added getTasks: () => Task[] to CommandContext type.
Command context
tdn-desktop/src/hooks/use-command-context.ts
Implemented getTasks() to read tasks from TanStack Query cache (vaultQueryKeys.tasks()), returning an empty array when missing.
Tests & Mocks
tdn-desktop/src/lib/commands/commands.test.ts, tdn-desktop/src/hooks/use-global-shortcuts.test.ts
Updated mock contexts to include getTasks() and added tests for move-incomplete-to-today covering success, no-op, partial failures, and error handling.
Docs
website/src/content/docs/desktop/views.mdx
Documented the new today-column header button and the command-palette entry that reschedules incomplete overdue tasks to today.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 I hopped through tasks both old and gray,

An arrow-up nudged all the past to play.
Overdue bunnies now skip on the way,
Today they gather, bright as May. 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding a new command to move incomplete tasks to today in the Desktop app.
Linked Issues check ✅ Passed All requirements from issue #38 are met: filtering logic for incomplete overdue tasks, command palette exposure, keyboard shortcut support, and a calendar header button.
Out of Scope Changes check ✅ Passed All changes are directly scoped to implementing the move-incomplete-to-today command with no unrelated modifications detected.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch tdn-desktop-move-uncompleted-tasks-to-today

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@tdn-desktop/src/components/calendar/DayColumn.tsx`:
- Around line 124-132: The icon-only action button using TooltipTrigger
(wrapping CalendarArrowUp, click handler onMoveIncompleteToToday, and
TooltipContent) lacks an accessible name; add an explicit accessible label by
passing aria-label (or aria-labelledby) to TooltipTrigger using the same i18n
string t('commands.moveIncompleteToToday.label') so screen readers announce the
button, and ensure the TooltipContent remains for visual hover/focus tooltips.

In `@tdn-desktop/src/lib/commands/commands.test.ts`:
- Line 134: Add explicit unit tests for the new bulk command
move-incomplete-to-today inside commands.test.ts: mock getTasks to return
controlled sets and assert the command filters only overdue/incomplete tasks
(overdue filtering rules), assert the no-op path where no tasks qualify results
in no updateTask calls, and assert mixed results by stubbing updateTask to
succeed for some IDs and throw for others and then verify the command
reports/handles both successes and errors correctly; use the existing vi.fn()
mocks (getTasks, updateTask) and call the command handler
(move-incomplete-to-today) to exercise these three scenarios.

In `@tdn-desktop/src/lib/commands/task-commands.ts`:
- Around line 276-291: The new command with id 'move-incomplete-to-today' is
missing a keyboard shortcut; update its command definition in task-commands.ts
to include the same shortcut property key used by other commands (e.g.,
"shortcut" or "accelerator") and assign the required key combo (pick the project
standard like CmdOrCtrl+Shift+T or the agreed shortcut for this action). Ensure
the shortcut is added alongside existing keys (id, labelKey, descriptionKey,
icon, group, keywords, surfaces) and register it with the app's global
shortcut/command palette mapping so the command responds to the keypress.
- Around line 309-327: Wrap the Promise.all call that runs commands.updateTask
over overdueTasks in a try/finally so markMutationComplete() always runs: call
markMutationStart() before the try, await Promise.all(...) inside the try, and
call markMutationComplete() in the finally block (letting any error propagate
after finally) to guarantee mutation tracking is cleaned up even if an update
throws.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 05d11c57-6906-4a38-8ce6-ee4266878d06

📥 Commits

Reviewing files that changed from the base of the PR and between bb4a527 and 9aedc46.

⛔ Files ignored due to path filters (1)
  • docs/tasks-todo/task-x-move-incomplete-tasks-to-today.md is excluded by !**/*.md
📒 Files selected for processing (8)
  • tdn-desktop/locales/en.json
  • tdn-desktop/src/components/calendar/DayColumn.tsx
  • tdn-desktop/src/components/calendar/WeekCalendar.tsx
  • tdn-desktop/src/hooks/use-command-context.ts
  • tdn-desktop/src/hooks/use-global-shortcuts.test.ts
  • tdn-desktop/src/lib/commands/commands.test.ts
  • tdn-desktop/src/lib/commands/task-commands.ts
  • tdn-desktop/src/lib/commands/types.ts

dannysmith and others added 2 commits March 22, 2026 23:56
Add aria-label to the move-incomplete-to-today button for screen readers.
Wrap bulk updateTask Promise.all in try/finally to ensure markMutationComplete
always runs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dannysmith dannysmith merged commit 45d988e into main Mar 23, 2026
4 checks passed
@dannysmith dannysmith deleted the tdn-desktop-move-uncompleted-tasks-to-today branch March 23, 2026 01:14
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.

Add "Move incomplete tasks to today" command to Desktop app

1 participant