From 12c377ea70c8928f96d02d0885744bd6818c10c6 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Fri, 25 Sep 2026 15:24:05 +0100 Subject: Add the first component and three surfaces Vega reads a verified Pure module by convention: a table view with a label column is a list (with optional badge, detail and tone), any other table is a table, _focus is its focused row, a title view is the title and other views are fields. lib/vega.aup gives aup apps the tones, which say what a row means; each surface decides how it looks or sounds. vega tui draws the screen in a terminal, keeps the focused row in view and evaluates only the cells on screen; vega cli prints plain lines for pipes; vega say speaks the screen and each focus change as sentences. Display width handles Hangul, CJK, emoji, combining marks and controls. tests/check.py compares the CLI and NUI output with a reference model of examples/todo.aup line for line, checks 9,600 TUI frames for scrolling, focus, badge alignment and the number of cells evaluated, drives the interactive TUI on a pseudo-terminal, and runs every aup example on every surface. --- lib/vega.aup | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 lib/vega.aup (limited to 'lib') diff --git a/lib/vega.aup b/lib/vega.aup new file mode 100644 index 0000000..8e5b780 --- /dev/null +++ b/lib/vega.aup @@ -0,0 +1,15 @@ +# Vega for aup apps: `use vega` (AUP_PATH=.../vega/lib). +# +# A tone says what a value means, not how it looks. Each surface decides: +# a terminal may dim muted rows and color danger red, a screen reader may +# say "danger" before an item. Use them in a `tone` column of a list or +# table view (docs/design/001-first-component.md). +fn normal = 0 +fn muted = 1 +fn accent = 2 +fn good = 3 +fn warning = 4 +fn danger = 5 + +# A tone only when a condition holds: vega.when(task.done, vega.muted). +fn when(condition, tone) = if condition { tone } else { normal } -- cgit v1.2.3