ENH make status view show network status in sane way

This commit is contained in:
Nathan Dwarshuis 2022-04-20 20:41:48 -04:00
parent 24770cb0ab
commit c0312a1f28
1 changed files with 59 additions and 8 deletions

View File

@ -3832,22 +3832,57 @@ FUTURE-LIMIT in a list."
(-some->> (plist-get ns-data key) (-some->> (plist-get ns-data key)
(--map (funcall fun it)) (--map (funcall fun it))
(org-x-dag--indent-lines 2) (org-x-dag--indent-lines 2)
(cons (format "%s:" header))))) (cons (format "%s:" header))))
(append-groups
(&rest groups)
(or (->> (-non-nil groups)
(-interpose '(""))
(-flatten-n 1))
'("none"))))
(let ((group (org-x-dag-id->group id))) (let ((group (org-x-dag-id->group id)))
(pcase group (pcase group
(:action (:action
(append (append-groups
(format-group "Planned" (format-group "Planned"
:planned :planned
#'org-x-dag-id->title) #'org-x-dag-id->title)
(format-group "Committed Goals" (format-group "Committed Goals"
:committed :committed
#'org-x-dag--format-title-with-group))) #'org-x-dag--format-title-with-group)))
(:lifetime) (:lifetime
(:endpoint) (append-groups
(:survival) (format-group "Planned"
:planned
#'org-x-dag-id->title)
(format-group "Fulfilled"
:committed
#'org-x-dag--format-title-with-group)))
(:endpoint
(append-groups
(format-group "Planned"
:planned
#'org-x-dag-id->title)
(format-group "Committed"
:committed
(lambda (id)
(org-x-dag-id->path nil id)))
(format-group "Fulfilled"
:fulfilled
(lambda (id)
(org-x-dag-id->path t id)))))
(:survival
(append-groups
;; TODO not sure if this works
(format-group "Planned"
:planned
(lambda (id)
(org-x-dag-id->path t id)))
(format-group "Fulfilled"
:fulfilled
(lambda (id)
(org-x-dag-id->path t id)))))
(:quarterly (:quarterly
(append (append-groups
(format-group "Scheduled actions" (format-group "Scheduled actions"
:scheduled-actions :scheduled-actions
(lambda (id) (lambda (id)
@ -3858,8 +3893,24 @@ FUTURE-LIMIT in a list."
(format-group "Committed Goals" (format-group "Committed Goals"
:committed :committed
#'org-x-dag--format-title-with-group))) #'org-x-dag--format-title-with-group)))
(:weekly) (:weekly
(:daily))))) (append-groups
(format-group "Planned"
:planned
(lambda (id)
(org-x-dag-id->path t id)))
(format-group "Committed"
:committed
#'org-x-dag-id->title)))
(:daily
(append-groups
(format-group "Planned"
:planned
(lambda (id)
(org-x-dag-id->path t id)))
(format-group "Committed"
:committed
#'org-x-dag-id->title)))))))
(defun org-x-dag-show-status () (defun org-x-dag-show-status ()
(interactive) (interactive)