diff --git a/harness/tui-client.org b/harness/tui-client.org index 5c1d2dd..c72d1f2 100644 --- a/harness/tui-client.org +++ b/harness/tui-client.org @@ -1,4 +1,3 @@ -#+PROPERTY: header-args:lisp :tangle tui-client.lisp #+TITLE: OpenCortex TUI Client (Standalone) #+STARTUP: content #+FILETAGS: :tui:ux:client: @@ -8,7 +7,7 @@ The OpenCortex TUI Client is a standalone Common Lisp application built on **Croatoan**. * Test Suite -#+begin_src lisp :tangle tui-client.lisp +#+begin_src lisp :tangle tests/tui-tests.lisp (defpackage :opencortex-tui-tests (:use :cl :opencortex) (:export #:tui-suite)) @@ -16,9 +15,9 @@ The OpenCortex TUI Client is a standalone Common Lisp application built on **Cro (in-package :opencortex-tui-tests) (eval-when (:compile-toplevel :load-toplevel :execute) - (ql:quickload :fiveam)) + (ql:quickload :fiveam :silent t)) -(fiveam:def-suite tui-suite :description "Verification of the TUI parsing and styling logic +(fiveam:def-suite tui-suite :description "Verification of the TUI parsing and styling logic") (fiveam:in-suite tui-suite) (fiveam:test test-tui-connection-drop @@ -46,7 +45,7 @@ The OpenCortex TUI Client is a standalone Common Lisp application built on **Cro ** Global State #+begin_src lisp -(defvar *daemon-host* "127.0.0.1 +(defvar *daemon-host* "127.0.0.1") (defvar *daemon-port* 9105) (defvar *socket* nil) (defvar *stream* nil) @@ -86,7 +85,7 @@ The OpenCortex TUI Client is a standalone Common Lisp application built on **Cro (defun render-chat (win) (clear win) (let* ((h (height win)) - (view-height (- h 2)) + (view-height (max 0 (- h 2))) (history-len (length *chat-history*)) (start-idx *scroll-index*) (end-idx (min history-len (+ start-idx view-height))) @@ -116,10 +115,10 @@ The OpenCortex TUI Client is a standalone Common Lisp application built on **Cro (finish-output stream)) (error (c) (declare (ignore c)) - (enqueue-msg "ERROR: Connection to daemon lost. + (enqueue-msg "ERROR: Connection to daemon lost.") (setf *is-running* nil)))) - (when (string= cmd "/exit (setf *is-running* nil)) - (when (string= cmd "/clear (setf *chat-history* nil)))) + (when (string= cmd "/exit") (setf *is-running* nil)) + (when (string= cmd "/clear") (setf *chat-history* nil)))) #+end_src ** Main Entry Point