Function: cider-browse-ns--render-header

cider-browse-ns--render-header is a byte-compiled function defined in cider-browse-ns.el.

Signature

(cider-browse-ns--render-header &optional FILTERED-ITEMS-CT)

Documentation

Render the section at the top of the buffer displaying visibility controls.

If FILTERED-ITEMS-CT is non-nil, then display a message of how many items are being filtered.

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260414.1619/cider-browse-ns.el
(defun cider-browse-ns--render-header (&optional filtered-items-ct)
  "Render the section at the top of the buffer displaying visibility controls.

If FILTERED-ITEMS-CT is non-nil, then display a message of how many items
are being filtered."
  ;; Display Show line
  (insert "  Show: ")
  (insert-text-button "All"
                      'follow-link t
                      'action #'cider-browse-ns--toggle-all
                      ;; 'help-echo (cider-stacktrace-tooltip)
                      'face (if cider-browse-ns-show-all
                                'cider-stacktrace-filter-active-face
                              nil))
  (insert "\n")
  ;; Display Filters
  (let ((filters '(("Private" private)
                   ("Test" test)
                   ("Macro" macro)
                   ("Function" function)
                   ("Var" var))))
    (insert "  Hide: ")
    (dolist (filter filters)
      (seq-let (title key) filter
        (let ((is-active (memq key cider-browse-ns-filters)))
          (insert-text-button title
                              'filter key
                              'follow-link t
                              'action #'cider-browse-ns--button-filter
                              ;; 'help-echo (cider-stacktrace-tooltip)
                              'face (if (and is-active (not cider-browse-ns-show-all))
                                        'cider-stacktrace-filter-active-face
                                      nil))
          (insert " "))))
    (when filtered-items-ct
      (insert (format "(%d items filtered)" filtered-items-ct))))
  (insert "\n")
  ;; Groupings
  (insert "  Group-by: ")
  (let ((groupings '(("Type" type)
                     ("Visibility" visibility))))
    (dolist (grouping groupings)
      (seq-let (title key) grouping
        (let ((is-active (eql key cider-browse-ns-group-by)))
          (insert-text-button title
                              'group-by key
                              'follow-link t
                              'action #'cider-browse-ns--button-group
                              ;; 'help-echo ()
                              'face (if is-active
                                        'cider-stacktrace-filter-active-face
                                      nil)))
        (insert " "))))
  (insert "\n\n"))