ellie tree: RET expands/collapses sessions too, fix indent

This commit is contained in:
Ollie Agent 2026-08-04 20:35:25 +02:00
parent 0c35567de0
commit 54bc11ae6d
1 changed files with 4 additions and 9 deletions

View File

@ -403,7 +403,7 @@ Prompts for agent profile and other options."
(dolist (a agents)
(let ((aname (car a)) (aid (nth 1 a)) (state (nth 2 a)))
(push (list 'agent id aid
(format " %s [%s]" aname state))
(format " %s [%s]" aname state))
result)))))))
;; Inactive header
(when inactive
@ -418,7 +418,7 @@ Prompts for agent profile and other options."
(dolist (a agents)
(let ((aname (car a)) (aid (nth 1 a)) (state (nth 2 a)))
(push (list 'agent id aid
(format " %s [%s]" aname state))
(format " %s [%s]" aname state))
result))))))))
(setq ellie--tree-data (nreverse result))))
@ -472,19 +472,14 @@ Prompts for agent profile and other options."
(ellie--tree-render))))
(defun ellie-tree-activate ()
"Activate (select) the item at point."
"Activate (select) or expand/collapse the item at point."
(interactive)
(let ((key (get-text-property (point) 'ellie-key))
(type (get-text-property (point) 'ellie-type))
(parent (get-text-property (point) 'ellie-parent)))
(cond
((eq type 'header)
((memq type '(header session))
(ellie-tree-toggle))
((eq type 'session)
(setq ellie--session-id key
ellie--agent-id nil)
(ellie--persist-session key)
(message "Session: %s" key))
((eq type 'agent)
(setq ellie--session-id parent
ellie--agent-id key)