tui: the closing pass — the audit's findings, fixed one commit at a time - #406
Merged
Merged
Conversation
…p hides is, and only what is no place is refused
…never become a dictionary
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
contentsancestor'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 asundefined, so a node's styles never become a dictionary. AStaticcontainer 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, itsactiveElementand every node'sfocusedin step after every step. One word, one meaning:converge,lapse,gauge,border,outlines,LAYOUTSandPAINTS,redraw,attendedandawake, oneTIMERS.Screentakes 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.heldis documented.Docs. The line count names the Yoga it counts (3.2.1, the version Ink ships;
YOGA_SRCpoints at a checkout) and reproduces: 4,269 lines, 1.6× against Ink's source and 2.3× with Yoga's algorithm. README's prose quotesbench/RESULTS.md. PLAN names what is built and nothing else — theansihelper, the style callback, backpressure,__setErrorHandler, theyoga-layoutdifferential and thescriptsmoke 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.colsandrows,propsonrun, what a frame's readings mean and howsendcoordinates shift under a scrollback, that Shift-Tab arrives asTabwithshiftKey, and that a box that scrolls keeps to its parent withflexShrink: 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 sharedshownbecamevisible, and the clip arrayclipped).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.