From efe199b4635742dea1d4162f6c47c55edbd6667a Mon Sep 17 00:00:00 2001 From: Gamosoft Date: Tue, 24 Mar 2026 12:02:34 +0100 Subject: [PATCH] added UI pane for backlinks! --- frontend/app.js | 19 +++++++++- frontend/index.html | 92 ++++++++++++++++++++++++++++++++++++++++++++- locales/de-DE.json | 8 ++++ locales/en-GB.json | 8 ++++ locales/en-US.json | 8 ++++ locales/es-ES.json | 8 ++++ locales/fr-FR.json | 8 ++++ locales/hu-HU.json | 8 ++++ locales/it-IT.json | 8 ++++ locales/ja-JP.json | 8 ++++ locales/ru-RU.json | 8 ++++ locales/sl-SI.json | 8 ++++ locales/zh-CN.json | 10 ++++- 13 files changed, 197 insertions(+), 4 deletions(-) diff --git a/frontend/app.js b/frontend/app.js index 354e0c0..013ddfe 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -236,7 +236,10 @@ function noteApp() { // Outline (TOC) state outline: [], // [{level: 1, text: 'Heading', slug: 'heading'}, ...] - + + // Backlinks state + backlinks: [], // [{path: 'note.md', name: 'Note', references: [{line_number: 5, context: '...', type: 'wikilink'}]}] + // Scroll sync state isScrolling: false, @@ -524,6 +527,7 @@ function noteApp() { this.noteContent = ''; this.currentNoteName = ''; this.outline = []; + this.backlinks = []; this.shareInfo = null; // Reset share info document.title = this.appName; @@ -1315,6 +1319,7 @@ function noteApp() { extractOutline(content) { if (!content) { this.outline = []; + this.backlinks = []; return; } @@ -1429,6 +1434,11 @@ function noteApp() { } } }, + + // Navigate to a backlink (note that links to current note) + navigateToBacklink(backlinkPath) { + this.loadNote(backlinkPath); + }, // Unified filtering logic combining tags and text search async applyFilters() { @@ -2750,7 +2760,10 @@ function noteApp() { // Extract outline for TOC panel this.extractOutline(data.content); - + + // Store backlinks from API response + this.backlinks = data.backlinks || []; + // Initialize undo/redo history for this note (with cursor at start) this.undoHistory = [{ content: data.content, cursorPos: 0 }]; this.redoHistory = []; @@ -5625,6 +5638,7 @@ function noteApp() { this.noteContent = ''; this.currentMedia = ''; this.outline = []; + this.backlinks = []; document.title = this.appName; // Invalidate cache to force recalculation @@ -5647,6 +5661,7 @@ function noteApp() { this.noteContent = ''; this.currentMedia = ''; this.outline = []; + this.backlinks = []; this.mobileSidebarOpen = false; document.title = this.appName; diff --git a/frontend/index.html b/frontend/index.html index 7d862f3..f9209f5 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -1453,6 +1453,28 @@ x-text="outline.length > 9 ? '9+' : outline.length" > + + +
@@ -1847,7 +1869,75 @@ - + + +
+ +
+ + +
+ + +
+
+ + + + + + +
+
+
+ +