Fix multi-line system messages; add message height logging
ober
ce9d86f98781efc9639588d08353f3ed8966a860
--- a/src/jcode/ui/tui-message.ss +++ b/src/jcode/ui/tui-message.ss @@ -139,7 +139,8 @@ (list (list (cons (string-append "Error: " content) 'error)))) (def (render-system-content content) - (list (list (cons content 'dim)))) + (map (lambda (line) (list (cons line 'dim))) + (string-split content #\newline))) (def (tool-summary tool-name metadata) (cond --- a/src/jcode/ui/tui.ss +++ b/src/jcode/ui/tui.ss @@ -560,6 +560,9 @@ (def (add-message! state msg) (reflow-message! msg (msg-area-width state)) + (tui-log "add-message: role=~a height=~a lines=~a width=~a" + (msg-block-role msg) (msg-block-height msg) + (length (msg-block-lines msg)) (msg-area-width state)) (app-state-messages-set! state (append (app-state-messages state) (list msg))))