mirror of
https://github.com/narrrl/narl-workspace.git
synced 2026-11-04 17:07:00 +01:00
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:
1 parent
5684614d0a
commit
b8b3641e6e
21 files changed
+896
-274
No files matched your search
+13
-2
@@ -53,6 +53,8 @@ export interface WorkspaceNode extends NodeSummary {
|
||||
path: Crumb[]
|
||||
/** How many documents link here. */
|
||||
backlinks: number
|
||||
/** The cards about it — its own, and those whose summary links here — open ones first. */
|
||||
cards: AgendaCard[]
|
||||
/** Where each `[[title]]` in the body leads, as an /n/ path; a title that leads nowhere is missing. */
|
||||
wikilinks: Record<string, string>
|
||||
}
|
||||
@@ -191,12 +193,16 @@ export interface Moved extends Card {
|
||||
again: Card | null
|
||||
}
|
||||
|
||||
/** An open card as the agenda lists it, with the board it lives on. */
|
||||
/**
|
||||
* A card with the board it lives on: as the agenda lists it, as a document
|
||||
* lists the cards about it, and as a search finds it.
|
||||
*/
|
||||
export interface AgendaCard extends Card {
|
||||
space_id: number
|
||||
space_slug: string
|
||||
list_name: string
|
||||
role: 'inbox' | 'doing'
|
||||
/** The agenda only ever has the first two. */
|
||||
role: 'inbox' | 'doing' | 'done'
|
||||
}
|
||||
|
||||
export interface Agenda {
|
||||
@@ -456,6 +462,11 @@ export const api = {
|
||||
},
|
||||
|
||||
getNode: (id: number) => request<WorkspaceNode>(`/nodes/${id}`),
|
||||
/** The cards about a document, as `getNode` has them. */
|
||||
nodeCards: (id: number) => request<AgendaCard[]>(`/nodes/${id}/cards`),
|
||||
/** The cards whose title, summary or steps match — in one space's board with `space`. */
|
||||
searchCards: (q: string, space?: number) =>
|
||||
request<AgendaCard[]>(`/cards?${new URLSearchParams(space === undefined ? { q } : { q, space: String(space) })}`),
|
||||
|
||||
/** `work/einarbeiten/01-was-ist-eebus` — the node behind a `/n/...` address. */
|
||||
resolvePath: (path: string) => request<WorkspaceNode>(`/resolve?path=${encodeURIComponent(path)}`),
|
||||
|
||||
Reference in new issue
Block a user