super-productivity/e2e/tests/planner
Johannes Millan 0923fe66b2
fix(planner): don't erase day-scheduled subtasks on parent plan (#9019) (#9027)
* fix(planner): don't erase day-scheduled subtasks on parent plan (#9019)

Planning a parent task ran removeTasksFromPlannerDays(task.subTaskIds),
which stripped its subtasks from EVERY planner day. As a result, any
day-scheduling the user had given a subtask was silently wiped the moment
its parent was planned anywhere, so those subtasks disappeared from the
planner and schedule (timed subtasks survived via a separate, plannerDays-
independent path).

handlePlanTaskForDay now collapses the parent's subtasks on the target day
only, matching the target-day-only behaviour handleTransferTask already
had. Subtasks scheduled for other days keep their scheduling and stay
visible. Add removeTasksFromSinglePlannerDay helper (reuses removeTasksFromList)
for this; the explicit "SinglePlannerDay" name keeps it from being confused
with the all-days removeTasksFromPlannerDays (the mix-up that caused the bug).

Same-day subtasks still fold into the parent by design: showing them as
siblings would double-count their time (the parent estimate rolls up its
subtasks) in the day total and on the schedule timeline.

No schema barrier: the op payload and planner.days/dueDay shapes are
unchanged, so this is a pure reducer behaviour fix, not a new payload
semantic (op-log rules 2.5). In a mixed-version fleet a not-yet-upgraded
client still applies the old all-days removal for these ops, but the task's
dueDay is preserved either way and state re-converges once clients upgrade.

* test(planner): e2e for day-scheduled subtask visibility (#9019)

Drives the real UI: add a task + subtask, schedule the subtask for a
day (day-only, via the 'S' shortcut + quick-access Tomorrow), plan the
parent for a different day, then assert the subtask is still visible on
its own day in the planner. Fails against the pre-fix all-days removal,
passes with the target-day-only fix (both verified locally).
2026-07-15 14:28:24 +02:00
..
planner-add-subtask-from-detail.spec.ts feat(sync): nudge long-time users without sync to set it up (#8637) 2026-06-29 19:45:42 +02:00
planner-basic.spec.ts test(e2e): use correct route /#/tag/TODAY/tasks instead of /#/tag/TODAY 2026-03-15 18:48:00 +01:00
planner-multiple-days.spec.ts test(e2e): use correct route /#/tag/TODAY/tasks instead of /#/tag/TODAY 2026-03-15 18:48:00 +01:00
planner-navigation.spec.ts test(e2e): use correct route /#/tag/TODAY/tasks instead of /#/tag/TODAY 2026-03-15 18:48:00 +01:00
planner-scheduled-tasks.spec.ts test(e2e): use correct route /#/tag/TODAY/tasks instead of /#/tag/TODAY 2026-03-15 18:48:00 +01:00
planner-subtask-scheduled-visibility.spec.ts fix(planner): don't erase day-scheduled subtasks on parent plan (#9019) (#9027) 2026-07-15 14:28:24 +02:00
planner-task-visibility.spec.ts test(e2e): stabilize task visibility specs 2026-05-13 16:27:31 +02:00
planner-time-estimates.spec.ts test(e2e): use correct route /#/tag/TODAY/tasks instead of /#/tag/TODAY 2026-03-15 18:48:00 +01:00