thing-tui: paint Cells frames to a terminal screen (cut 8a) #24

Merged
eureka merged 23 commits from hands/thing2-tui-paint into main 2026-11-28 19:39:00 +00:00

2026-11-28

Meta Vens
thing-core: a Cells control is Bordered only when its laid content row fits inside the border
All checks were successful
Portable Eve contracts and browser lowering / ubuntu-latest eve-browser-lowering (pull_request) Successful in 3m33s
Portable Eve contracts and browser lowering / ubuntu-latest eve-contracts (pull_request) Successful in 2m29s
Device::form(h, row) replaces form(h): Bordered needs 3 rows and row + 2 edge rows <= h. A Compact
control's content is clipped to its rect by render. A content node with children keeps at least its
children's height, so the row the form reads is the content's own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 20:12:51 +01:00
Meta Vens
thing-core: a Cells control's form is read off its laid rect in one solve, through a grid shell
Deletes the re-solve loop, mark_too_short, the compact marks and render's Bordered fallback;
Device::form is the one form rule, Builder::shell the one Cells control box.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 19:08:58 +01:00
Meta Vens
thing-core test: pin a compact toggle's glyph row and a Pixels control's content box at scale
cargo-mutants survivors of the control-form cut: the compact toggle's glyph height (a
2-row compact toggle drew a 2-cell knob) and the device-to-logical conversion of the
content box layout states (only scale 1 was tested, where it is the identity).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 17:42:04 +01:00
Meta Vens
thing-core: the Use placeholder and Plot defaults go through the Px metric
Finding literal-defaults-bypass-metric. Device::placeholder and Device::plot stated cell
literals (1, 38x10) beside the one adapter. They now state 16 px and 300x150 px and
convert at Device::length, per axis: a Use placeholder is 2x1 cells and a Plot 38x9
(37.5x9.375 rounded). Re-blessed: screen-f07-plot-cells (the default plot is one row shorter; style runs only, no glyph moves).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 16:18:44 +01:00
Meta Vens
thing tests: f11's Cells nest is a layout assertion; its blank screen golden is dropped
Finding f11-screen-golden-vacuous. f11 is a chain of paintless Boxes, so its Cells
screen golden was whitespace and would have stayed whitespace if layout broke. The nest
is asserted where it is a fact: in Cells every level is the only child of the last,
inside it, and within a cell of its Pixels rect at the metric (the 2 px padding per side
compounds over 84 levels). f11 leaves the screen set with the reason in a comment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 15:51:10 +01:00
Meta Vens
thing-core test: pin margin and min-size axis conversion in Cells
Finding axis-mutants-survive: the margin-bottom and min-height Y-to-X axis swaps
survived the suite. A column of two boxes whose margin and min size state a different
Px length on each side now moves a rect under either swap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 15:49:50 +01:00
Meta Vens
thing-core: a nonzero border side is at least one cell in Cells
Ruling cells-box-border-min-cell. Device::border is the one conversion of a border side:
in Cells a nonzero Px width is at least one cell on its axis, zero stays zero, Pixels is
unchanged. A 20x4 Box with a 1 px border held its content on the stroke's perimeter
cells; the content now starts one cell in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 15:43:08 +01:00
Meta Vens
thing-core: a Cells control declared under 3 rows keeps that height in a compact form, and layout states the form
Ruling cells-control-height-forms. A content-sized Cells control is the 3-row bordered
form; one laid under 3 rows keeps exactly that height as Compact (brackets for
TextInput, Select and Button, the toggle glyph for Toggle; one cell each side, no
vertical inset, content on the first row). Layout finds the form by solving: a bordered
control's padding floors its height at 2 rows, so a control left under 3 rows is built
again compact and solved afresh. LaidNode.inside (None for two things, border inferred
from inner == Some(rect)) is replaced by LaidNode.control: Option<LaidControl { form,
content }>, which render reads and infers nothing from. Pixels controls are Bordered; a
Pixels Button's content box is its border box. No golden moves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-28 15:42:21 +01:00
Meta Vens
thing-core test: pin the half-a-side cap of the control inset
Mutation survivors of Device::inset (`w / 2.0` and `h / 2.0` replaced by a product): a control
narrower than twice its inset keeps the content box inside the border box.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-28 14:14:11 +01:00
Meta Vens
thing-core: the bordered-control inset is one rule, owned by layout
Findings inset-two-owners-and-unpinned-edges and button-multirow-label-on-border. Device::inset
is the one rule for Button, TextInput, Select and Toggle: in Cells one cell on every side once the
box is 3 rows tall, none below (a control too short for a border and a content row paints no
border and its content box is its whole box); in Pixels 2 logical px. Layout reserves it as
padding in Cells, so a content-sized control's box includes its border rows and a wrapped label
never lands on a border, and publishes the laid content box as LaidNode.inside. Render draws in
that box, computes no inset, and strokes a border only when the box is inset. cells_inset and its
public export are gone. The 2-row and exactly-3-row edges are pinned for all four controls in
layout and render. A one-row control is now a 3-row box (27x3 for a TextInput); f01, f02, f04,
f05 and f09 Cells goldens re-blessed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-28 13:01:53 +01:00
Meta Vens
thing-core: a Button's content is a row in Cells as in Pixels
Finding button-content-mode-split. Cells made the Button content a stretch column and
Pixels the default row, so one document laid out differently by mode beyond measuring and the
f01 restart label spanned the whole content box (46 or 48 wide) instead of hugging (7).
The axis is the row in both; a tall Button still centres its label between the borders, now by
alignment (align_items centre) rather than by switching the axis. f01 Cells layout re-blessed:
restart-label 48 -> 7 wide.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-28 12:54:11 +01:00
Meta Vens
thing-core: a Px length in Cells is cells at the 8x16 cell metric, one adapter
Ruling cells-px-metric. Device::length is the one adapter that turns a document's Px length
into device units: times the scale in Pixels, divided by the cell metric (8 across, 16 down)
in Cells, per axis, with Taffy's rounding landing it on a cell. A flex basis runs along its
parent's main axis. CELL_PX is the one constant: the Image extent in CellMeasure reads it
instead of its own 8 and 16. The thing-tui screen goldens run the shared fixtures unedited
(as_cells deleted), so f03, f08, f11 and every other Cells golden are re-blessed from them.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-28 12:47:43 +01:00
Meta Vens
2026-11-28 10:54:00 +01:00
Meta Vens
2026-11-28 10:50:00 +01:00
Meta Vens
2026-11-28 10:47:56 +01:00