Add "Move incomplete tasks to today" command to Desktop app#47
Add "Move incomplete tasks to today" command to Desktop app#47dannysmith merged 4 commits intomainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (1)
docs/tasks-todo/task-x-move-incomplete-tasks-to-today.mdis excluded by!**/*.md
📒 Files selected for processing (8)
tdn-desktop/locales/en.jsontdn-desktop/src/components/calendar/DayColumn.tsxtdn-desktop/src/components/calendar/WeekCalendar.tsxtdn-desktop/src/hooks/use-command-context.tstdn-desktop/src/hooks/use-global-shortcuts.test.tstdn-desktop/src/lib/commands/commands.test.tstdn-desktop/src/lib/commands/task-commands.tstdn-desktop/src/lib/commands/types.ts
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>
Closes #38
Summary by CodeRabbit
New Features
Documentation
Localization
Tests