Keep command center errors visible and preserve drafts (#44651)

## Why

Command center failures need to remain visible while users retain their task selection and composer draft, including when a task is already managed by another app server.

## What changed

- Show action errors above the retained dashboard with a return option and a clear explanation for tasks open elsewhere.
- Keep the dashboard open until task attachment succeeds, and return to the conversation when selecting the already displayed task.
- Offer “View unsent task” in a pager when restoring a failed submission would overwrite newer input.
- Show task refresh failures inline and clear the notice after a successful refresh.

## Testing

Add regression tests and snapshots for attachment conflicts, preserved selection and drafts, successful attachment, inline refresh recovery, unsent task viewing, and visible action failures.

GitOrigin-RevId: 19670c5ea506414a835296141004db567b0cafef
This commit is contained in:
Eric Traut authored and copyberry committed 2026-09-10 21:42:01 +00:00
1 parent 1aaa453ce2
commit db2e09106c
14 files changed
+411 -65

No files matched your search

+18 -3
View File
@@ -35,6 +35,8 @@ impl App {
&& !matches!(
&event,
AppEvent::InsertHistoryCell(_)
| AppEvent::AgentsOverviewError(_)
| AppEvent::ViewAgentsOverviewUnsentPrompt(_)
| AppEvent::ResetTranscriptForThreadSwitch
| AppEvent::ManagedWorktreeCreated(_)
| AppEvent::AppendMessageHistoryEntry { .. }
@@ -2713,6 +2715,18 @@ impl App {
AppEvent::OpenAgentsOverview => {
self.open_agents_overview(app_server, AgentsOverviewFocus::List);
}
AppEvent::AgentsOverviewError(message) => {
self.add_agents_overview_error(message);
}
AppEvent::ViewAgentsOverviewUnsentPrompt(text) => {
let _ = tui.enter_alt_screen();
self.overlay = Some(Overlay::new_static_with_lines(
text.lines().map(|line| Line::from(line.to_string())).collect(),
"Unsent task".to_string(),
self.keymap.pager.clone(),
));
tui.frame_requester().schedule_frame();
}
AppEvent::AgentsOverviewThreadsLoaded { request_id, result } => {
self.apply_agents_overview_thread_refresh(app_server, request_id, result);
}
@@ -2721,7 +2735,9 @@ impl App {
.select_agents_overview_thread(tui, app_server, thread_id)
.await?
{
AppRunControl::Continue if self.primary_thread_id.is_none() => {
AppRunControl::Continue
if self.primary_thread_id.is_none()
&& self.chat_widget.selected_index_for_present_view(AGENTS_OVERVIEW_VIEW_ID).is_none() => {
self.open_agents_overview(app_server, AgentsOverviewFocus::List);
}
AppRunControl::Continue => {}
@@ -2740,8 +2756,7 @@ impl App {
state.input = name;
state.renaming = true;
}
self.chat_widget
.add_error_message(format!("Failed to rename task: {error}"));
self.add_agents_overview_error(format!("Failed to rename task: {error}"));
}
}
}