mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-07-26 01:14:22 +00:00
Diagnostic showed: in TODAY the chip *set* matched ctx.taskIds, but the
*order* didn't — saved-doc order won, while the regular TODAY view uses
ctx.taskIds (TODAY_TAG.taskIds). Plus the stored doc had duplicate
subtask rows under several parents (a residue of an earlier bug).
Rewrite reconcileTopLevelTaskRefs:
- Pass 1 walks the stored content. For each parent taskRef it
collects the parent + its trailing subTaskRef run as a "group",
deduping subtasks within the group by taskId. The first stored
group for a given parent wins; later duplicate groups for the
same parent are dropped. Non-chip blocks (paragraphs, dividers,
extra headings) are stashed; the first heading is preserved as
the doc title at the top. Orphan subTaskRefs are dropped.
- Pass 2 rebuilds the doc content. The title heading stays first.
Chip groups follow ctx.taskIds order strictly — stored group if
we have one, fresh from taskRefWithSubtasksJSON if the parent
is new to this context. Custom non-chip blocks land at the end
in their original relative order so they aren't lost.
Trade-off (documented in ADR #5 Open Limitations): paragraphs the
user had interleaved between chips lose their original anchor and
end up at the tail. The previous behaviour preserved their position
but at the cost of stale ordering and visible duplicates, which is
worse.
Also removed the temporary diagnostic console.logs.
|
||
|---|---|---|
| .. | ||
| scripts | ||
| src | ||
| .gitignore | ||
| package-lock.json | ||
| package.json | ||
| tsconfig.json | ||