summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-07-24 14:23:17 +0300
committerThanos Apollo <[email protected]>2024-07-24 14:23:17 +0300
commit3a0323e91d9e720e3802c9bf864f0ac6f57c6e1f (patch)
treecadf96fa54b19f2565afb87ec0dca860064afd5e
parent90294708f33a3ef08f67f43ed0d8cc7950dea07a (diff)
dashboard: Rewrite & add transient.
* Rewrite gnosis-dashboard as to be an actual dashboard. * Add transient for interactions.
-rw-r--r--gnosis-dashboard.el12
1 files changed, 9 insertions, 3 deletions
diff --git a/gnosis-dashboard.el b/gnosis-dashboard.el
index d0bb93c..96d4ffe 100644
--- a/gnosis-dashboard.el
+++ b/gnosis-dashboard.el
@@ -161,7 +161,7 @@ Optionally, use when using multiple months."
(cl-incf month))))
;; TODO: Create a dashboard utilizing widgets
-(defun gnosis-dashboard-test ()
+(defun gnosis-dashboard ()
"Test function to create an editable field and a search button."
(interactive)
(let ((buffer-name "*Gnosis Dashboard*"))
@@ -200,7 +200,8 @@ Optionally, use when using multiple months."
(use-local-map widget-keymap)
(widget-setup))
(pop-to-buffer-same-window buffer)
- (goto-char (point-min)))))
+ (goto-char (point-min))
+ (gnosis-dashboard-transient))))
(defun gnosis-dashboard-output-note (id)
"Output contents for note with ID, formatted for gnosis dashboard."
@@ -324,7 +325,7 @@ DASHBOARD: Dashboard to return to after editing."
tabulated-list-sort-key nil))
;;;###autoload
-(cl-defun gnosis-dashboard (&optional dashboard-type (note-ids nil))
+(cl-defun gnosis--dashboard (&optional dashboard-type (note-ids nil))
"Display gnosis dashboard.
NOTE-IDS: List of note ids to display on dashboard. When nil, prompt
@@ -349,5 +350,10 @@ DASHBOARD-TYPE: either 'Notes' or 'Decks' to display the respective dashboard."
(tabulated-list-print t)))
+(transient-define-prefix gnosis-dashboard-transient ()
+ "Transient buffer for gnosis dashboard interactions."
+ [["Actions" ("r" "Start Review" gnosis-review)]
+ ["Dashboard" ("d" "Dashboard" gnosis--dashboard)]])
+
(provide 'gnosis-dashboard)
;;; gnosis-dashboard.el ends here