Skip to content

feat: clickable task checkboxes ( - [ ] ) in the note editor #26

@jamubc

Description

@jamubc

Why

InstantNotes is capture-first, and task lists are one of the most common things people jot down. Markdown task syntax (- [ ] todo / - [x] done) is already natural to type, but today it stays plain text: to mark something done you edit the characters by hand. Rendering those lines as clickable checkboxes makes notes actionable without turning InstantNotes into a heavy markdown editor. This was deliberately scoped out of the lightweight markdown styling work (feat/editor-toolbar) to keep that change focused, and is tracked here as a separate, additive follow-up.

What Changes

  • Render note lines beginning with - [ ] or - [x] (and * [ ] / * [x]) as a real checkbox followed by the item text, consistent with the editor's "markers stay visible" styling
  • Clicking a checkbox toggles the source text between the unchecked and checked forms, flowing through the existing debounced autosave (no new persistence path)
  • Keep it lightweight and additive: no separate task store, no preview pane, no change to how #tags work
  • Ship on its own branch (e.g. feat/task-checkboxes), stacked after feat/editor-toolbar

ADDED Requirements

Requirement: Clickable task checkboxes

The editor SHALL render a note line beginning with - [ ] or - [x] (optionally * [ ] / * [x]) as an interactive checkbox followed by the line's text.
Clicking the checkbox MUST toggle the source text between the unchecked and checked forms and persist the change through the existing debounced note autosave.
The raw markdown MUST remain editable as text, consistent with the editor's marker-visible styling, and MUST NOT introduce a separate task store or a preview mode.

Requirement: Tag and heading behavior unchanged

Task checkboxes MUST NOT alter #tag parsing or the decision to leave # headings unstyled (see feat/editor-toolbar): a #tag on a task line stays a tag and is never treated as a heading.

Scenario

GIVEN a note containing the line "- [ ] buy milk"
WHEN the user clicks the checkbox rendered at the start of that line
THEN the source text becomes "- [x] buy milk", the checkbox shows as checked,
     and the change is saved by the normal autosave (survives reselecting the note)

GIVEN a task line "- [ ] ship #release"
WHEN the line is rendered with its checkbox
THEN "#release" is still styled as a tag, not a heading, and stays editable text

Verification

  1. Toggle behavior
    1.1 Create a note with - [ ] buy milk
    1.2 Confirm a checkbox renders at the start of the line, with the markdown still visible/editable
    1.3 Click the checkbox; confirm the source becomes - [x] buy milk and it persists after switching notes and back
    1.4 Click again; confirm it returns to - [ ]
  2. Tag and heading invariant
    2.1 Add #release to a task line and confirm it renders as a tag (not a heading)
  3. Scope
    3.1 Confirm no preview pane and no separate task store were introduced

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions