Add TUI building blocks for inline async question editing (#42889)

## What changed

- Introduce an async-question editor component with per-question drafts, navigation, replay deduplication, and submit or queue handling using the shared composer.
- Add bounded `AnsweredQuestion` framing that truncates question text at a UTF-8 boundary and flattens line breaks before prepending it to an answer.
- Add `prompt_stack_back` and `skip_question` keybinding actions and the `tui.question_esc_back` setting. Normalize `Ctrl+]` and `Ctrl+5` for key matching and conflict detection, and let default question shortcuts yield to explicit bindings.
- Flush buffered typing in both the main composer and the covering view so background input cannot keep the draw loop waiting.

The async-question component is not yet connected to the TUI event flow.

## Testing

Add regression coverage for bounded Unicode question framing, question-shortcut conflicts, and paste-buffer flushing in background and covering editors.

GitOrigin-RevId: 4098043cf588ddafc05c27505645495edd690cb9
This commit is contained in:
Ian MacLeod authored and copyberry committed 2026-09-04 23:56:25 +00:00
1 parent 574a36ff99
commit 6ae8dcf6e1
32 files changed
+750 -44

No files matched your search

+2
View File
@@ -1261,6 +1261,7 @@ fn config_toml_deserializes_model_availability_nux() {
auto_recap: true,
disable_paste_burst: None,
vim_mode_default: false,
question_esc_back: true,
raw_output_mode: false,
alternate_screen: AltScreenMode::default(),
status_line: None,
@@ -4275,6 +4276,7 @@ fn tui_config_missing_notifications_field_defaults_to_enabled() {
auto_recap: true,
disable_paste_burst: None,
vim_mode_default: false,
question_esc_back: true,
raw_output_mode: false,
alternate_screen: AltScreenMode::Auto,
status_line: None,
+2
View File
@@ -754,6 +754,7 @@ pub struct Config {
/// Start the composer in Vim mode (`Normal`) by default.
pub tui_vim_mode_default: bool,
pub tui_question_esc_back: bool,
/// Start the TUI in raw scrollback mode for copy-friendly transcript output.
pub tui_raw_output_mode: bool,
@@ -4354,6 +4355,7 @@ impl Config {
.as_ref()
.map(|t| t.model_availability_nux.clone())
.unwrap_or_default(),
tui_question_esc_back: cfg.tui.as_ref().map(|t| t.question_esc_back).unwrap_or(true),
tui_vim_mode_default: cfg
.tui
.as_ref()