Add host cycling and saved defaults for new TUI conversations (#59007)

## What changed

- With multi-backend support enabled, show the current host before the first submission and use `leader b` to cycle through available connections. Expose the shortcut as `tui.keymap.global.change_host`.
- Preserve the conversation name and composer draft, including cursor position, attachments, pending pastes, and literal versus shell-command interpretation of `!`.
- Save explicit host choices in user-only `tui.default_hosts`, scoped to the local project and user identity. Use the saved host for new conversations, falling back to the first available connection when it is unavailable.
- Prepare the destination and check directory trust before replacing the current conversation. Block switching during voice calls and active turns, and remove replaced blank conversations from the session overview.

## Testing

Add coverage for shortcut visibility and remapping, draft and name preservation, project/user preference isolation, unavailable-host fallback, destination trust and startup failures, and voice-call guards.

GitOrigin-RevId: def7b088951336bec8fe3962954fba9b861f91c6
This commit is contained in:
Benjamin Carlsson
2026-11-02 23:19:03 +00:00
committed by copyberry
parent 857415f7f2
commit 26f73fba8f
49 changed files with 1273 additions and 118 deletions
+2
View File
@@ -1393,6 +1393,7 @@ fn config_toml_deserializes_model_availability_nux() {
assert_eq!(
cfg.tui.expect("tui config should deserialize"),
Tui {
default_hosts: Default::default(),
notification_settings: TuiNotificationSettings::default(),
animations: true,
screen_reader_detection_done: None,
@@ -4754,6 +4755,7 @@ fn tui_config_missing_notifications_field_defaults_to_enabled() {
assert_eq!(
tui,
Tui {
default_hosts: Default::default(),
notification_settings: TuiNotificationSettings::default(),
animations: true,
screen_reader_detection_done: None,