mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Use the shared composer in the agent command center (#42428)
## What changed - Replace the command center's single-line new-task input with the shared chat composer, including multiline editing, paste handling, Vim mode, configured keybindings, cursor behavior, and input validation. - Keep task drafts and editor state across dashboard refreshes and reconnects while separating composer focus from list, search, and rename actions. - Preserve whitespace in dispatched task prompts, block submission while offline, and restore unsent prompts after dispatch failures when the composer is still available. ## Testing - Add coverage for focus routing, draft retention, multiline pastes, custom keybindings, Vim mode, offline editing, failed-dispatch recovery, and responsive rendering. GitOrigin-RevId: a609ae95d497cbae0ebcac4cdcc50fe49d74832a
This commit is contained in:
1 parent
cac96cd7b1
commit
62f553bfd0
20 files changed
+717
-145
No files matched your search
@@ -1,5 +1,8 @@
|
||||
//! Daemon-wide overview of recent and locally retained sessions and their subagents.
|
||||
|
||||
#[path = "agents_overview_composer.rs"]
|
||||
mod composer;
|
||||
|
||||
use super::agents_overview_view::AgentsOverviewGroup;
|
||||
use super::agents_overview_view::AgentsOverviewRow;
|
||||
use super::agents_overview_view::AgentsOverviewView;
|
||||
@@ -98,6 +101,11 @@ impl App {
|
||||
return;
|
||||
}
|
||||
|
||||
self.agents_overview
|
||||
.view_state
|
||||
.lock()
|
||||
.unwrap_or_else(std::sync::PoisonError::into_inner)
|
||||
.focus_composer();
|
||||
let threads = self
|
||||
.agents_overview
|
||||
.threads
|
||||
@@ -252,6 +260,8 @@ impl App {
|
||||
});
|
||||
}
|
||||
|
||||
self.sync_agents_overview_composer();
|
||||
|
||||
AgentsOverviewView::new(
|
||||
rows,
|
||||
selected_thread_id,
|
||||
@@ -599,9 +609,7 @@ impl App {
|
||||
Some(cwd) => match self.rebuild_config_for_cwd(cwd.to_path_buf()).await {
|
||||
Ok(config) => config,
|
||||
Err(error) => {
|
||||
if let Ok(mut state) = self.agents_overview.view_state.lock() {
|
||||
state.input = prompt;
|
||||
}
|
||||
self.restore_agents_overview_prompt(prompt);
|
||||
return self
|
||||
.chat_widget
|
||||
.add_error_message(format!("Failed to load project settings: {error}"));
|
||||
@@ -615,9 +623,7 @@ impl App {
|
||||
|| config.permissions.profile_workspace_roots()
|
||||
!= self.config.permissions.profile_workspace_roots())
|
||||
{
|
||||
if let Ok(mut state) = self.agents_overview.view_state.lock() {
|
||||
state.input = prompt;
|
||||
}
|
||||
self.restore_agents_overview_prompt(prompt);
|
||||
return self
|
||||
.chat_widget
|
||||
.add_error_message("Permission profile has different settings.".to_string());
|
||||
@@ -646,9 +652,7 @@ impl App {
|
||||
.await;
|
||||
}
|
||||
Err(error) => {
|
||||
if let Ok(mut state) = self.agents_overview.view_state.lock() {
|
||||
state.input = prompt;
|
||||
}
|
||||
self.restore_agents_overview_prompt(prompt);
|
||||
self.chat_widget
|
||||
.add_error_message(format!("Failed to start background task: {error}"));
|
||||
}
|
||||
@@ -676,9 +680,7 @@ impl App {
|
||||
})
|
||||
.await;
|
||||
if let Err(error) = result {
|
||||
if let Ok(mut state) = self.agents_overview.view_state.lock() {
|
||||
state.input = prompt;
|
||||
}
|
||||
self.restore_agents_overview_prompt(prompt);
|
||||
self.chat_widget
|
||||
.add_error_message(format!("Failed to send task message: {error}"));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user