From 3a0323e91d9e720e3802c9bf864f0ac6f57c6e1f Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Wed, 24 Jul 2024 14:23:17 +0300 Subject: dashboard: Rewrite & add transient. * Rewrite gnosis-dashboard as to be an actual dashboard. * Add transient for interactions. --- gnosis-dashboard.el | 12 +++++++++--- 1 file 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 -- cgit v1.2.3