krz/orgstar

A native macOS editor for org-mode files. editor org-mode swift

docs/plans/2026-10-05-agenda-search.md

b98a6509c5ae75e5172dd333d1b6105fd6ceee0e
orgstar/docs/plans/2026-10-05-agenda-search.md rendered · source · history · blame · raw

41 lines · 2687 bytes

6 symbols in this file
 1# Agenda Search and Actions Implementation Plan
 2
 3> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
 4
 5**Goal:** The TODO list (`org-todo-list`), tag/property/TODO match views (`org-tags-view`, `m` and `M`), saved views, and agenda commands that change entries (TODO state, priority, schedule, deadline, tags, date shift) from the agenda window.
 6
 7**Architecture:** `OrgCore/Agenda/AgendaSearch.swift` ports `org-agenda-get-todos`, `org-make-tags-matcher` and `org-scan-tags` over `AgendaSource`, which now carries levels, own properties, planning and first timestamps for the special properties. Emacs regexps in `{...}` terms are translated to ICU. Saved views are read from `views.toml` beside `keymap.toml`. Agenda commands run the existing editor commands at the entry: through the open buffer when the file is open, otherwise on a `DocumentState` read from disk and written back through `Saver`, so a file changed on disk in between is merged or refused.
 8
 9**Tech Stack:** Swift 6.2 tools, Swift Testing, Emacs 31.1 / Org 9.8.7 oracle.
10
11**Spec:** `docs/design.md`, "Phase 3".
12
13## Global Constraints
14
15- Oracle: `org-todo-list` and `org-tags-view` (with and without TODO-only) over the agenda test files and the corpora, compared line by line as for the agenda.
16- `/{regexp}` against a heading without a keyword is an error in Emacs; it is no match here.
17- String comparisons in matches use code point order (`string-collate-lessp` in the C locale).
18
19## Defaults chosen (user may change)
20
21- Views: Agenda (`a`), TODO list (`t`), Match (`m`) and TODO match (`M`) are built in; `views.toml` adds named views.
22- Agenda keys follow Emacs: `t` TODO cycle, `+`/`-` priority, `,` priority prompt, `:` tags, `C-c C-s`/`C-c C-d`, `C-c C-q`, `S-→`/`S-←` date shift.
23
24---
25
26### Task 1: TODO list and matcher
27
28- [x] `Agenda.todoList`, `Agenda.tagsMatch`, `TagsMatcher`, `EmacsRegex`.
29- [x] Oracle: 4 TODO lists and 34 match strings × TODO-only on three synthetic files; corpora.
30- [x] Commit "TODO list and tag matches".
31
32### Task 2: Views in the app
33
34- [x] `AgendaModel.mode` (agenda, TODO list, match); view picker and match field in the agenda window; `views.toml` loader with errors in the echo area.
35- [x] Commit "Agenda views".
36
37### Task 3: Agenda commands
38
39- [x] `DocumentSession.perform(_:path:at:expect:)`: run a command at a file offset, through the buffer or through `Saver`.
40- [x] Keys in the agenda window; prompts for dates, tags and priority; the agenda refreshes after each.
41- [x] Commit "Agenda commands".