super-productivity/docs/wiki/4.10-Task-Notes.md
Johannes Millan 0e04e8feaa
feat(tasks): checklist progress, bulk actions & notes editor UX (#8156)
* build: drop unused elevate.exe from Windows build #8135

elevate.exe is bundled by electron-builder's NSIS target solely so
electron-updater can apply privileged per-machine updates. We ship no
in-app auto-updater (electron-updater is not a dependency; the autoUpdater
block in electron/start-app.ts is commented out), so the binary is unused
dead weight and a frequent AV false-positive. Set packElevateHelper: false
to stop bundling it; safe because perMachine is not true.

* docs: flag task component (perf) and sync system (correctness) as high-risk areas

* feat(tasks): show checklist progress indicator on task cards

Derive checklist progress from a task's markdown checklist notes and surface
a compact "done/total" badge in the task controls. The badge switches to a
completed state when every item is checked and opens the notes panel on click,
making checklist progress visible at a glance without opening the task.

https://claude.ai/code/session_0131giFn7PwH5AFMUpSQXdU2

* feat(tasks): add checklist reorder and bulk actions in notes

Add drag-to-reorder for checklist items in the notes editor and a checklist
actions menu (Check all / Uncheck all / Clear completed), shown only when the
notes are recognized as a markdown checklist. All operations are backed by pure,
unit-tested helpers that manipulate the existing markdown notes string and emit
through the normal change flow, preserving interleaved prose lines.

https://claude.ai/code/session_0131giFn7PwH5AFMUpSQXdU2

* refactor(tasks): harden checklist reorder and add drop indicator

Review follow-ups for the checklist actions:
- guard moveChecklistItem against NaN/non-integer indices (a NaN drop index
  previously slipped past the range checks and corrupted ordering)
- show a drop-target highlight while dragging a checklist item
- drop redundant modelCopy.set (the model setter already syncs it)
- add component tests for bulk actions and the drag-and-drop flow

https://claude.ai/code/session_0131giFn7PwH5AFMUpSQXdU2

* refactor(tasks): remove checklist drag-to-reorder, refine card icon

Remove native drag-to-reorder for checklist items in the notes editor
(drag handlers, drop indicator, the moveChecklistItem helper, and the
related styles and tests). The checklist bulk-actions menu (check all /
uncheck all / clear completed) and the task-card progress badge are kept.

On the task card, the checklist progress badge now stands in for the plain
'chat' notes indicator: when a task has a checklist the redundant notes icon
is suppressed, and the badge itself yields to the close (X) button when the
detail panel is open, mirroring how the notes icon behaves.

* feat(tasks): replace unmodified default notes template on checklist toggle

When the notes field shows only the app's stock default template (and it
has not been edited), the checklist button now replaces that placeholder
with a fresh checklist instead of appending a checkbox below it. Edited
content and user notes are preserved and appended to as before.

Adds a `defaultText` input on inline-markdown so the task detail panel can
pass the (replaceable) stock template, guarded by isStockNotesTemplate so a
user-customized template is treated as real content.

* fix(tasks): indent list line on Tab regardless of cursor column

handleTabKey previously only indented when the cursor sat at line start or
at the end of an empty prefix, so pressing Tab mid-item moved focus out of
the editor instead of indenting. It now indents whenever the collapsed
cursor is on a list line, returning null only for multi-char selections or
non-list lines.

* feat(tasks): hint "Notes / Checklist" in empty notes header

When a task has no notes yet, the notes section header now reads
"Notes / Checklist" instead of "Notes", hinting that the section can hold
either a free-form note or a checklist. Plain notes still show "Notes" and
a recognized checklist still shows "Checklist".

* feat(tasks): limit checklist item click target to checkbox and text

Checklist item text was rendered as a bare text node inside the block-level
row, so clicking anywhere on the row (including empty space) toggled the
item. Wrap the text in a <span class="checkbox-label"> and only toggle when
the click lands on the checkbox icon or that label; clicks on the rest of
the row fall through to opening the editor. Cursor affordance is moved off
the row onto the checkbox and label accordingly.

* fix(tasks): map checklist toggle to the correct source line

_handleCheckboxClick mapped the Nth rendered checkbox to the Nth source line
matching `line.includes('- [')`, which also matches non-task lines such as
markdown link bullets (`- [text](url)`) or prose. That shifted the index so
clicking a checkbox could toggle the wrong line (often a no-op). Use the
anchored `isChecklistItemLine` predicate — the same one the bulk-action
helpers use — so source lines align with the rendered checkboxes. Applied to
both the inline editor and the fullscreen markdown dialog (duplicated logic).

* refactor(tasks): unify checklist predicate and dedupe toggle logic

Addresses multi-review feedback (W1/W3/S1):

- Single source of truth for "is a checklist line": isMarkdownChecklist,
  markdownToChecklist and getChecklistProgress now use the checklist-operations
  predicates instead of three divergent definitions. Tightened CHECKLIST_ITEM_RE
  to /^\s*- \[[ xX]\]/ so it matches exactly what marked renders (verified: marked
  treats - [ ]/- [x]/- [X] as tasks but NOT - []). This also fixes the badge not
  recognizing uppercase [X] checklists.
