Conversation
A collapsible "Unlinked mentions" section under the backlinks lists notes that name the active note (title, file stem or a frontmatter alias) in plain text without linking it, each hit with its line number and the phrase highlighted in context. Candidates come from the FTS5 index: one quoted body phrase per name, built by a dedicated `body_phrases_expr` that reuses the user-query quoting, so no name is ever interpolated into MATCH. Every candidate is then verified on the real file text in `core::mentions`: whole words, case-insensitive, ё = е, Unicode word boundaries (Cyrillic works), the longest name wins, and nothing inside wikilinks/embeds, markdown links, inline code, code fences, frontmatter, URLs or #tags. Notes that already link to the target (by path, stem, title or alias, embeds included) are left out, as are names under 3 characters and aliases that are another note's real name. "Link" rewrites one occurrence into [[Target]] or [[Target|as written]] via `mention_link`, which re-reads the file and refuses when the occurrence is no longer at that line/column with the same text; "Link all" does a whole note. Both update the FTS index; the panel flushes the source's autosave first and reloads it after, and `reloadNote` now bumps `vaultVersion` even for an uncached note so backlinks refresh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VeZRNKkbb6GoBgqmhLyqN8
A force-directed view of the active note's neighbourhood: notes reached over wikilinks in either direction, 1–3 hops out (default 1), tags as optional leaves. Available as a compact "Graph" tab in the right panel that follows the active note, and large via the palette command "Open local graph" (`graph.local`, palette-only: Mod+Shift+G is the editor's find-previous). Clicking a note node opens it and the graph re-centres; clicking a tag opens tag search. Depth and the tag toggle persist. Backend: `graph_local` slices the global `build_graph` output with a pure BFS (`local_subgraph`), so a link appears here exactly when the global graph draws it — paths, stems, titles and aliases resolve the same way. Edges between two neighbours are kept so clusters stay visible. Frontend: the payload is shaped by pure helpers in `lib/local-graph.ts` (centre pinned at the origin, radius by depth, a↔b merged into one line, view-box fit) and rendered by a small d3-force SVG in `components/graph/LocalGraph.tsx`, separate from the full-screen GraphView. `isNotePath` moves into `lib/note-name.ts`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VeZRNKkbb6GoBgqmhLyqN8
|
|
Resolve against #65/#67: full-text search now lives in the ⌘K box, so its overlay state is gone from the UI store and App.tsx; keep the local graph overlay state next to the new focus-mode flag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VeZRNKkbb6GoBgqmhLyqN8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
These are the last two items of roadmap phase 2 ("Obsidian habits") that #63 didn't cover: unlinked mentions and a local graph.
What
1. Unlinked mentions (
feat(backlinks))MATCH. At most 500 candidates are taken.core/mentions.rs, pure functions) on the actual file text:C++work, and the longest overlapping name wins.#tags.mention_linkre-reads the file and refuses if the occurrence isn't still at that line and column with the same text. It writes[[Target]], or[[Target|as written]]when the text differs from the link name.mention_link_alllinks every mention in one source note.reloadNote.reloadNotenow bumpsvaultVersioneven for notes that aren't open, so backlinks refresh after a write into a closed note.2. Local graph (
feat(graph))graph_local(path, depth 1–3, includeTags)builds the same graph as the global view, then runs a pure BFS (local_subgraph) over link edges in both directions. Links between neighbours are kept, and tags are end points only.LocalGraph.tsx) in a new right-panel Graph tab. It follows the active note and has a depth picker and a tags toggle, both persisted.Docs
The README has entries for both features, and
docs/roadmap.mdphase 2 marks them ✅.Limitations
Tests
core/mentions.rs, 7 end-to-end incommands/mentions.rs(tempfile plus an in-memory FTS index, including stale-occurrence refusal and path safety), 2 for FTS phrase queries and 6 forgraph.rslocal subgraphs. 349 in total.local-graph.test.ts(8),note-name.test.ts(3) and one newvault.reloadcase. 157 in total.Checks (rebased on current
main, including #64)npm run lint: 0 errors (5 pre-existing warnings)npm run build: oknpm test: 157 passedcargo fmt --check: okcargo clippy -D warnings: okcargo test: 349 passedNot exercised in a live app: there is no display in the container. The right-panel layout (four tabs now) and the Link / Link all buttons are worth clicking through.
🤖 Generated with Claude Code
https://claude.ai/code/session_01VeZRNKkbb6GoBgqmhLyqN8
Generated by Claude Code