Skip to content

Commit b5fd181

Browse files
authored
Navigate REPL regions and edit text with visible carets (#1022)
* Integrate focus regions with terminal behavioral tests Carry the accepted foundation from 9e5e1356c73af592795c0042464d5c0837d93a1b onto c5ee90d. Keep terminal-only behavioral consumers and owned tree assertions; preserve the isolated seven-minute policy delta from 7596f82b3a07944f2ea173ed2c3294c4e6a284eb. * Restore removed nested modal openers through their survivors * ✨ Edit REPL fields at independent visible carets * ✨ Navigate REPL readings and fixed drawer actions * ✨ Complete REPL region consumers and keyboard evidence * 🩹 Describe held History footer actions precisely * 🩹 Mark only the visible narrow surface as selected * 🩹 Refuse edits from expired question fields * 🩹 Recover narrow focus into selected content * 🩹 Repair focus-region CI compatibility and test routes * fix(cli): retain caret row affinity and reuse editor geometry
1 parent c5ee90d commit b5fd181

45 files changed

Lines changed: 5084 additions & 851 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎AGENTS.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,9 +419,9 @@ after anything that moves the corpus, the exclusions, or a runner command; never
419419
hand-edit a millisecond.
420420

421421
**Shard counts are measured, not chosen.** For each runtime the floor is
422-
`floor(sum of applicable weights / 300000) + 1`, and the installed count is the
422+
`floor(sum of applicable weights / 420000) + 1`, and the installed count is the
423423
smallest one for which five consecutive runs on one fixed head keep every shard
424-
`Test` step, and the whole runtime's execution window, under 300 seconds. A miss
424+
`Test` step, and the whole runtime's execution window, under 420 seconds. A miss
425425
increments that runtime by one and starts a fresh sequence of five. Narrowing
426426
the corpus or enabling in-shard concurrency is not an answer to a miss.
427427

‎architecture.md‎

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6844,6 +6844,46 @@ action; the tree walks that target's own ancestry, and the first node to handle
68446844
the event produces the typed action the root acts on. An event nothing handles
68456845
is an explicit failure.
68466846

6847+
**Keyboard focus moves by regions, and the structure is derived, not stored.**
6848+
A focusable description may carry a placement: its region — a key, a rank in
6849+
the Tab cycle, an axis and an optional recovery preference — the nested groups
6850+
between that region and itself, whether it heads the innermost group, and an
6851+
entry preference. The tree derives the navigation structure from the placed
6852+
controls of the active focus root in canonical mounted order whenever a key
6853+
asks, so an unmounted or covered control is never a destination and Freedom
6854+
stays the one focus store. Tab and Backtab are the tree's alone and go to the
6855+
next or previous region at its fixed entry. Arrows, Home, End and the Page keys
6856+
are offered to the focused control's ancestry first — a field keeps them for
6857+
its caret, a reading for scrolling, a windowed row to ask for a hidden
6858+
neighbour to be revealed — and what nothing handles is navigation: along a
6859+
level's axis, into a group from its anchor, back out to it, or through an
6860+
anchorless group to its parent. Alt+Up and Alt+Down step through the region's
6861+
depth-first order. No move activates anything. A pushed modal is entered at its
6862+
first region's entry; a removed or uncovered control's survivor is chosen from
6863+
its own neighbours, then its ancestors' anchors and its region's entry, then the
6864+
lowest recovery preference, never the first control on the screen. The
6865+
validator refuses two declarations of one region, a group with two axes and a
6866+
group with two anchors, because each would make where a key goes depend on
6867+
mounting order.
6868+
6869+
The application keeps editing state with each value owner: Draft, Message,
6870+
each pending question's named values, and Configure Agent. The renderer's fitted
6871+
rows supply grapheme boundaries and display columns for caret movement. The
6872+
focused field names its destination; the root validates that owner before
6873+
editing. Carets survive coverage and resize but add no mounted focus store,
6874+
location member or retained record.
6875+
6876+
A reading has one stable anchor over its admitted rows, with no extra row or
6877+
pointer target. Its keys scroll only that viewport. Logical lists supply their
6878+
own hidden-neighbour targets and use the measured admission to reveal a row
6879+
before focusing it. A question's fixed Submit sits beside Close and any offered
6880+
Stop; a drawer's Content, Actions and History/Exit are separate regions. Nested
6881+
History retains the lower presentation under the same tree-owned modal lifetime.
6882+
The narrow surface bar offers Sessions, Entries and Sidekick; only the routed
6883+
outlet and its composer are mounted. A refusal below minimum mounts no controls,
6884+
and recovery enters routed content before the surface bar. No background update
6885+
selects a focus destination.
6886+
68476887
Freedom is vendored from a pinned unpublished commit under
68486888
`packages/cli/src/repl/vendor/freedom/`, as a pristine copy and a patched copy
68496889
whose every difference belongs to one named patch. See its `PROVENANCE.md`.
@@ -7185,12 +7225,14 @@ and is not containment — whether a dispatch may reach a node behind the modal
71857225
is the reconciler's to refuse, and it refuses with capture off.
71867226

71877227
Text is its own member of that normalized union, not a key with a payload: a
7188-
named key — submit, dismiss, traverse, erase — is a command whoever handles it
7189-
recognizes, and text is content that goes wherever content goes. It carries what
7190-
the terminal decoded, so shifted, accented and multi-byte characters arrive
7191-
already assembled, and a newline inside a paste arrives as one. A chord carries
7192-
a letter in its physical key code, and reading that code would type the letter
7193-
somebody held Control with, so a chord is dropped whole — payload included.
7228+
named key — submit, dismiss, traverse, move, erase — is a command whoever
7229+
handles it recognizes, and text is content that goes wherever content goes.
7230+
Text carries what the terminal decoded, so shifted, accented and multi-byte
7231+
characters arrive already assembled, and a newline inside a paste arrives as
7232+
one. A chord carries a letter in its physical key code, and reading that code
7233+
would type the letter somebody held Control with, so a chord is dropped whole —
7234+
payload included. Arrows, Home, End, the Page keys and Alt+Up/Down are named as
7235+
pressed rather than dropped: they carry no text.
71947236

71957237
**One renderer owns two engines, and they are not interchangeable.** The engine
71967238
emits a complete redraw after any update that is not a no-op, so telling it a

‎packages/cli/src/cli.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,18 @@ const REPL_HELP = [
613613
" Each one starts from the bindings the entries before it published, so a",
614614
" later entry can read and revise what an earlier one left behind.",
615615
"",
616+
"KEYBOARD",
617+
"",
618+
" Tab and Shift+Tab change regions at fixed entries. Arrows navigate local",
619+
" controls; Alt+Up/Down reaches local actions from a field. Movement activates",
620+
" nothing. Enter activates the focused control or submits its field.",
621+
" Fields edit at a visible caret: arrows move it, Home/End reaches the row's",
622+
" boundaries, and Backspace removes one grapheme. Reading anchors scroll with",
623+
" arrows, PageUp/PageDown and Home/End. Escape closes the top drawer.",
624+
" Drawers cycle Content, Actions, History/Exit. Question Submit stays beside",
625+
" Close/Stop. At narrow sizes the surface bar offers Sessions, Entries and",
626+
" Sidekick; only the selected outlet is mounted.",
627+
"",
616628
" --mount SOURCE:TARGET adds an external directory at a required document path.",
617629
" Repeat it: --mount /work/manuals:/reference --mount /work/fixtures:/fixtures.",
618630
" --include <directory> and --include=<directory> select component directories.",

0 commit comments

Comments
 (0)