super-productivity/e2e/tests/planner
Johannes Millan a1c059855e
feat(sync): nudge long-time users without sync to set it up (#8637)
* feat(sync): nudge long-time users without sync to set it up

Offline-first means a user who never configures sync has no backup at
all; clearing browser data or losing the device wipes everything. Once
the app has clearly been used for a while AND holds real data, show a
calm, low-priority banner once encouraging sync setup.

Trigger combines wall-clock age (>= 7 days since a lazily-seeded
FIRST_USE_TIMESTAMP) with a task-count gate (>= 20 tasks), so it is
robust both to users who restart many times a day and to those who
leave the app running for weeks (where app-start count fails), and
never nags an empty/dormant install. Shown at most once: both "Set up
sync" and "Not now" persist a dismissed flag; a configured provider
suppresses it entirely.

Reuses the existing banner system and mirrors NoteStartupBannerService.

* refactor(sync): apply review feedback to data-safety nudge

- Rename LS.FIRST_USE_TIMESTAMP -> SYNC_SAFETY_FIRST_SEEN and document that
  it is not a true install date (seeded at upgrade time for existing
  installs), so no other feature reuses it as one.
- Tests: add an unhydrated-config (undefined) skip case and assert the
  task-count selector, guarding the earlier race fix and a selector swap.
- i18n: match each locale's existing register for the nudge message
  (pt/cs/sk/tr -> formal, id -> informal) per translation review.

* test(planner): stabilize add-subtask-from-detail focus race

Wait for the detail panel's deferred open-time auto-focus to settle before
opening the inline subtask draft. The auto-focus lands ~200ms after the panel
opens and, if it fires after the draft input is focused, steals focus and
blur-closes the input — making toBeFocused() flake with 'element(s) not found'.
Mirrors the guard already used in add-subtask-with-detail-panel-open.spec.ts.
2026-06-29 19:45:42 +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-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