super-productivity/packages/plugin-dev/document-mode
Johannes Millan 7470c0d16d fix(document-mode): track in-context, not cache-global, for TODAY etc.
The recent appendMissingTask fix (#6) compared payload.taskId against
lastSeenTaskIds set to *every* id in taskCache. That treated "first
time we see this task in this user's data" as the transition signal,
which broke TODAY:

  - A task that already lives in another project is "known" globally
    the moment the cache loads. Later, when the user gives it the
    TODAY tag or sets a dueDay, ANY_TASK_UPDATE fires — but the id
    is still in lastSeenTaskIds, so wasKnown is true and the chip
    never appears in the TODAY doc. Same regression for TAG views.

Scope lastSeenTaskIds to the *current context's* tasks instead:

  - PROJECT: tasks whose projectId matches the ctx
  - TODAY:   tasks with the TODAY tag OR a dueDay OR a dueWithTime
  - TAG:     tasks whose tagIds include the ctx id
  - Subtasks (task.parentId set) are excluded — they flow through
    insertSubtaskByParent, not through the top-level append path.

Now a transition out-of-context → in-context triggers append while
in-context updates (time-tracking ticks etc.) still don't replay the
chip. The previous "globally new" check is replaced by a per-context
set diff, computed via snapshotInContextTaskIds(ctx).
2026-05-21 22:22:50 +02:00
..
scripts feat(document-mode): add TipTap-based document-mode plugin (POC) 2026-05-21 17:22:31 +02:00
src fix(document-mode): track in-context, not cache-global, for TODAY etc. 2026-05-21 22:22:50 +02:00
.gitignore feat(document-mode): add TipTap-based document-mode plugin (POC) 2026-05-21 17:22:31 +02:00
package-lock.json feat(document-mode): Notion-style UX (gutter, bubble menu, block menu) 2026-05-21 17:34:13 +02:00
package.json feat(document-mode): Notion-style UX (gutter, bubble menu, block menu) 2026-05-21 17:34:13 +02:00
tsconfig.json feat(document-mode): add TipTap-based document-mode plugin (POC) 2026-05-21 17:22:31 +02:00