Documentation
¶
Overview ¶
Package view persists named "smart views" — saved bundles of the `nt list` filter so a user can capture a query once and recall it by name (T4). Views live in $NT_DIR/views.json, a machine-managed file (like undo.jsonl), kept separate from the hand-edited, read-only config.toml so `nt view save` never rewrites a user's annotated config. The package is surface-agnostic: it knows only the filter shape, not how any front-end renders a list, so the CLI, TUI, and web can all share these specs.
Index ¶
Constants ¶
const FileName = "views.json"
FileName is the views file's basename within $NT_DIR.
Variables ¶
This section is empty.
Functions ¶
func Load ¶
Load reads $NT_DIR/views.json. A missing file yields an empty (non-nil) map and no error, so callers can treat "no views yet" as the normal first run.
Types ¶
type Spec ¶
type Spec struct {
Status string `json:"status,omitempty"`
Tag string `json:"tag,omitempty"`
Project string `json:"project,omitempty"`
Sort string `json:"sort,omitempty"`
All bool `json:"all,omitempty"`
ShowBlocked bool `json:"showBlocked,omitempty"`
Tree bool `json:"tree,omitempty"`
}
Spec is one saved view: the subset of `nt list` flags that select and order tasks. Output-only choices (e.g. --json) are deliberately excluded — they are a recall-time concern, not part of the saved query.