feat: one-key linkify — write [[link]] into the source file (slice 3b) #8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/linkify"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Slice 3b — the write half of page-level connect, and peekseq's first writer to files other than the current page.
From the backlinks panel's Unlinked references section, press
lon a mention → a before/after preview confirms (ywrites,n/esccancels) → the bare mention is wrapped as[[<matched>]]in its source file → the graph reindexes synchronously and the panel refreshes so the reference moves from unlinked to linked.Design choices:
[[alpha]]still resolves toAlphavia fold-keyedResolve).graph.LinkifyMentionre-reads the file fresh and re-finds the first unlinked, whole-word, Unicode-aware occurrence on the raw line, splicing by absolute byte offset (CRLF + trailing-newline preserved; no double-wrap). It does NOT trust the offset captured when the panel opened, so a file changed since detection fails safely.SetLinkifyError) — a status-bar hint would be invisible behind the overlay.Spec:
docs/superpowers/specs/2026-06-14-one-key-linkify-design.mdPlan:
docs/superpowers/plans/2026-06-14-one-key-linkify.mdTest Plan
go vet ./... && go test ./...greengraph.LinkifyMention— casing, CRLF, no-trailing-newline, first-occurrence, skip-already-linked, whole-word, Unicode (Über/C++), out-of-range, regex-meta targetb → ↓ → l → ywrites[[…]]and refreshes panel; mention-gone leaves file untouched + shows in-panel error