Smart graph: option to show tags as nodes - #473
Merged
Conversation
A new Scope toggle, "Tags", draws each tag as a node linked to every note carrying it — the same picture as Obsidian's own graph with its Tags filter on. Tag nodes take the theme's --graph-node-tag colour, size by note count, open a tag: search on click, and get a matching context-menu entry. Tags are a display layer over the note graph: their edges are typed "tag", excluded from topic detection and the semantic scan, and left out of the topology signature, so toggling them never invalidates the cached partitions, hierarchy or edges. They pass through topic collapsing untouched, are never folded into the Unsorted bubble, and hand no paths to chat selection. The live vault patch diffs tag edges alongside wiki edges so an unchanged tag layer is still a no-op. The tag-search helper moves out of MarkdownRenderer into utils/tagSearch.ts so the chat and the graph share it.
GraphCanvas pre-splits links by drawable type before each frame and the list only knew wiki and semantic, so tag edges were built, laid out and counted but never drawn — and hovering a tag node highlighted nothing.
Leo310
added a commit
that referenced
this pull request
Sep 11, 2026
Contributor
Greptile SummaryThis PR adds an optional smart-graph display layer that represents tags as themed nodes connected to their notes.
Confidence Score: 5/5The PR appears safe to merge; no actionable new defect remains, and the previously reported topic-representative issue is fully fixed. Tag edges now contribute degree only to tag nodes across full builds, semantic fusion, and live patches, so enabling tags no longer changes note degree or topic representatives. The remaining display-layer boundaries are consistently maintained. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
V[Filtered vault notes] --> W[Wiki edges]
V --> S[Semantic edges]
V --> G[Tag display layer]
W --> T[Topic detection]
S --> T
W --> R[Graph rendering]
S --> R
G --> R
G -. excluded .-> T
G -. excluded .-> C[Semantic scan and chat paths]
Reviews (2): Last reviewed commit: "Smart graph: tag edges count toward tag ..." | Re-trigger Greptile |
Note degree breaks ties for a topic's representative, which anchors the topic's fallback label, colour and the titles sent for naming. Letting tag edges inflate it meant the display-only Tags toggle could re-label topics whose membership hadn't changed. One shared computeNodeDegrees now serves the full build, the fused recompute and the live patch: a tag edge counts for its tag (how many notes carry it) and not for the note.
Leo310
added a commit
that referenced
this pull request
Sep 11, 2026
Tags join the smart graph: a Scope → Tags toggle draws each tag as a node linked to the notes that carry it (#473), tag edges feed topic detection damped by tag breadth so status tags can't swallow a vault (#474), and a topic's own tags are drawn inside its region (#476). The Inferred links controls are disabled when no graph embedding index is selected, and changing the index selection now rebuilds the graph (#475). minAppVersion unchanged at 1.11.4. Nothing touched PROVIDER_TEMPLATES, src/skills/defaults/, BUILT_IN_TOOL_IDS or CURATED_PLUGIN_INTEGRATIONS, so the site's enumerable facts need no refresh.
Leo310
added a commit
to s2b-dev/site
that referenced
this pull request
Sep 11, 2026
Plugin 2.1.0 added a Scope → Tags toggle (s2b-dev/smart-second-brain#473, #474, #476). The overview documents the control under Scope, tag nodes under What's drawn, and a Tags shape topics section under Topics. The how-it-works page now lists three edge kinds and the topic-detection weights (1 + log2 links, 1/√breadth for tags, 0.7 × cosine), plus the half-of-its-notes bar for a tag to count as a topic's own.
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.
Resolves #288.
What
A new Scope → Tags toggle in the smart graph draws each tag as a node linked to every note that carries it, matching Obsidian's native graph with its Tags filter on.
--graph-node-tagcolour, size by how many notes carry them, and show "N notes" in the tooltip.tag:#…, the same as clicking a tag in a note. The tag-search helper moved fromMarkdownRenderer.sveltetoutils/tagSearch.tsso chat and graph share it.Design: tags are a display layer
Tag nodes pull their notes together in the layout, but they never feed topic detection or the semantic scan:
"tag"EdgeType;getTopicEdgesand the isolated/bridge heuristics only read wiki/semantic edges, so topics are unchanged.graphTopologySignatureignores the tag layer, so flipping the toggle is a rebuild that hits every cache (partitions, hierarchy, ladder, semantic edges) instead of re-running Leiden.buildCollapsedGraphpasses tag nodes through untouched (never folded into Unsorted, kind preserved), tag edges are re-pointed to topic bubbles but not counted as crossing links, andresolveNodePathshands chat no path for a tag.applyWikiPatchdiffs tag edges alongside wiki edges, so an unchanged tag layer stays a no-op and tag nodes never surface as added/removed/touched note paths.computeNodeDegrees, shared by the build, the fused recompute and the live patch). Note degree is the tie-breaker for topic representatives, so it stays exactly what it is without tags.Verification
bun run check,format,lint, and the full unit suite (1662 tests) pass; new tests cover the builder, live patch, collapse and signature behaviour.(Screenshot lives on the orphan branch
assets/pr-graph-tag-nodes; delete it after merge.)AI assistance: written with AI coding agents from the maintainer's brief; reviewed and tested by the maintainer.