branch: elpa/gnosis
commit f5032a52d61d8d522084b1df4ce29cd759505e1c
Author: Thanos Apollo <[email protected]>
Commit: Thanos Apollo <[email protected]>

    dashboard: Show themata with orphaned links.
---
 gnosis-dashboard.el | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/gnosis-dashboard.el b/gnosis-dashboard.el
index ed54fb9926..8697c0f3c2 100644
--- a/gnosis-dashboard.el
+++ b/gnosis-dashboard.el
@@ -739,6 +739,18 @@ DASHBOARD-TYPE: either Themata or Decks to display the 
respective dashboard."
                                 (gnosis-dashboard-nodes-show-isolated)))
     ("q" "Back" transient-quit-one)]])
 
+(defun gnosis-dashboard-themata-show-orphaned ()
+  "Show themata with orphaned links (referencing deleted org-gnosis nodes)."
+  (interactive)
+  (let* ((orphaned-rows (gnosis--orphaned-links))
+         (thema-ids (when orphaned-rows
+                      (cl-remove-duplicates (mapcar #'car orphaned-rows)))))
+    (if thema-ids
+        (progn
+          (setq gnosis-dashboard-themata-history nil)
+          (gnosis-dashboard-output-themata thema-ids))
+      (message "No themata with orphaned links"))))
+
 (transient-define-prefix gnosis-dashboard-menu-themata ()
   "Transient menu for themata operations."
   [["Themata"
@@ -750,6 +762,7 @@ DASHBOARD-TYPE: either Themata or Decks to display the 
respective dashboard."
                           (gnosis-dashboard-output-decks)))
     ("T" "View by tags" (lambda () (interactive)
                          (gnosis-dashboard-output-tags)))
+    ("o" "Show orphaned" gnosis-dashboard-themata-show-orphaned)
     ("q" "Back" transient-quit-one)]])
 
 (transient-define-prefix gnosis-dashboard-menu-actions ()
@@ -771,6 +784,7 @@ DASHBOARD-TYPE: either Themata or Decks to display the 
respective dashboard."
    ["Quick Access"
     ("r" "Review" gnosis-review)
     ("h" "History" gnosis-dashboard-history)
+    ("l" "Link health" gnosis-links-check)
     ("q" "Quit" quit-window)]])
 
 ;;;###autoload

Reply via email to