super-productivity/e2e/tests/task-list-basic
Johannes Millan 3ae9d968a4
fix(tasks): make "Add subtask" work in the Planner detail panel (#8617) (#8630)
* fix(tasks): make detail-panel add-subtask work in the Planner (#8617)

The detail panel and context menu delegated "Add subtask" to
AddSubtaskInputService.requestOpen(), a signal consumed only by the
<task> row that renders the parent. The Planner renders tasks as
<planner-task>, so the request was dropped and nothing happened
(regression from #8423; Today view still worked).

- task-detail-panel now hosts its own inline <add-subtask-input>
  (works in every view; also fixes the input opening behind the
  bottom panel on mobile). It controls the sub-task section's
  expansion via a signal and focuses the input after the expand
  animation completes; animates in/out with [@expandFade].
- task-detail-item gains expandedChange/afterExpand outputs so the
  panel can control/observe the Material expansion panel.
- context menu addSubTask() reverts to direct addSubTaskTo() (a
  transient menu has no place to host the inline draft).

Adds a Planner e2e repro and updates the affected unit specs.

* fix(tasks): address multi-review findings for #8617 add-subtask

- Focus the inline input via a deferred timeout in onSubTasksAfterExpand:
  with animations disabled Material fires afterExpand synchronously within
  the same CD pass, before the addSubtaskInput viewChild is committed, so
  the first collapsed→expand "Add subtask" click left the input unfocused.
- Reset isSubTasksExpanded on task switch so the sub-task section doesn't
  stay sticky-expanded across tasks (the panel instance is reused).
- Return focus to the "Add subtask" button when the draft is closed via
  Escape, instead of dropping focus to <body>.
- Refresh the now-stale AddSubtaskInputService doc comment.
- Assert the draft input is focused in the Planner e2e (the focus path was
  previously uncovered).

* fix(tasks): keep context-menu add-subtask on the inline-draft bus

The earlier context-menu change to addSubTaskTo() was unnecessary: the
context menu's "Add sub-task" entry is gated behind isAdvancedControls,
which only the <task> row enables. planner-task and schedule-event leave
it false, so the entry is hidden there — meaning the menu action is only
ever reachable from a rendered <task> row, where requestOpen() works.
Reverting restores the v18.12 inline-draft UX for that path and shrinks
the diff. (#8617 was only ever reachable via the detail panel, which the
self-hosted input fix already covers.)

* test(tasks): cover add-subtask focus with animations disabled

Guards the deferred-focus fix: with animations disabled Material fires
the expansion panel's afterExpand synchronously, before the panel's
add-subtask-input viewChild is committed. Verified this test fails
without the setTimeout deferral and passes with it.
2026-06-29 15:57:44 +02:00
..
add-subtask-with-detail-panel-open.spec.ts fix(tasks): make "Add subtask" work in the Planner detail panel (#8617) (#8630) 2026-06-29 15:57:44 +02:00
drag-task-into-subtask.spec.ts feat(tasks): allow dragging tasks into subtask lists (#7962) 2026-06-02 19:43:41 +02:00
finish-day-quick-history-with-subtasks.spec.ts test(e2e): stabilize finish day history flow 2026-06-06 19:00:50 +02:00
finish-day-quick-history.spec.ts test(e2e): stabilize finish day history flow 2026-06-06 19:00:50 +02:00
simple-subtask.spec.ts test(e2e): fix 2025-10-24 13:57:22 +02:00
task-list-start-stop.spec.ts refactor(e2e): replace waitForTimeout with condition-based waits 2026-01-03 15:29:38 +01:00