route TUI editor input by owning-view focus#13771
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
a0ee2eb to
f3c7f42
Compare
bf39ff7 to
9f1f151
Compare
9f1f151 to
8ecadc5
Compare
f3c7f42 to
1d2cca1
Compare
|
I'm starting a first review of this pull request. You can view the conversation on Warp. I completed the review and no human review was requested for this pull request. Comment Powered by Oz |
There was a problem hiding this comment.
Overview
This PR adds owning-view focus tracking for TuiInputView and snapshots it into TuiEditorElement so editable TUI elements only render the terminal cursor and consume raw text/paste while focused.
Concerns
- This is a user-facing TUI behavior change, but the PR only states manual testing with
./script/run-tui; it does not attach an acceptable TUI evidence artifact such as a terminal transcript,render_to_lines/TuiBuffer::to_linessnapshot diff, or./script/run-tuicapture. Please include terminal evidence demonstrating the focus-routing behavior end to end.
Verdict
Found: 0 critical, 1 important, 1 suggestions
Request changes
Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).
Powered by Oz
1d2cca1 to
991c04e
Compare
991c04e to
71a3e79
Compare

Description
This PR updates tracking so that the
TuiInputView(and other TUI views going forward) owns focus viaon_focus/on_blurand snapshots that state intoTuiEditorElement. Editable TUI editors now consume raw text and paste events, and render the terminal cursor, only while their owning view is focused. This prevents multiple editable elements rendered at once from contending for the same input.This follows the GUI editor's existing pattern:
EditorViewsnapshots its focus state intoViewSnapshot, andEditorElement::typed_charactersdeclines text when that snapshot is not focused. The TUI now uses the same view-to-element focus boundary instead of allowing every editable element to handle raw input.We're doing this now so that, upstack when we add the search input to the options element, we can do so with clear focus tracking for that input.
Testing
./script/run-tuiAgain, no behavior changes yet
Agent Mode