Skip to content

fix(calendar): confirm before a calendar move clears recurring instances - #2633

Open
martin-forge wants to merge 6 commits into
callumalpass:mainfrom
martin-forge:martin-forge/calendar-drop-confirm-clear
Open

martin-forge wants to merge 6 commits into
callumalpass:mainfrom
martin-forge:martin-forge/calendar-drop-confirm-clear

Conversation

@martin-forge

@martin-forge martin-forge commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Moving a recurring task can clear its completed and skipped instances. The date picker asks first through confirmClearRescheduledInstances (#2147), but two calendar paths don't, so they clear them without warning:

  • dragging the task's next occurrence to another day (applyTaskCalendarGesture in src/bases/calendarMutations.ts)
  • dropping the task onto the calendar from a note (handleExternalTaskDrop in src/bases/CalendarView.ts)

Since #2724, this affects completion-anchored tasks, which lose every instance on or after the new date, and moves without recurrence_original_date, such as Google-synced tasks, which lose a recorded landing day.

Fix: both paths pass the existing confirmClearInstances hook, so they show the same dialog listing the dates. Cancel reverts the drag or drop and writes nothing. confirmClearRescheduledInstances is now public so the calendar can reuse it. The Recurring Tasks docs and release notes are updated.

Testing: tests/unit/bases/calendarRecurringRescheduleConfirm.test.ts drives both handlers with a real TaskService, for a completion-anchored and a Google-synced task. Its five tests fail on main and pass here. I checked both paths by hand in Obsidian before #2724; the code is unchanged.

Screenshot

A calendar drag now asks first

Moving a recurring task's next occurrence in the Calendar view, or
dropping the task onto the calendar from a note, deleted its completed
and skipped instances on or after the new date without asking. Both
paths reschedule without the confirmClearInstances hook that the
scheduled-date picker and property updates already pass.

Pass the hook on both paths, so the dialog lists the dates it will
clear. Cancel reverts the calendar drag; for an external drop nothing
is written, refreshed or offered for Undo. Make
confirmClearRescheduledInstances public so the calendar can reuse it.
Batch moves refuse recurring tasks, so they are unchanged.
callumalpass added a commit that referenced this pull request Nov 20, 2026
…s cleanly (#2631)

#2633 adds confirmClearInstances to that call. Keeping the call's lines
unchanged lets either PR rebase onto the other without conflicts.

Also make the #2631 e2e spec poll frontmatter reads, which briefly return
undefined while the file is rewritten.
…-drop-confirm-clear

# Conflicts:
#	docs/releases/unreleased.md
…-drop-confirm-clear

# Conflicts:
#	docs/releases/unreleased.md
…-drop-confirm-clear

# Conflicts:
#	docs/releases/unreleased.md
…-drop-confirm-clear

# Conflicts:
#	docs/features/recurring-tasks.md
#	docs/releases/unreleased.md


Since callumalpass#2724 a scheduled-anchored move clears nothing when it records recurrence_original_date, so the drop tests no longer reached the confirmation. Use a completion-anchored task, which still clears every instance on or after the new date under both the current and the narrowed model rule, and add a Google-synced drop onto its skipped day, which clears only that day.

This branch has not been deployed

No deployments
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.

1 participant