feat: add markdown detail buffer for task notes (#162)

Problem: tasks only have a one-line description. There is no way to
attach extended notes, checklists, or context to a task.

Solution: add `ge` keymap to open a `pending://task/<id>` markdown
buffer that replaces the task list in the same split. The buffer shows
a read-only metadata header (status, priority, category, due,
recurrence) rendered via extmarks, a `---` separator, and editable
notes below. `:w` saves notes to a new top-level `notes` field on the
task stored in the single `tasks.json`. `q` returns to the task list.
This commit is contained in:
Barrett Ruth 2026-03-13 08:22:04 -04:00 committed by GitHub
parent 0b0b64fc3d
commit f472ff8990
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 298 additions and 0 deletions

View file

@ -24,6 +24,7 @@ local config = require('pending.config')
---@field entry string
---@field modified string
---@field end? string
---@field notes? string
---@field order integer
---@field _extra? pending.TaskExtra
@ -93,6 +94,7 @@ local known_fields = {
entry = true,
modified = true,
['end'] = true,
notes = true,
order = true,
}
@ -124,6 +126,9 @@ local function task_to_table(task)
if task['end'] then
t['end'] = task['end']
end
if task.notes then
t.notes = task.notes
end
if task.order and task.order ~= 0 then
t.order = task.order
end
@ -150,6 +155,7 @@ local function table_to_task(t)
entry = t.entry,
modified = t.modified,
['end'] = t['end'],
notes = t.notes,
order = t.order or 0,
_extra = {},
}