Function: eca-workspaces--chat-segment

eca-workspaces--chat-segment is a natively compiled function defined in eca-workspaces.el.

Signature

(eca-workspaces--chat-segment SEGMENT CHAT-BUFFER STATUS)

Documentation

Return the string of SEGMENT for CHAT-BUFFER with STATUS.

Source Code

;; Defined in /nix/store/jklqzw6pzz6j4jrbv8wy0iwgi7jlrbld-emacs-packages-deps/share/emacs/site-lisp/elpa/eca-20260928.1827/eca-workspaces.el
(defun eca-workspaces--chat-segment (segment chat-buffer status)
  "Return the string of SEGMENT for CHAT-BUFFER with STATUS."
  (with-current-buffer chat-buffer
    (pcase segment
      ('status (eca-workspaces--chat-status-glyph status))
      ('title
       (eca-buttonize
        nil
        (propertize (substring-no-properties (eca-chat-title))
                    'face (if (eq status 'running)
                              'eca-workspaces-tree-chat-loading-face
                            'eca-workspaces-tree-chat-idle-face))
        (lambda () (eca-workspaces--open-chat chat-buffer))))
      ('elapsed
       (if-let* ((elapsed (eca-chat-elapsed-str chat-buffer)))
           (propertize (concat "⏱ " elapsed)
                       'face 'eca-chat-elapsed-time-face)
         ""))
      ('cost
       (if eca-chat--session-cost
           (propertize (concat "$" eca-chat--session-cost)
                       'face 'eca-chat-usage-string-face)
         ""))
      ('model
       (propertize (eca-workspaces--chat-model-str)
                   'face 'eca-workspaces-tree-chat-details-face))
      ('hint (or (eca-workspaces--chat-hint status) ""))
      (_ (if (functionp segment)
             (or (funcall segment chat-buffer) "")
           "")))))