Skip to content

tui: the closing pass — the audit's findings, fixed one commit at a time - #406

Merged
shreeve merged 18 commits into
mainfrom
tui/closing
Sep 22, 2026
Merged

shreeve merged 18 commits into
mainfrom
tui/closing

Conversation

@shreeve

@shreeve shreeve commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

After the six steps landed, three read-only audits went over the finished package: one checked 131 claims in README and PLAN against the code (108 held; what failed was prose that outran the code); one built a 98-line text editor and a dashboard from the README alone and found the framework sound, with one real trap and a list of missing idioms; one read the ten files as one codebase and found two hot-path hazards, the clip arithmetic copied into three files, five words with several meanings, and about 90 removable lines.

The first commit wrote every finding into TODO.md; each commit after resolves one and deletes its line. Both audit sections are empty.

Code. A cursor outside what its node inks is hidden, as one a clip hides is — only a value that is no place is refused — and the mouse fuzz now holds the cursor's place to the hit test's cell, which found two disagreements (a contents ancestor's offset; words that spill past a box) and settled the rule: a cursor is placed by what its node inks, as a click is. A cleared style keeps its slot as undefined, so a node's styles never become a dictionary. A Static container is looked at from its last written item, and a written item stays put away whatever its component writes: 131 µs an append over 1,000 and 272 over 8,000 (from 144 and 323; the remaining growth is layout's, in TODO §5). One rule of where a box's children may show — edge, clipOf, visible — read by the painter, the hit test and the cursor. The focus fuzz holds the document's active node, its activeElement and every node's focused in step after every step. One word, one meaning: converge, lapse, gauge, border, outlines, LAYOUTS and PAINTS, redraw, attended and awake, one TIMERS. Screen takes its settings as options. Every void function carries its mark. Four exports nothing imports, two guards nothing reaches, and a duplicated step helper are gone; a closed mount refuses to be driven as it refuses to draw; view.held is documented.

Docs. The line count names the Yoga it counts (3.2.1, the version Ink ships; YOGA_SRC points at a checkout) and reproduces: 4,269 lines, 1.6× against Ink's source and 2.3× with Yoga's algorithm. README's prose quotes bench/RESULTS.md. PLAN names what is built and nothing else — the ansi helper, the style callback, backpressure, __setErrorHandler, the yoga-layout differential and the script smoke test are struck — its module table is the counting rule's, and its progress markers are gone. README says what an app needs to know: the no-wrap idiom, screen.cols and rows, props on run, what a frame's readings mean and how send coordinates shift under a scrollback, that Shift-Tab arrives as Tab with shiftKey, and that a box that scrolls keeps to its parent with flexShrink: 1. Three stale comments say what the code does.

Two Rip rules met along the way and worth knowing: =! freezes its value (a shared typed array must be a plain export), and a local named like a module import writes through to the import (the shared shown became visible, and the clip array clipped).

Suites: test 132, text 49, layout 57, input 316, events 227, mouse 65, ink 540, yoga 543 (4 pinned), yoga-aspect 37, yoga-hand 53, fuzz 7, damage 6, terminal 78, examples 7. bun run test:all: 29 lanes, 12,643 tests.

…p hides is, and only what is no place is refused
…a written item stays put away whatever its component writes
…isible, read by the painter, the hit test and the cursor — and a cursor is placed by what its node inks, as a click is
…nt and every node's focused in step after every step
…, LAYOUTS and PAINTS, redraw, attended and awake — and one TIMERS
…r and failed are the hooks a caller installs
…ocument already keeps, a terminal guard every caller keeps — one step helper serves both ways out, and a closed mount refuses to be driven as it refuses to draw
…s size, props on run, what a frame's readings mean, Shift-Tab, a box that scrolls
@shreeve
shreeve merged commit f85809b into main Sep 22, 2026
2 checks passed
@shreeve
shreeve deleted the tui/closing branch September 22, 2026 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant