Commit graph

14 commits

Author SHA1 Message Date
Symon Baikov
d0da0aea93
Codex/issue 8081 keep subtask input open (#8423)
* fix(tasks): keep subtask input open after add

* fix(tasks): keep subtask input open after add

* perf(tasks): avoid task row effect reactivity

* fix(tasks): address subtask input review

* feat(tasks): ease in the inline subtask input instead of popping

* fix(tasks): consume inline subtask-input request to prevent stale focus-steal

Address multi-review findings on the inline subtask input:

- The open request was held in a signal that was never cleared, so a task row re-created with the same id (e.g. navigating away from a project and back) re-ran its open effect on init and re-opened the input, stealing focus with no user action. Reset via consume() once the row acts on it.

- Drop the redundant requestId counter (a fresh request value already re-fires the effect); request payload is now just the parentId string.

- Add an aria-label to the input (placeholder is not an accessible name).

- _commit() returns void (its boolean result was unused).

* feat(tasks): animate the inline subtask input out and tighten its top gap

- Use the expandFade animation (enter + leave) so the input collapses out instead of vanishing. Caveat: when the input is the only thing in .sub-tasks (adding the first subtask, then cancelling without creating any), the enclosing @if collapses in the same tick and Angular skips the child leave animation, so it's instant in that one case.

- Reduce the input's top margin from --s-half (4px) to --s-quarter (2px).

* feat(tasks): refocus the task row when the subtask draft is cancelled with Escape

The inline subtask input's 'closed' output now reports why it closed ('escape' vs 'blur'). On Escape (a keyboard cancel) the host task calls focusSelf() so keyboard navigation continues from that row; on blur it doesn't, since focus already moved elsewhere. focusSelf() is a no-op on touch.

Covered by unit tests (reason emitted, host refocus only on escape) and an e2e assertion that the task row is focused after Escape.

* feat(tasks): return focus to the task the subtask draft was opened from

Escape previously refocused the parent row that hosts the input. Capture the originating task (which may be a subtask) when opening the draft — before focus moves into the input and the parent row claims focusedTaskId — and restore that on Escape. Falls back to the host row when no origin was captured; no-op on touch.

Focus-by-id prefers the last #t-<id> instance (the detail side-panel one) to match the existing inline-edit focus convention when a task renders twice.

Covered by unit tests and an e2e proving focus returns to the originating subtask, not its parent.

* test(tasks): update subtask e2e for the inline draft input flow

The add-subtask UX changed from 'press a -> empty subtask title focused for edit' to an inline draft input (type + Enter to commit, stays open for rapid entry). Update every e2e site that added subtasks via the old textarea selector:

- WorkViewPage.addSubTask helper: wait for .e2e-add-subtask-input, fill + Enter, then Escape to close the draft for a clean post-state (fixes simple-subtask, add-to-today, drag-task-into-subtask, finish-day-quick-history, and the sync specs that use the helper).

- add-subtask-with-detail-panel-open.spec.ts: assert the draft input opens focused from panel/main-list focus; rewrite the multi-subtask case to repeated Enter (the new rapid-entry path).

- supersync-archive-subtasks + supersync-lww-conflict: same inline-draft flow (not runnable in-sandbox; fixed by analogy).

Verified locally: detail-panel-open 3/3, simple-subtask, add-to-today 5/5, drag-into-subtask, finish-day-quick-history all green.

---------

Co-authored-by: Johannes Millan <johannes.millan@gmail.com>
2026-06-18 17:58:45 +02:00
Johannes Millan
dbeca43876 test(e2e): fix done-toggle selector to use element instead of class
The done-toggle was refactored from an inline SVG with class="done-toggle"
into a standalone Angular component <done-toggle>. Update all e2e selectors
from '.done-toggle' (class) to 'done-toggle' (element) to match.
2026-03-24 16:25:42 +01:00
Johannes Millan
31480a5fab feat(tasks): replace drag handle with done toggle circle and improve mobile UX
- Replace drag handle with SVG done-toggle circle with checkmark draw-on animation
- Improve mobile UX: cdkDragStartDelay for touch, bottom-sheet context menu
- Move issue/repeat indicators from drag handle to tag-list as chips
- Add isFinishDayEnabled config toggle
- Reorder context menu: add sub task before duplicate, deadline as own entry
- Fix context menu not opening on swipe left
- Fix race condition in done toggle animation timeout
2026-03-22 18:14:16 +01:00
Johannes Millan
7164a5e44b test(e2e): fix encryption button timing and drag-handle strict mode violation
Two root causes for failing E2E tests in CI:

1. Encryption button not visible after provider selection: The async
   provider change listener loads config from IndexedDB and updates the
   Formly model, but the 1000ms waitForTimeout was insufficient in CI.
   Replace with polling (200ms intervals, 10s timeout) that waits for
   either enable or disable encryption button to become visible.
   Also removes ~130 lines of leftover debug logging from disableEncryption().

2. Drag-handle strict mode violation on parent tasks with subtasks:
   task.locator('.drag-handle') matched both the parent's drag handle
   and nested subtask drag handles. Add .first() to all drag-handle
   locator usages to target only the parent task's own handle.
2026-03-04 19:38:37 +01:00
Johannes Millan
68a2d8a9b7 test(e2e): fix flaky tests with better waits and focus handling
Replace unreliable networkidle waits with explicit element/URL waits,
improve keyboard focus handling with retry logic, fix strict mode
violations, and add hover before note menu interactions.
2026-03-03 21:46:11 +01:00
Johannes Millan
74fe0c01a0 Merge branch 'master' into feat/operation-logs
* master:
  16.9.4
  docs: add Angular commit message guidelines to CLAUDE.md
  fix(ci): update references for repo migration to super-productivity org
  build(ci): improve android build release upload reliability
  16.9.3
  fix(calendar): display proper error messages instead of [object Object]
  fix(e2e): fix keyboard shortcut delete test and reduce sync test flakiness
  fix(tasks): add subscription cleanup to delete confirmation dialog
  fix(schedule): maintain visibility during task overlap on schedule (#5887)
  16.9.2

# Conflicts:
#	e2e/pages/sync.page.ts
2026-01-10 13:06:20 +01:00
Johannes Millan
52bf171ec4 fix(e2e): fix keyboard shortcut delete test and reduce sync test flakiness
- Click on .drag-handle instead of task element to properly focus task
  without triggering title edit mode (which would block keyboard shortcuts)
- Verify WebDAV form fields appear after selection before proceeding
- Add clear error message when WebDAV selection fails after retries
2026-01-10 12:10:23 +01:00
Johannes Millan
ca98d2c936 fix(e2e): use correct selector for confirm button in task-crud test
The confirm button has type="button" with e2e="confirmBtn" attribute,
not type="submit". Updated selector to match the actual button.
2026-01-09 17:18:36 +01:00
Johannes Millan
150fd074ab Merge branch 'master' into feat/operation-logs
Integrate master branch updates into operation-logs feature branch:
- Add heatmap components and scheduled date group pipe
- Add task delete confirmation dialog and tests
- Update Android focus mode and sound configuration
- Add GitLab PAT authentication support
- Merge translation keys and i18n updates
2026-01-09 16:57:25 +01:00
Johannes Millan
f3954131ac feat(tasks): add confirmation dialog before task deletion
Add optional setting to show confirmation dialog when deleting tasks
via keyboard shortcut (Backspace) or context menu. This prevents
accidental cascading deletions when users press Backspace expecting
browser-like "go back" behavior.

- Add isConfirmBeforeTaskDelete setting (defaults to true)
- Add confirmation dialog to TaskComponent.deleteTask()
- Add confirmation dialog to context menu deleteTask()
- Add setting checkbox in Settings > Misc
- Add unit and E2E tests for the feature

Closes #5942
2026-01-09 15:01:06 +01:00
Johannes Millan
4eb03914c6 fix(e2e): update snackbar undo button selector
The snackbar uses snack-custom component with button.action class,
not simple-snack-bar. Also increased timeout to 5s for reliability.
2025-12-13 20:15:42 +01:00
Johannes Millan
581626be34 test(e2e): add basic undo task delete test
Adds a non-sync e2e test to verify the undo delete functionality:
- Create task
- Delete task via context menu
- Click Undo in snackbar
- Verify task is restored
2025-12-13 17:59:49 +01:00
Johannes Millan
4e0595d8b8 test(e2e): fix 2025-10-24 13:57:22 +02:00
Johannes Millan
9f2c786e41 refactor: move tests 2025-08-02 11:37:25 +02:00