Rename cl-tui -> cl-tty, v0.9.0: Dialog System + Toast

Rename: cl-tty avoids naming collision with Quicklisp's cl-tui (naryl/cl-tui,
a cl-charms-based ncurses library). Our project is pure escape-sequence CL.

v0.9.0 adds:
- Dialog base class: modal overlay with backdrop, centered panel, size
  variants (:small/:medium/:large), stack-based management
- Dialog subclasses: alert, confirm, select-dialog, prompt-dialog
- Toast notifications: transient, top-right corner, auto-dismiss,
  colored variants (info/success/warning/error)
- 78 tests total, 100% passing

ASDF: read-time package references (+fiveam:+) replaced with
find-symbol so .asd loads without FiveAM pre-loaded
This commit is contained in:
Hermes
2026-05-11 19:55:37 +00:00
parent 9648c72b85
commit 811d51a4f2
51 changed files with 930 additions and 229 deletions

View File

@@ -1,4 +1,4 @@
#+TITLE: cl-tui v0.5.0 — Text Input + Keybinding System
#+TITLE: cl-tty v0.5.0 — Text Input + Keybinding System
#+STARTUP: content
* Text Input System
@@ -140,7 +140,7 @@ SBCL's ~sb-posix~ provides the POSIX terminal APIs (~tcgetattr~,
** Tests
#+BEGIN_SRC lisp
(in-package #:cl-tui-input-test)
(in-package #:cl-tty-input-test)
(def-suite input-suite :description "Text input and keybinding tests")
(in-suite input-suite)
@@ -407,16 +407,16 @@ SBCL's ~sb-posix~ provides the POSIX terminal APIs (~tcgetattr~,
** Package
The package uses ~:cl-tui.backend~ for backend protocol (draw-text, etc.),
~:cl-tui.box~ for dirty-mixin and rendering pipeline,
and ~:cl-tui.layout~ for layout-node.
The package uses ~:cl-tty.backend~ for backend protocol (draw-text, etc.),
~:cl-tty.box~ for dirty-mixin and rendering pipeline,
and ~:cl-tty.layout~ for layout-node.
I export everything users of the input system need: key events, mouse events,
terminal raw mode, TextInput, Textarea, and the keybinding system.
#+BEGIN_SRC lisp
(defpackage :cl-tui.input
(:use :cl :cl-tui.backend :cl-tui.box :cl-tui.layout)
(defpackage :cl-tty.input
(:use :cl :cl-tty.backend :cl-tty.box :cl-tty.layout)
(:export
;; Key events
#:key-event #:make-key-event
@@ -463,7 +463,7 @@ this returns ~("")~ (one empty string), which is the correct behavior for
textarea line splitting — a blank document has one empty line.
#+BEGIN_SRC lisp
(in-package #:cl-tui.input)
(in-package #:cl-tty.input)
(defun %split-string (string separator)
"Split STRING at each occurrence of SEPARATOR. Returns list of strings."
@@ -881,7 +881,7 @@ providing real terminal input via our parser. The ~probe-file~ guard
handles the case where stdin is not a terminal (piped input).
#+BEGIN_SRC lisp
(defmethod read-event ((b cl-tui.backend:backend) &key timeout)
(defmethod read-event ((b cl-tty.backend:backend) &key timeout)
(declare (ignore b))
(when (probe-file "/dev/stdin")
(%read-event :timeout timeout)))
@@ -900,7 +900,7 @@ The ~value~ and ~cursor~ slots are directly accessible for testing
without going through the event handler.
#+BEGIN_SRC lisp
(in-package #:cl-tui.input)
(in-package #:cl-tty.input)
(defclass text-input (dirty-mixin)
((value :initform "" :initarg :value :accessor text-input-value :type string)
@@ -1109,7 +1109,7 @@ selection (not yet implemented in the handler). ~on-submit~ fires
on Ctrl+Enter when set.
#+BEGIN_SRC lisp
(in-package #:cl-tui.input)
(in-package #:cl-tty.input)
(defclass textarea (dirty-mixin)
((value :initform "" :initarg :value :accessor textarea-value :type string)
@@ -1445,7 +1445,7 @@ A keymap has a ~name~ for debugging, ~bindings~ as an alist (ordered
for priority), and an optional ~parent~ for inheritance chains.
#+BEGIN_SRC lisp
(in-package #:cl-tui.input)
(in-package #:cl-tty.input)
(defstruct keymap
(name nil :type (or keyword null))
@@ -1568,7 +1568,7 @@ experience; this section is what actually generates the compilable code.
** input.lisp
#+BEGIN_SRC lisp :tangle ../src/components/input.lisp
(in-package #:cl-tui.input)
(in-package #:cl-tty.input)
;;; ---------------------------------------------------------------------------
;;; Utility: split-string (avoids external dependency)
@@ -1871,7 +1871,7 @@ experience; this section is what actually generates the compilable code.
;;; ---------------------------------------------------------------------------
;;; Backend integration
;;; ---------------------------------------------------------------------------
(defmethod read-event ((b cl-tui.backend:backend) &key timeout)
(defmethod read-event ((b cl-tty.backend:backend) &key timeout)
(declare (ignore b))
(when (probe-file "/dev/stdin")
(%read-event :timeout timeout)))
@@ -1880,7 +1880,7 @@ experience; this section is what actually generates the compilable code.
** text-input.lisp
#+BEGIN_SRC lisp :tangle ../src/components/text-input.lisp
(in-package #:cl-tui.input)
(in-package #:cl-tty.input)
;;; ---------------------------------------------------------------------------
;;; TextInput class
@@ -2048,7 +2048,7 @@ experience; this section is what actually generates the compilable code.
** textarea.lisp
#+BEGIN_SRC lisp :tangle ../src/components/textarea.lisp
(in-package #:cl-tui.input)
(in-package #:cl-tty.input)
;;; ---------------------------------------------------------------------------
;;; Utility: split string (local copy for dependency-free operation)
@@ -2311,7 +2311,7 @@ experience; this section is what actually generates the compilable code.
** keybindings.lisp
#+BEGIN_SRC lisp :tangle ../src/components/keybindings.lisp
(in-package #:cl-tui.input)
(in-package #:cl-tty.input)
;;; ---------------------------------------------------------------------------
;;; Key map struct
@@ -2393,8 +2393,8 @@ experience; this section is what actually generates the compilable code.
** input-package.lisp
#+BEGIN_SRC lisp :tangle ../src/components/input-package.lisp
(defpackage :cl-tui.input
(:use :cl :cl-tui.backend :cl-tui.box :cl-tui.layout)
(defpackage :cl-tty.input
(:use :cl :cl-tty.backend :cl-tty.box :cl-tty.layout)
(:export
;; Key events
#:key-event #:make-key-event
@@ -2432,10 +2432,10 @@ experience; this section is what actually generates the compilable code.
** input-tests.lisp
#+BEGIN_SRC lisp :tangle ../tests/input-tests.lisp
(defpackage :cl-tui-input-test
(:use :cl :fiveam :cl-tui.backend :cl-tui.box :cl-tui.layout :cl-tui.input)
(defpackage :cl-tty-input-test
(:use :cl :fiveam :cl-tty.backend :cl-tty.box :cl-tty.layout :cl-tty.input)
(:export #:run-tests))
(in-package :cl-tui-input-test)
(in-package :cl-tty-input-test)
(def-suite input-suite :description "Text input and keybinding tests")
(in-suite input-suite)