cards: a document and its cards, seen from both ends

A document now lists the cards about it: the ones whose notes it is and
the ones whose description links to it. GET /nodes/{id}/cards answers
that, and the node itself carries it as `cards`. A line under the
document's meta line says what is still open and when it is first due;
it and `gc` open a new cards part of the info sheet, where j/k picks a
card, Space, H/L, D, a and `:` act on it, and Enter turns it over on its
board. `c` while reading a document makes a card about it.

Card verbs act on the card in focus wherever it is looked at: the
board's cursor, the card turned over, the agenda's highlight, the card
picked in the info sheet, or a document's only open card. patchCard,
sendCard and toggleDone take that card, so patchAgendaCard,
sendAgendaCard and finishCard are gone, and :due, :repeat, :label and
:done no longer refuse to run away from the board.

Migration 0027 adds card_links, links for a card's description: indexed
on every write, backfilled on start, followed and rewritten on a rename
or move like a document's, and claimed when a title they named appears.
It also adds cards_fts over title, description and checklist steps;
GET /cards?q= searches it, and / lists the cards found after the nodes,
Enter turning one over on its board.
This commit is contained in:
nvrl committed 2026-10-22 10:45:20 +02:00
1 parent 5684614d0a
commit b8b3641e6e
21 files changed
+896 -274

No files matched your search

