You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 520daf9
Browse filesBrowse the repository at this point in the historyBrowse files
Fix(tasks): a repeating task's block id stays on the open occurrence (#1083)
Checking off a repeating task copies its line: the next occurrence goes
above, the finished line stays below as the record. The copy was verbatim,
so a trailing `^plants` landed on both lines, and every roll added one more
line carrying the same id. Lookup takes the first of a repeated id, so links
happened to keep reaching the open task, but the note held two, then three,
then N copies of an id that is meant to name one block. #1083 lists this as
the first thing to settle before work sessions link tasks by `path#^id`.
The id now stays with the open occurrence and leaves the record. A link or
embed of a repeating task means the series, the chore you do next, and that
is what existing `[[Chores^plants]]` links and `![[Chores^plants]]` embeds
already showed; moving the id to the record instead (what the issue first
proposed) would have pointed every one of them at finished work. No id is
generated, so the zn Go mirror can reproduce the edit exactly from the
shared cases. The record already drops `@repeat` and `@remind`, the tokens
that only mean something on open work; the id joins them.
The subtree follows the same rule: the fresh copies keep their ids, the
record's children lose theirs, and a line that is only a marker (`^review`
under the task, naming the block above it) is left out of the record. The
editor path keeps its "select subtasks with the task" behavior and writes
those done from the record's id-less line.
A second bug on the same line: a tagged task with no `due:` got the roll's
new `due:` appended after the marker (`Stretch ^stretch due:2026-11-04`), so
the id no longer ended the line and the open occurrence lost it. The new
`due:` now goes in before the marker.
It does not touch how ids render. Two display bugs seen while verifying
(a Preview embed of a repeating task with subtasks clips its first letters;
Home's Today list shows the raw `^plants`) predate this change and are
being looked at separately.
Docs: one sentence in the Repeat a task entry of help.ts; the website
mirror is on website/2.87.0.
Tested: 7 new shared cases in task-recurrence.cases.json (own id; due added
before the id; subtask and note ids; a marker-only line; a fence after the
task keeps its caret; Skip this time; CRLF with a dropped marker line) and
an editor test for ticked subtasks with ids. npm run typecheck clean;
test:run green (shared-domain 2698, app-core 4948, desktop 1952). The built
app over CDP with isolated stores: Mod+L on `Water the plants @repeat:weekly
due:2026-11-15 ^plants` with two subtasks writes `^plants` and `^ferns` only
on the new 2026-11-22 lines, in the editor and on disk; after a relaunch a
Dashboard's `![[Chores^plants]]` shows the open 11-22 task with fresh
subtasks. The zn CLI pins task-recurrence.cases.json by hash, so its Go
engine needs the same rule and the new file before its next sync.
How to test locally: `npm run build --workspace @zennotes/desktop`, then
`npx electron apps/desktop/out/main/index.js`. In a note, write
`- [ ] Water the plants @repeat:weekly due:2026-11-15 ^plants`, put the
cursor on it and press Cmd+L. Before: both lines end in `^plants`. After:
only the new open line does, and the `[x]` record has no id.
'Add `@repeat:` to a task and checking it off schedules the next one: `- [ ] Water the plants @repeat:weekly due:2026-11-01`. The rules are `daily`, `weekdays`, `weekly`, `monthly` and `yearly`; `2d`, `3w`, `6m` or `1y` for every so many days, weeks, months or years; weekdays like `mon/thu`; and `after-3d` (any interval) to count from the day you finish instead of the due date. Check it off with `⌘L`, a click on its checkbox, `x` in the Tasks views or a drop into Done, and the next occurrence is written right above it with the next date in `due:`, while the finished line stays below as the record, without `@repeat` (so unchecking it never makes a second copy). Its subtasks repeat too, every checkbox open again, and the record cancels (`[-]`) the ones you left open, so only the fresh copies stay on your lists; subtasks you select along with the task (`Vjj` then `⌘L`) are checked off instead. The next date counts from the due date (or, without one, the daily note’s date, then today) and is never today or earlier: a daily task done three days late comes back tomorrow, not as three overdue copies. `monthly` from the 31st lands on the last day of shorter months. Press `r` in the Tasks views (or Repeat… in the right-click menu, or `:repeat weekly` in a note) to set or stop it; Skip this time in the menu schedules the next one and records this one as cancelled. In the Tasks views a repeating task shows a repeat icon beside its date. Typing an `x` into the brackets by hand is just text and does not repeat. Whole-note task files do not repeat yet.'
582
+
'Add `@repeat:` to a task and checking it off schedules the next one: `- [ ] Water the plants @repeat:weekly due:2026-11-01`. The rules are `daily`, `weekdays`, `weekly`, `monthly` and `yearly`; `2d`, `3w`, `6m` or `1y` for every so many days, weeks, months or years; weekdays like `mon/thu`; and `after-3d` (any interval) to count from the day you finish instead of the due date. Check it off with `⌘L`, a click on its checkbox, `x` in the Tasks views or a drop into Done, and the next occurrence is written right above it with the next date in `due:`, while the finished line stays below as the record, without `@repeat` (so unchecking it never makes a second copy). A block id such as `^plants` moves to the next occurrence and leaves the record, so a `[[Chores^plants]]` link or embed keeps showing the task you do next. Its subtasks repeat too, every checkbox open again, and the record cancels (`[-]`) the ones you left open, so only the fresh copies stay on your lists; subtasks you select along with the task (`Vjj` then `⌘L`) are checked off instead. The next date counts from the due date (or, without one, the daily note’s date, then today) and is never today or earlier: a daily task done three days late comes back tomorrow, not as three overdue copies. `monthly` from the 31st lands on the last day of shorter months. Press `r` in the Tasks views (or Repeat… in the right-click menu, or `:repeat weekly` in a note) to set or stop it; Skip this time in the menu schedules the next one and records this one as cancelled. In the Tasks views a repeating task shows a repeat icon beside its date. Typing an `x` into the brackets by hand is just text and does not repeat. Whole-note task files do not repeat yet.'
0 commit comments