Commit graph

34 commits

Author SHA1 Message Date
Johannes Millan
ff523fd4dd refactor(reminders): address code review feedback for deadline fixes
- Document intent of editReminder cancel path: when user cancels the
  inner schedule dialog, the outer dialog closes and the destroy handler
  clears deadlineRemindAt (same as ESC). Prevents the worker from
  re-firing the past-due reminder.
- Replace page.waitForTimeout with expect().not.toBeVisible({timeout}) in
  the deadline ESC e2e test so it fails fast if the dialog reappears and
  complies with the "no waitForTimeout" rule in e2e/CLAUDE.md.
- Capture realTodayStr per test in is-deadline-approaching spec to close
  the (narrow) midnight-rollover flake window.
2026-04-21 21:50:52 +02:00
Johannes Millan
2db074d8e9 fix(reminders): clear unhandled deadline reminders on dialog close
Without this, ESC/backdrop dismissal left deadlineRemindAt in the store,
so the reminder worker re-fired on its next 10s tick and the dialog
reopened indefinitely (reported in #4328 preview feedback).

ngOnDestroy now dispatches clearDeadlineReminder for any deadline
reminder shown in the session that was not explicitly handled. Bulk
handlers (markSingleAsDone, markAllTasksAsDone, addAllToToday) now
populate _dismissedReminderIds so destroy is a no-op for them.

Adds 7 unit tests and a Playwright e2e regression test that fails on
the unpatched component and passes with the fix.
2026-04-21 21:50:52 +02:00
Johannes Millan
c8ac3feda2 fix(lint): resolve prettier formatting and lint errors from CI run 2026-03-24 18:08:30 +01:00
Johannes Millan
d401e6169e feat(tasks): add deadlines feature with reminders and planner integration
Add deadline support for tasks with date-only and time-specific deadlines.

Core:
- Add deadlineDay, deadlineWithTime, deadlineRemindAt fields to task model
- Add NgRx actions (setDeadline, removeDeadline, clearDeadlineReminder)
- Add meta-reducer with mutual exclusivity and input validation
- Register deadline actions in ActionType enum and op-log codes

UI:
- Create deadline dialog with calendar, time input, and reminder options
- Add deadline badge to task list row with overdue warning color
- Add deadline item to task detail panel with flag icon
- Add deadline options to task context menu
- Show deadlines in scheduled list page

Reminders:
- Add deadline reminder effects and selectors
- Show reminder dialog with grouped deadline/schedule sections
- Handle deadline reminder clearing on dismiss, done, add-to-today
- Cancel Android native deadline notifications on delete/archive

Planner:
- Show deadline tasks in planner day view and overdue section
- Create dedicated planner-deadline-task component
- Optimize deadline grouping with O(N) single-pass selector

Other:
- Add deadline-today banner effect for unplanned deadline tasks
- Add translation keys for all deadline UI strings
- Add E2E tests for deadline reminder flows
- Add unit tests for deadline reducer and overdue utility
- Extract shared isDeadlineOverdue utility function
- Guard app-state selectors against undefined during teardown
2026-03-15 18:48:00 +01:00
Johannes Millan
a276ccb3f4 fix: resolve pre-existing lint and prettier errors blocking commits (#6840) 2026-03-15 16:47:52 +01:00
Johannes Millan
c248d54508 test(e2e): add deadline reminder e2e test
Verifies that a deadline reminder shows the task in the dialog and
does not re-trigger infinitely after dismissal.
2026-03-14 13:04:44 +01:00
Johannes Millan
350597f35f
Remove schedule initial setup dialog component (#6460)
* refactor(schedule): remove initial schedule config dialog

Users can configure schedule settings directly in the global settings
page instead of being prompted with a dialog on first visit.

https://claude.ai/code/session_015pbDmfqYTYCyymZiYHhtbr

* test(e2e): remove schedule config dialog dismissal from tests

The initial schedule config dialog was removed, so e2e tests no longer
need to wait for and dismiss it before interacting with the schedule view.

https://claude.ai/code/session_015pbDmfqYTYCyymZiYHhtbr

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-02-11 17:02:22 +01:00
Johannes Millan
a4c0d84904 test(e2e): fix flaky dialog interactions by scoping to container
- Wait for mat-dialog-container to be visible before clicking
- Scope button selectors within the dialog container
- Wait for dialog to be detached after dismissing
- Remove flaky waitForTimeout in favor of proper state waits
2026-01-26 19:48:12 +01:00
Johannes Millan
0b7123edc3 test(e2e): use icon-based selector for schedule item in reminder test
Replace fragile text-based selector with icon-based selector to match
the pattern used by other tests in the same file.
2026-01-24 21:56:07 +01:00
Johannes Millan
5f1dbcef48 test(e2e): fix selector text to match actual translation
The test was looking for 'Planned at' but the actual translation
for DUE is 'Planned for'.
2026-01-24 21:41:29 +01:00
Johannes Millan
7137533407 test(e2e): fix additional tests for tabbed config page
Update plugin-lifecycle, plugin-upload, and reminders tests to
navigate to correct tabs:
- Plugin tests navigate to Plugins tab (extension icon)
- Reminder tests navigate to Time & Tracking tab (timer icon)

Fixes 5 additional E2E test failures after config page refactoring.
2026-01-17 13:26:57 +01:00
Johannes Millan
85fa50974b Merge branch 'master' into feat/operation-logs
* master:
  refactor(e2e): improve test infrastructure for easier expansion
  chore(e2e): remove broken/empty skipped tests
  test(e2e): fix flaky plugin and WebDAV sync tests
  refactor(e2e): replace waitForTimeout with condition-based waits
  perf(e2e): remove ineffective waits to speed up test runs
  docs(e2e): add CLAUDE.md reference and barrel export for easier test creation
  build: update dep
  refactor(e2e): simplify waits and fix flaky tests
  feat(e2e): streamline e2e test development with improved infrastructure
  perf(e2e): optimize wait utilities and addTask method for faster test execution
  16.8.1

# Conflicts:
#	e2e/pages/base.page.ts
#	e2e/pages/project.page.ts
#	e2e/tests/reminders/reminders-schedule-page.spec.ts
#	e2e/tests/sync/webdav-sync-advanced.spec.ts
#	e2e/tests/sync/webdav-sync-expansion.spec.ts
#	e2e/tests/sync/webdav-sync-full.spec.ts
#	e2e/utils/waits.ts
2026-01-03 18:51:51 +01:00
Johannes Millan
11d85208e5 refactor(e2e): replace waitForTimeout with condition-based waits
- Replace ~100 waitForTimeout calls with proper condition-based waits
- Extract shared utilities for time input and task scheduling
- Add timeout constants for consistent wait times
- Add new selectors for reminder dialogs and detail panels

Files refactored across 25+ test files including:
- Plugin tests (lifecycle, upload, loading, enable, structure)
- Reminder tests (view-task, schedule-page, default-options)
- Work view, planner, focus mode, and app feature tests
- Task dragdrop, autocomplete, and daily summary tests

New utilities created:
- e2e/utils/time-input-helper.ts - Robust time input filling
- e2e/utils/schedule-task-helper.ts - Task scheduling helpers
- e2e/constants/timeouts.ts - Standardized timeout values
2026-01-03 15:29:38 +01:00
Johannes Millan
073eab162e fix(e2e): target specific tasks container in schedule page test
Use more specific selector to target only the scheduled tasks
container, avoiding ambiguity with planned-for-days tasks.
2026-01-01 15:21:01 +01:00
Johannes Millan
3d4bfb5637 fix(sync): improve robustness of sync and counter operations
Code review improvements addressing critical and high priority issues:

Archive Handler:
- Rollback BOTH archiveYoung and archiveOld on flush failure
- Prevents data loss when partial write occurs

Cache Invalidation:
- Add _unsyncedCache invalidation in deleteOpsWhere
- Prevents stale data when deleted ops include unsynced operations

Simple Counter:
- Extract _getCounterValue helper to reduce code duplication
- Use selectSimpleCounterById (O(1)) instead of selectAllSimpleCounters+find (O(n))
- Update tests to properly mock both selectors

Operation Log Sync:
- Add infinite loop prevention when force download returns no clocks
- Add GREATER_THAN corruption detection (treats as CONCURRENT to be safe)

ESLint Hydration Guard Rule:
- Fix combineLatest detection at root level vs nested in operator callbacks
- Add comprehensive test suite (17 test cases)

E2E Tests:
- Fix flaky reminders-schedule-page tests (tasks disappear after scheduling)
2025-12-19 11:42:56 +01:00
Johannes Millan
ecdd06988a test(e2e): improve e2e stability 2025-11-06 19:54:50 +01:00
Johannes Millan
15df77da95 test: e2e improve 2025-11-05 09:40:02 +01:00
Michael Huynh
6a4d572792
refactor: address review for default task reminder option 2025-11-02 14:04:24 +08:00
Michael Huynh
c60a806410
feat(reminder): add default task reminder option setting (#5344) 2025-11-01 17:39:52 +08:00
Johannes Millan
bd488076db test(e2e): fix 2025-10-09 19:55:36 +02:00
Johannes Millan
a3a70ededf test(e2e): make less flaky 2025-09-11 13:24:05 +02:00
Johannes Millan
71082ada2d test(e2e): fix 2025-09-10 21:15:56 +02:00
Johannes Millan
b20f845cb9 test(e2e): make all e2e tests work again and optimize 2025-09-09 23:47:34 +02:00
Johannes Millan
1a82aa905b test(e2e): improve 2025-08-04 18:35:00 +02:00
Johannes Millan
55251f5e0d fix(e2e): make 'should add multiple scheduled tasks' test more reliable
- Increase timeout to 90 seconds for multiple operations
- Add page stabilization waits after critical operations
- Implement retry logic for hover interactions (3 retries)
- Add scrollIntoViewIfNeeded before hovering to ensure visibility
- Use force:true for hover to handle overlapping elements
- Clear input field before filling time values
- Add explicit waits for dialog state transitions
- Use .first() consistently to avoid multiple element issues
- Implement toPass() with retry for dynamic content verification
- Add small delays between operations to prevent race conditions

The test was flaky due to:
1. Hover interactions not always revealing buttons reliably
2. Race conditions between task creation and scheduling
3. Dialog state transitions happening too quickly
4. Multiple similar elements causing selector conflicts
2025-08-03 20:45:53 +02:00
Johannes Millan
ad38fc9185 test(e2e): handle multiple schedule button elements in reminders test
The reminders test was failing with 'strict mode violation' because after
scheduling a task, there can be multiple schedule buttons in the DOM.

Fixed by using .first() to select only the first matching element when
checking for schedule button visibility after scheduling tasks.
2025-08-03 19:51:50 +02:00
Johannes Millan
3c126c6327 test(e2e): make tests less brittle by using proper wait conditions
Refactored tests to remove arbitrary timeouts and use proper wait conditions:

plugin-iframe.spec.ts:
- Removed all waitForTimeout() calls and waitForLoadState('networkidle')
- Replaced with specific waitForSelector() and waitFor() conditions
- Used better selectors with :has() and attribute selectors
- Simplified toggle state checking with count() instead of evaluate()

reminders-schedule-page.spec.ts:
- Removed all waitForTimeout() calls
- Replaced with waitFor() on specific elements
- Better selector constants for dialog elements
- Removed unnecessary waitForLoadState() calls

These changes make tests deterministic and faster by waiting for specific
conditions rather than arbitrary time periods.
2025-08-03 19:01:40 +02:00
Johannes Millan
2b11d5eb22 test(e2e): fix and re-enable reminders-schedule-page tests
- Re-enable previously skipped tests
- Add robust waits and timeouts for CI stability
- Improve task selection using filter with hasText
- Add helper function to reduce code duplication
- Increase schedule times to 1-2 minutes for better reliability
- Fix task order verification to handle dynamic ordering
- Remove unused constants and fix linting issues

Tests now pass consistently both locally and should work in CI
2025-08-03 11:20:49 +02:00
Johannes Millan
9134bb9f4b fix(ci): correct e2e test result path and improve test stability
- Fix artifact upload path from e2e-test-results to .tmp/e2e-test-results
- Re-enable serial execution for plugin-iframe tests to avoid race conditions
- Skip flaky reminders-schedule-page tests in CI temporarily
- Update both build.yml and lint-and-test-pr.yml workflows

The CI was failing because test results were being written to .tmp/e2e-test-results
but the artifact upload was looking in e2e-test-results (without .tmp prefix)
2025-08-03 11:13:09 +02:00
Johannes Millan
c7b84336a3 test(e2e): fix test timeouts and improve stability
- Remove serial test execution from plugin-iframe tests to prevent blocking
- Add explicit timeouts to prevent indefinite hanging
- Make reminders tests independent (not relying on previous test state)
- Improve plugin enablement logic to handle already-enabled state
- Enable previously skipped tests that now work properly
- Fix selectors and improve error handling

All planner-navigation tests now pass consistently
2025-08-03 11:08:34 +02:00
Johannes Millan
123d351e75 test(e2e): skip flaky reminders-schedule-page test temporarily 2025-08-02 17:20:28 +02:00
Johannes Millan
613ccfa3da test(e2e): restore all test files from 4781b6ec with updated import paths 2025-08-02 16:57:12 +02:00
Johannes Millan
6ddbf00651 test(e2e): remove console.log statements and replace console.error with throw
- Remove all console.log statements from E2E test files
- Replace console.error with throw new Error for proper error handling
- Remove console.warn statements
- Fix unused variable linting errors in plugin tests
2025-08-02 12:25:21 +02:00
Johannes Millan
9f2c786e41 refactor: move tests 2025-08-02 11:37:25 +02:00