+2
View File
@@ -33,6 +33,7 @@ sealed or not.
| `POST` | `/api/lists/{id}/cards` | add a card |
| `PUT`/`DELETE` | `/api/cards/{id}` | update (title, body, due, repeat, checklist, labels, done, link) / delete; finishing a repeating card answers its copy as `again` |
| `POST` | `/api/cards/{id}/move` | to another list and place in it; `again` as above |
| `GET` | `/api/cards?q=…` | cards whose title, summary or a checklist step matches, open ones first; `space` keeps it to one board |
| `GET`/`POST` | `/api/scratch` | the scratchpad's notes, the one touched last first / a new note `{ body }` |
| `PUT`/`DELETE` | `/api/scratch/{id}` | rewrite a note `{ body }` / drop it |
| `POST` | `/api/nodes/{id}/move` | reparent, and place among the new siblings |
@@ -43,6 +44,7 @@ sealed or not.
| `GET` | `/api/nodes/{id}/revisions` | a document's earlier versions, the newest first |
| `GET` | `/api/nodes/{id}/revisions/{rev}` | one earlier version, with its text |
| `GET` | `/api/nodes/{id}/backlinks` | the documents that link to this one, with the line each does it on |
| `GET` | `/api/nodes/{id}/cards` | the cards about this document: its own (`node_id`) and the ones whose summary links here — also in the node itself as `cards` |
| `POST`/`DELETE` | `/api/nodes/{id}/share` | mint or rotate / revoke a share link |
| `GET` | `/api/export` | the whole workspace, boards and dates included, as a zip |
| `GET`/`POST` | `/api/backup` | Proton Drive mirror: status / run now |
+29 -2
View File
@@ -111,17 +111,44 @@ step open again.
`c` in the tree opens `:card ` on the command line. The card goes
into the inbox of the space you are in, or of the first space with a board, and
you stay where you were. From outside the browser, see [Capture](Capture.md).
you stay where you were. Reading a document, `c` opens `:card! ` instead: the
card is about that document, and an empty title takes the document's. From
outside the browser, see [Capture](Capture.md).
### Notes
`gf` on a card, or on its back, opens its notes: a document named after the card, made in the
root of the space the first time, in a tile beside the board. Closing it goes
back to the board, on the same card. `:card!` while reading a document makes a card that points at it.
back to the board, on the same card.
The link is loose on purpose: deleting the document leaves the card, because the
work is still open when its notes are gone.
### A document's cards
A document knows the cards about it: the ones whose notes it is, and the ones
whose description links to it with a `[[title]]` or an `/n/` path. Under the
line below its title, a second line says what is still open about it
(`card write the plan · doing`, or `cards 3 open`) and the first date one is
due. Clicking it, or `gc`, opens the cards part of the info sheet.
There, `j`/`k` picks a card. `Space` finishes it, `H`/`L` sends it along its
board, `D` or `:due` sets its date, and `:label` and `:repeat` work too, all
without going to the board. `Enter` turns it over on its board. `o` makes another
card about the document.
Reading a document with just one open card about it, the card verbs act on that
card with the sheet closed: `:due fri` while reading the plan dates the plan's card.
A card's description links the way a document's text does. Renaming or moving
a document rewrites the links to it in card descriptions too.
### The card in focus
`:due`, `:repeat`, `:label` and `:done` act on the card in focus: the one under
the board's cursor, the one turned over, the one highlighted in the agenda, or
a document's card as above.
### Due dates
`D` on a card (or `:due <when>`) takes a date the way it is said:
+7 -5
View File
@@ -29,7 +29,7 @@ arguments and `↑` / `↓` recall earlier lines.
| `Ctrl-D / Ctrl-U` | half a page down / up the open document |
| `zl / zh · zL / zH` | the wide table or code block at the top of the view, sideways — a little, or half its width |
| `]] / \[\[` | next / previous heading of the document — in the editor too |
| `gi` | the info sheet: the open document's headings, earlier versions, backlinks and sharing — Tab between them |
| `gi` | the info sheet: the open document's headings, earlier versions, backlinks, cards and sharing — Tab between them |
| `gO` | the headings as a list: j/k, Enter jumps there |
| `F` | hints over the links and buttons in view — type one to follow it |
| `gf / gx` | in the editor: follow the link under the cursor / open it in a tab |
@@ -50,7 +50,7 @@ arguments and `↑` / `↓` recall earlier lines.
| `[d / ]d` | the diary entry before / after the one open, by date |
| `Ctrl-P` | find anything, in every space — Enter opens the result lit beside them, n goes on |
| `b` | the board, in a tile: this space's, or the last one shown — 1 … 9 there shows another's |
| `c` | capture a card into this space's inbox, without leaving here |
| `c` | capture a card into this space's inbox, without leaving here — reading a document, a card about it |
| `Esc · q` | close the document, and its tile when there are several |
| `/` | full-text search, inside the current space and its text files — Tab or Ctrl-N/P walk the results, Enter opens one |
| `n / N` | next / previous search result, opened beside the results — :noh clears the search |
@@ -60,6 +60,7 @@ arguments and `↑` / `↓` recall earlier lines.
| `u` | undo the last delete: it comes back out of the trash — :trash has the rest |
| `gh` | the open document's earlier versions, as diffs — Enter brings one back |
| `gb` | the documents that link to the open one — \[\[title]] links by title, \[\[ completes one while writing |
| `gc` | the cards about the open document — j/k picks the one :due, :label, Space and H/L act on, Enter turns it over on its board |
| `:` | command line — Tab / Shift-Tab cycle the matches, then the argument; ↑ ↓ recall what ran before |
| `Ctrl-S` | save, from anywhere |
| `?` | this screen, from the editor too — h/l a column, / filters it down |
@@ -157,9 +158,9 @@ do: `:w!`, `:space! <name>`, `:import!`.
| `:plan, :special` | the board, the agenda and the calendar, tiled ahead of what is open — S puts them up, and every view away again; 1 … 9 on the board picks the board |
| `:card, :c <title>` | add a card — on the board to the list under the cursor, elsewhere to this space's inbox |
| `:card!` | add a card linked to the open document — gf on it opens the document |
| `:due <when\|->` | due date of the card — on the board, its back, or highlighted in the agenda: today, tm, fri, +3d, +2w, 10-31, 2026-10-31 — - clears |
| `:due <when\|->` | due date of the card in focus — on the board, its back, in the agenda, or the open document's: today, tm, fri, +3d, +2w, 10-31, 2026-10-31 — - clears |
| `:repeat <rule\|->` | once the card is done, a copy comes back in the inbox: daily, weekly, monthly, yearly, +3d, +2w, +6m — - stops it |
| `:done` | move the selected card into the done list, or back out to the inbox |
| `:done` | move the card in focus into the done list, or back out to the inbox |
| `:task, :step <text>` | add a step to the open card's checklist, below the cursor |
| `:task!` | reword the step under the cursor |
| `:label <name>` | put a label on the card, or take it off when it has it — each name keeps its colour everywhere |
@@ -184,9 +185,10 @@ do: `:w!`, `:space! <name>`, `:import!`.
| `:delete, :d, :rm [id]` | delete a node, and everything under it, into the trash (asks first) — u brings it back |
| `:history, :hist` | the open document's earlier versions as diffs — j/k, Enter brings one back (gh) |
| `:backlinks, :bl` | the documents that link to the open one — j/k, Enter opens one (gb) |
| `:cards` | the cards about the open document — its own, and the ones whose summary links here: j/k picks the one :due, :label, Space and H/L act on, Enter turns it over on its board (gc) |
| `:source` | show an open markdown file as written, or rendered again |
| `:outline, :toc` | the open document's headings to pick from — gO, in the editor too |
| `:info [outline\|history\|backlinks\|share]` | what is known about the open document: its headings, earlier versions, backlinks and sharing — Tab between them (gi) |
| `:info [outline\|history\|backlinks\|cards\|share]` | what is known about the open document: its headings, earlier versions, backlinks, cards and sharing — Tab between them (gi) |
| `:search, :se [text]` | full-text search in this space (empty clears) |
| `:search!` | full-text search across every space — Ctrl-P |
| `:clear, :noh` | clear the search filter |
+4
View File
@@ -56,6 +56,10 @@ folder it is in. `Tab` or `Ctrl-N` / `Ctrl-P` walk them without leaving the
line, and `Enter` opens the one lit. Afterwards `n` and `N` open the next and
previous result beside the list, and `:noh` clears the search.
Cards are searched too, by their title, description and checklist steps. They
are listed after the documents, under `cards`, with the board and list each is
on. `Enter` on one turns it over on its board; `n` and `N` only light it up.
![A search that found a line in a log file](../images/search.png)
Each word you type matches the start of a word, so `inge` finds "ingest". All