โ– humdrum codex / glint v1.0.2
license AGPL-3.0

โ† issues

TASK-023 Toggle checkbox state with a key (- [ ] <-> - [x])

๐Ÿ Done feature priority: low release-1

created 2026-06-29 21:08 ยท updated 2026-06-30 04:40

Description

From TASK-008 description (deferred, not an AC there): toggle the checkbox on the current list line between [ ] and [x] with a keybind, without hand-editing the brackets. Should work whether or not the cursor is on the brackets; no-op on non-checkbox lines.

Acceptance Criteria

Implementation Plan

  1. RED+GREEN editor.ToggleCheckbox() (lists.go): flip [ ]<->[x] on cursor line any col; no-op non-checkbox. checkboxRange helper via parseListItem boxStart. 2. OnCheckboxBracket() for mouse-glyph hit. 3. Wire Alt+x keybind (dispatch Alt-rune switch + editKindOf kindStructural=undoable). 4. app.handleMouse: press on checkbox glyph -> PushUndo+ToggleCheckbox. 5. Docs README+help.go.

Implementation Notes

Scope expanded per user: toggle by (a) keybind with cursor anywhere on the line, and (b) mouse click on the checkbox glyph. Mouse handling lives in app.go (it owns tea.MouseMsg + margin/scroll->buffer mapping; see MoveToVisual); the toggle mutation itself should be an editor method (e.g. ToggleCheckbox) so it's unit-testable and undoable.