fix: constrain separator/input/status to chat area when sidebar visible

Added chat-w = w - sidebar_width calculation in view-status and
view-input, matching view-chat's existing approach. Also added
chat-w for the separator line drawing in tui-main. This prevents
the prompt, separator, hint, and status bar from extending into
the sidebar area when it's visible.
This commit is contained in:
2026-05-14 15:44:17 -04:00
parent 345f3f397d
commit 2ce8d9d886
2 changed files with 22 additions and 16 deletions

View File

@@ -1022,16 +1022,19 @@ Event handlers + daemon I/O + main loop.
(setq w (or (and (numberp w) (> w 0) w) 80)
h (or (and (numberp h) (> h 0) h) 24))
(when (or (first (st :dirty)) (second (st :dirty)) (third (st :dirty)))
(cl-tty.backend:backend-clear be)
(view-status be w h)
(view-chat be w h)
;; Draw separator line above input
(cl-tty.backend:draw-text be 0 (- h 4) (make-string w :initial-element #\─)
(theme-color :separator) nil)
(view-input be w h)
(when (and (st :sidebar-visible) (>= w 60))
(view-sidebar be w h))
(setf (st :dirty) (list nil nil nil)))
(let* ((sidebar-w (if (and (st :sidebar-visible) (>= w 60))
(or (st :sidebar-width) 30) 0))
(chat-w (- w sidebar-w)))
(cl-tty.backend:backend-clear be)
(view-status be w h)
(view-chat be w h)
;; Draw separator line above input
(cl-tty.backend:draw-text be 0 (- h 4) (make-string chat-w :initial-element #\─)
(theme-color :separator) nil)
(view-input be w h)
(when (and (st :sidebar-visible) (>= w 60))
(view-sidebar be w h))
(setf (st :dirty) (list nil nil nil))))
(let ((ds (st :dialog-stack)))
(when ds
(let* ((dlg (car ds))