Save and cycle through side chats in TUI scrollback mode (#64207)

## Why

Scrollback mode could switch between a parent conversation and a live side
chat, but it could neither save side chats nor reopen them after resuming
the parent.

## What changed

- With the TUI workspace feature enabled and a compatible local backend,
  save new scrollback side chats as attached threads. Use `Ctrl+/` to
  discover saved chats and cycle from the parent through them and back.
- Show the current side chat's position and loading status. Keep input in
  the source draft while a switch is pending, and let `Esc` cancel it.
- Delete the parent and its saved side chats in one `thread/delete`
  request. The experimental `savedSideChatIds` parameter lets the server
  verify that each requested chat belongs to the parent and check for
  blocking attachments before deleting anything.

## Testing

Add coverage for cycling after resume, preserving pasted drafts during a
pending switch, and limiting parent deletion to verified saved side chats.

GitOrigin-RevId: 7c797f1b69dff73ff0343eb73dd3c048e856b319
This commit is contained in:
Felipe Coury
2026-11-26 19:54:18 +00:00
committed by copyberry
parent a9d7206f8f
commit 475e13ab1a
47 changed files with 1122 additions and 212 deletions
@@ -618,6 +618,7 @@ client_request_definitions! {
},
ThreadDelete => "thread/delete" {
params: v2::ThreadDeleteParams,
inspect_params: true,
serialization: thread_id(params.thread_id),
response: v2::ThreadDeleteResponse,
},
@@ -760,11 +760,15 @@ pub struct ThreadArchiveParams {
#[ts(export_to = "v2/")]
pub struct ThreadArchiveResponse {}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS, ExperimentalApi)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
pub struct ThreadDeleteParams {
pub thread_id: String,
/// Verified saved TUI side chats to include in the same deletion.
#[experimental("thread/delete.savedSideChatIds")]
#[ts(optional = nullable)]
pub saved_side_chat_ids: Option<Vec<String>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]