Navi Code TUI: make the message input multi-line
...
InputBox used textual.widgets.Input, a single-line widget. Swap to TextArea so
the prompt is genuinely multi-line: soft-wrap is on, the field grows with content
(height auto, min 3, max 12, then internal scroll), and Enter no longer collides
with newline insertion.
_PromptInput(TextArea) intercepts keys in _on_key before TextArea's own handler
(which maps enter -> "\n"):
- Enter -> submit: post UserSubmitted(text), then clear the field.
- Ctrl+Enter -> insert a hard line break.
Dropped dead set_prompt_char (referenced a non-existent self._prompt) and the
on_input_* handlers (submit now lives in the subclass). CSS selectors updated
from Input to TextArea. Placeholder notes the keybindings.
Tests: _input.value -> _input.text across the TUI suites; added Ctrl+Enter
inserts a newline without submitting, Enter submits the full multi-line buffer
(newlines preserved) and clears the field, and the input height grows with
content. 577 passed, 1 skipped.
Co-Authored-By: Claude <noreply@anthropic.com>
Eugene Sukhodolskiy
committed
2 days ago