Skip to content

0.4.0

Choose a tag to compare

@github-actions github-actions released this 30 Jan 12:44
· 37 commits to master since this release

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

  1. BFS traversal now discovers both forward links AND backlinks at each depth level
  2. Forward links → full note content (existing behavior)
  3. Backlinks → header section containing the link reference
  4. If a note appears as both forward and backlink, forward link takes priority (full content)
  5. 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 - Added isBacklink, backlinkSnippet fields
  • src/types/settings.ts - Added includeBacklinks, backlinkContextLines defaults
  • src/services/distill-service.ts - Added getBacklinksForFile(), getBacklinkSnippets(), extractContextAroundLine()
  • src/services/context-gathering-service.ts - Modified BFS for bidirectional traversal, public aggregateContent()
  • src/ui/context-gathering-modal.ts - Added toggle and slider
  • src/ui/context-selection-modal.ts - Added backlink badge
  • src/ui/settings-tab.ts - Added default settings
  • src/main.ts - Fixed aggregation to use context-gathering-service, deep merge for settings
  • docs/CODEBASE_MAP.md - Updated documentation
  • README.md - Added usage guide