tui: autofocus, Static and a size of 0 refused or read as they should be, focus given back when a dialog closes, and a modal box holds Tab - #408
Merged
Conversation
…th, as Ink draws it
…n its claim is settled
…ince only an element can be written once
…o read as 80 by 24
… from, and a modal box holds Tab
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.
Five items from
TODO.md, one commit each.A break space at the width. The TODO said Ink drops a space that ends a line exactly at the width, where this package keeps it at the head of the next line. It does not: published Ink 7.1.1 draws
Box width: 5holdingText "abcde fgh"as"abcde\n fgh", as this package does, and drops the space only at a fractional width, where this package already matches it. Changing the wrapper made three of Ink's own ported cases fail. The TODO line and PLAN §11's sentence are gone, andtest/text.rippins the frame Ink draws.autofocuswithoutfocusableis refused by name when the claim is settled, since the two attributes arrive in either order:rip/tui: autofocus on <div> that is not focusable — write focusable: true, with the node's path. A disabled node still claims nothing, silently.A bare text under
Staticis refused by name as it is inserted: only an element can be written once and put away.A stream's
columnsorrowsthat is not a whole number above zero reads as 80 by 24, as an undefined one does and as Ink reads 0 — a pty whose size was never set drew frames of no cells.Focus goes back, and
modalholds Tab. When the focused node leaves the tree, focus goes back to the node it took focus from, if that node can still hold it, else to nothing; inside onemodalbox a node keeps the holder the box was entered from, so Tab going round the dialog does not overwrite it. Anautofocusclaim inside a modal box takes focus from a holder outside it, so a dialog opening over a focused list takes the keyboard. Tab and Shift-Tab from inside amodal: truebox wrap within the innermost one; from outside any modal they walk the tree as before. A hidden or disabled holder still falls to nothing, and nested modal boxes removed together give back nothing (stated and pinned). The focus fuzz opens and closes dialogs, holds that Tab never leaves a modal and that focus is given back exactly when it can be, with floors on every counter.Each item was seeded with single-line bugs and each is caught. Line counts regenerated by
bun run lines(4,308; 2.3× with Yoga 3.2.1's algorithm).Suites: test 134, text 49, layout 57, input 316, events 232, mouse 65, ink 540, yoga 543 (4 pinned), yoga-aspect 37, yoga-hand 53, fuzz 7, damage 6, terminal 79, examples 7.