- Extracted toggleChecklistItemAtIndex() into checklist-operations and use it in
  both _handleCheckboxClick copies (inline editor + fullscreen dialog), removing
  the duplicated index-mapping + string-toggle. The helper flips only the
  checkbox marker (item text containing [ ] is safe) and handles [X] uncheck —
  both pre-existing bugs in the old inline toggle.
- getChecklistProgress counts in a single pass over the lines (no intermediate
  markdownToChecklist array / throwaway substring allocations) — it runs on the
  task-card hot path.

* fix(tasks): match checklist predicate exactly to marked's task rendering

Final review follow-up. The line predicate now requires "- [marker] <content>"
(marker box + whitespace + a non-space char), matching what marked actually
renders as a checkbox — verified against marked across 15 cases. Previously an
empty "- [ ] " placeholder line (or "- [x]a" with no space) was counted as an
item even though marked renders no checkbox for it, which could desync the
Nth-checkbox -> Nth-line mapping (e.g. "- [ ] \n- [x] real": marked shows 1
checkbox, predicate matched 2, so clicking the real item toggled the empty
line). Tightening CHECKLIST_ITEM_RE/CHECKED_ITEM_RE closes that gap and makes the
"in sync with marked" comment accurate.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-06-08 20:21:10 +02:00

5.2 KiB
Raw Blame History

Task Notes

Task notes in Super Productivity are integrated, context-aware documentation that complement rather than replace external documentation tools. They are designed for immediate task-related information capture and retrieval during both planning and execution, so you can keep context in one place without switching to a separate app.

The app also supports project notes—notes attached to a project rather than a single task—for project-wide context. See 4.06-Project-View. This concept focuses on task notes: the notes field on a task, used in the task detail panel and in focus mode. See 4.09-Task-Attributes for how notes fit into the task model.

Role Compared to External Documentation Tools

Task notes provide lightweight, task-attached documentation that stays within the workflow. The note is always available when you open the task or work on it in focus mode, so you do not have to leave the app to look up what you wrote. External tools (for example Jira, GitHub, or your own wikis) handle broader project documentation, specs, and long-lived knowledge; Super Productivitys notes are for immediate context: what you want from this task, how you plan to do it, and what you capture while working. The app can sync data (including notes) via WebDAV or Dropbox for backup, but the primary role of task notes is immediate, task-contextual documentation rather than a full knowledge base.

Planning Vs Execution Usage

Task notes support both planning and execution, with different emphasis in each phase.

Planning phase: When you create or open a task, you can use a default note template (configurable in 3.02-Settings-and-Preferences) to guide structured thinking. The template can include prompts such as “How can I best achieve it now?” and “What do I want?” so new tasks start with a consistent structure. The template is only a starting point—you can edit or replace it. That gives you structure when you want it without forcing a rigid format.

Execution phase: During work, notes act as a dynamic working document. In focus mode, you can view and edit the tasks notes in place, so you can update them in real time without leaving the task context. You can add checklists, capture decisions, or jot down next steps as you go. The inline markdown editor supports both structured checklists (which the app can treat as a checklist in the UI) and free-form content, so you can mix lists and prose as needed.

When a tasks notes are recognized as a checklist, the task shows a small progress indicator (for example 2/5) in its controls, so you can see at a glance how far along the checklist is without opening the task. The indicator switches to a completed state once every item is checked, and clicking it opens the tasks notes.

While viewing a checklist in the notes editor you can manage it directly with the checklist actions menu (the list icon next to the editor controls) to Check all, Uncheck all, or Clear completed items in one step. These actions only appear when the notes are recognized as a checklist.

Structured Vs Free-form: How the Design Balances Both

The note system balances structure and flexibility so notes can serve as both planning aids and flexible execution documents.

  1. Template-guided structure — The default note template gives new tasks a consistent starting shape (for example planning questions). The template is editable per task, so you keep structure where it helps and drop it where it does not.

  2. Markdown flexibility — Notes support standard markdown: headings, lists, bold, links, and so on. You can write free-form text or use list syntax that the app can treat as a checklist. You are not locked into a fixed form.

  3. Context-aware storage — Notes are stored as simple text attached to a specific task (or, for project notes, to a project). That keeps them easy to find and keeps the data model simple—no heavy schema, just content tied to the right context.

  4. Minimal schema — The note model stays minimal: content, optional image reference, and basic metadata. That avoids over-structuring and keeps notes fast to use for ad hoc capture while still supporting templates and checklists when you want them.

The result is that notes can act as structured planning tools and as flexible execution documents without the overhead of a complex note schema.

Sync and Backup

Task and project notes are part of your Super Productivity data. When you use sync (for example WebDAV or Dropbox), notes are included in the synced data, so they are backed up and available on other devices. Sync supports backup and continuity; it does not change the main purpose of notes, which remains immediate, task- and project-contextual documentation rather than a substitute for a full external knowledge management system.