0.4.0
Bidirectional Link Traversal: Backlink Context Extraction
Adds the ability to gather context from notes that link TO discovered notes, not just notes linked FROM them.
What's New
"Include backlinks" toggle in context gathering modal (enabled by default)
- Discovers notes that link TO your discovered notes
- Extracts only the header section containing the link reference (not the full note)
- Visual indicator: "← backlink" badge in note selection modal
Output formatting
- Forward links:
# Note: filename(full content) - Backlinks:
# Backlink: filename(header section snippet)
How It Works
- BFS traversal now discovers both forward links AND backlinks at each depth level
- Forward links → full note content (existing behavior)
- Backlinks → header section containing the link reference
- If a note appears as both forward and backlink, forward link takes priority (full content)
- Duplicate snippets are deduplicated (multiple links in same section = one snippet)
Settings
- Include backlinks by default: On (Settings → Context Gathering)
- Backlink context: 0 = header section (default), 1-5 = N lines before/after
Files Changed
src/types/context.ts- AddedisBacklink,backlinkSnippetfieldssrc/types/settings.ts- AddedincludeBacklinks,backlinkContextLinesdefaultssrc/services/distill-service.ts- AddedgetBacklinksForFile(),getBacklinkSnippets(),extractContextAroundLine()src/services/context-gathering-service.ts- Modified BFS for bidirectional traversal, publicaggregateContent()src/ui/context-gathering-modal.ts- Added toggle and slidersrc/ui/context-selection-modal.ts- Added backlink badgesrc/ui/settings-tab.ts- Added default settingssrc/main.ts- Fixed aggregation to use context-gathering-service, deep merge for settingsdocs/CODEBASE_MAP.md- Updated documentationREADME.md- Added usage guide