diff options
| author | eunhhu <[email protected]> | 2026-09-25 15:24:05 +0100 |
|---|---|---|
| committer | eunhhu <[email protected]> | 2026-09-25 15:24:05 +0100 |
| commit | 12c377ea70c8928f96d02d0885744bd6818c10c6 (patch) | |
| tree | e2ba24cb2cd61394ff84f605daa54d8c8e36a0d1 /lib/vega.aup | |
| parent | d9dbe8a1dbdd30f3e336dc1445d852ede3de3930 (diff) | |
| download | vega-12c377ea70c8928f96d02d0885744bd6818c10c6.tar.gz vega-12c377ea70c8928f96d02d0885744bd6818c10c6.zip | |
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, <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.
Diffstat (limited to 'lib/vega.aup')
| -rw-r--r-- | lib/vega.aup | 15 |
1 files changed, 15 insertions, 0 deletions
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 } |
