makeover-tui
The terminal renderer for
makeover-layout, on ratatui.
Named for the target and not for the library, the same way makeover-immediate
is named for the mode and not for egui.
What is here
frameandpaint_bevel: a described surface's depth, drawn in cells.table: columns, narrowing, cell parts and the sort caret, over ratatui's ownTable. Narrowing ismakeover_layout::cutoff_forwith the unit filled in, so every renderer drops a column at the same declared width.piece: a meter, a badge or chip, a control, a figure, facts, a form field, a chart and the wait marks.text: a word wrap whose height and drawing come from one measurement.theme(featuretheme): a loaded makeover theme resolved into ratatui colours and quantised for the terminal's colour depth.
Colours and marks
Every colour is in the Palette: the surfaces and bevel pair a frame needs, and
the Tones text and tables are drawn in. PieceStyle and TableStyle carry
metrics and marks only (cell counts, glyphs, the focus modifier). piece::Ink
and table::TableInk are the two resolved together, once per frame, and every
drawing takes one.
A tone the palette leaves empty is drawn in the terminal's own ink and said with
a modifier instead: muted text is dim, danger is bold, a link is underlined, the
cursor row is reversed. Tones::NONE is a terminal with no colour to spend, and
it still separates every role the drawings use.
With a theme:
let theme = from_theme?.for_terminal;
let palette = theme.palette;
let ink = new;
let tables = new;
What a terminal costs
Geometry, not colour. An edge occupies a whole cell per side, and a cell is
roughly 8x17 pixels, so a one-pixel bevel becomes an order of magnitude heavier.
frame returns a shrunk Rect rather than pretending the region survived.
There is nowhere to put a corner radius, and a fill begins and ends on a cell
boundary.
Colour matters only at sixteen colours. There a well cannot be filled
distinctly and a bevel loses an edge, so frame carries depth with glyphs: a
doubled frame for a raised surface, a light one for a well. Above sixteen
colours that fallback never fires.
Fidelity::detect() reads COLORTERM then TERM and is deliberately
credulous: an unrecognised terminal is assumed capable, and only the named
fixed consoles get sixteen colours.
Palette::shows is a correctness check that a fill will be visible against
what is behind it, at any depth.
Substitution is renderer policy
Substituting one intent for another belongs to a renderer, never to the
description. Falling back from Fill::Well to Page is wrong here, because the
page is usually the surface a well is cut into, so the substitution produces
the invisibility it was meant to prevent.
Design and work
Design lives in the wiki note makeover-tui; work is tracked in GoingsOn under
the makeover project.
Licence
MIT.