Skip to content

Feat(tui): Skip this time, and a daily note's date for repeating tasks - #58

Open
spirit-of-light wants to merge 1 commit into
ZenNotes:mainfrom
spirit-of-light:feat/task-skip-occurrence
Open

spirit-of-light wants to merge 1 commit into
ZenNotes:mainfrom
spirit-of-light:feat/task-skip-occurrence

Conversation

@spirit-of-light

Copy link
Copy Markdown
Contributor

Summary

This change adds the task menu item "Skip this time", and the Tasks views now count a repeating task from the date of its daily note. Both are the same as in the desktop app. This is the third small PR from the review of #50. It uses the shared engine internal/vault/task_recurrence.go and does not change it, its test or the case file. It does not change the note format.

What changes

  • Skip this time: the task menu has this item with the key n. It shows only for an open inline task with a valid @repeat: rule, as in the desktop's task-context-menu.ts. It calls the engine with Skip: true: the next occurrence goes above the task, and the task becomes a cancelled [-] record. The desktop uses r for Repeat… in the Tasks views, so this PR keeps r free. j, k and q move or close the menu.
  • Base date in the Tasks views: a check-off of a repeating task from the Tasks list, the menu, a board move to Done, Home or the calendar passes FallbackDue as the desktop's recurringCompletionFor does. This is the task's due when it is inferred, else the date of its daily note. The daily-note date applies only when daily notes are on and tasksDueOnNoteDate is true. A due: on the line and a due in the frontmatter come first.
  • Notice: after a roll, zn shows "Next: ". After a skip, it shows "Skipped. Next: ". zn has no short day label, so the date is in ISO form.
  • Editor cursor: when the note is open in the editor, the cursor stays on its line after the roll adds lines above it.

What does not change

  • zn task toggle and the MCP tools count from today, as the MCP of the desktop does.
  • All other toggles go through the backend toggle, as before. A task without a valid rule, a task note, unticking, [>] and [-] do not change.
  • The roll writes the note through the same path as the other task edits of the terminal app, so it works for local and remote vaults.

Tests

  • New tests in internal/tui/task_skip_test.go and one new test in internal/cli/tasks_test.go. The tests in internal/tui failed before the change, except for the remote-vault test.
  • The tests cover the menu, the skip, the base date, a board move to Done, a remote vault, the editor cursor and the CLI.
  • The tests use a fixed clock. The CLI test uses dates that give a different result for each base date on every day.
  • go vet ./..., gofmt -l internal cmd and git diff --check show no problems.
  • go test -race ./... passes, except for TestManyControlSequencesRenderQuickly, which also fails under -race on a clean main.

Note

#57 adds a similar per-note helper to internal/tui/data.go. This PR uses the same name, dailyDueOfPath. If #57 is merged first, I will rebase this branch.

🤖 Generated with Claude Code

https://claude.ai/code/session_0171pE1tFQspTuCEpf1xvQiH

The desktop app has the task menu item Skip this time. It writes the
next occurrence of a `@repeat:` task and keeps this occurrence as a
cancelled record. The task menu of zn now has the same item, with the
key `n`. It shows only for an open inline task with `@repeat:`.

A check-off of a repeating task from the Tasks list, the board, Home
or the calendar now counts from the date of its daily note, as on the
desktop. This applies only when daily notes are on and their tasks take
the note date. A `due:` on the line and a `due` in the frontmatter come
first. After the roll, a notice gives the next date.

The CLI and MCP do not change. They count from today, as the MCP of the
desktop does. The roll goes through the backend, so it works for local
and remote vaults.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0171pE1tFQspTuCEpf1xvQiH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant