Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion codex-rs/config/src/tui_keymap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ pub struct TuiAgentsKeymap {
pub resume: Option<KeybindingsSpec>,
/// Search the available agent tasks.
pub search: Option<KeybindingsSpec>,
/// Start composing a new agent task.
/// Open a new session in the selected checkout.
pub new_task: Option<KeybindingsSpec>,
/// Rename the selected task.
pub rename: Option<KeybindingsSpec>,
Expand Down
2 changes: 1 addition & 1 deletion codex-rs/core/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4429,7 +4429,7 @@
"$ref": "#/definitions/KeybindingsSpec"
}
],
"description": "Start composing a new agent task."
"description": "Open a new session in the selected checkout."
},
"rename": {
"allOf": [
Expand Down
355 changes: 128 additions & 227 deletions codex-rs/tui/src/app/agents_overview.rs

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions codex-rs/tui/src/app/agents_overview_actions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
//! Removing the current root leaves an unattached dashboard, even when it is empty.

use super::App;
use super::agents_overview_view::AgentsOverviewFocus;
use crate::app_event::AgentsOverviewAction;
use crate::app_event::AppEvent;
use crate::app_server_session::AppServerSession;
Expand Down Expand Up @@ -284,7 +283,7 @@ impl App {
/*initial_user_message*/ None,
);
self.replace_chat_widget(ChatWidget::new_with_app_event(init));
self.open_agents_overview(app_server, AgentsOverviewFocus::List);
self.open_agents_overview(app_server);
} else {
self.repaint_agents_overview();
if attempted {
Expand Down
33 changes: 17 additions & 16 deletions codex-rs/tui/src/app/agents_overview_actions_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ async fn lifecycle_shortcuts_target_filtered_task_in_any_state() {
active_flags: Vec::new(),
},
] {
app.agents_overview
.view_state
.lock()
.unwrap()
.focus_composer();
let target = ThreadId::new();
let mut view = app.agents_overview_view(
vec![
Expand All @@ -89,7 +84,7 @@ async fn lifecycle_shortcuts_target_filtered_task_in_any_state() {
Some(target),
);
view.handle_key_event(KeyCode::Esc.into());
view.handle_key_event(KeyEvent::new(KeyCode::Char('f'), KeyModifiers::CONTROL));
view.handle_key_event(KeyEvent::new(KeyCode::Char('f'), KeyModifiers::NONE));
for character in "Target".chars() {
view.handle_key_event(KeyCode::Char(character).into());
}
Expand Down Expand Up @@ -133,7 +128,7 @@ async fn hidden_task_stays_hidden_through_activity_and_seed_until_explicit_resum
app.chat_widget.show_bottom_pane_view(Box::new(view));
app.chat_widget.handle_key_event(KeyCode::Esc.into());
app.chat_widget
.handle_key_event(KeyEvent::new(KeyCode::Char('w'), KeyModifiers::CONTROL));
.handle_key_event(KeyEvent::new(KeyCode::Char('h'), KeyModifiers::NONE));
let hide = std::iter::from_fn(|| rx.try_recv().ok())
.find(|event| matches!(event, AppEvent::HideAgentsOverviewThread { .. }))
.expect("shortcut requests hiding the task");
Expand Down Expand Up @@ -236,9 +231,7 @@ async fn lifecycle_removes_background_and_current_tasks_without_losing_the_dashb
(AgentsOverviewAction::Delete, "delete_task", true),
] {
let key = match action {
AgentsOverviewAction::Archive => {
KeyEvent::new(KeyCode::Char('e'), KeyModifiers::CONTROL)
}
AgentsOverviewAction::Archive => KeyEvent::new(KeyCode::Char('a'), KeyModifiers::NONE),
AgentsOverviewAction::Delete => KeyCode::Delete.into(),
};
let (mut app, mut rx, _op_rx) =
Expand Down Expand Up @@ -357,7 +350,7 @@ async fn lifecycle_removes_background_and_current_tasks_without_losing_the_dashb
};
let mut tui = crate::tui::test_support::make_test_tui()?;
tui.pause_events();
app.open_agents_overview(&app_server, AgentsOverviewFocus::List);
app.open_agents_overview(&app_server);
if action == AgentsOverviewAction::Archive {
let rollout = app_server
.thread_read(id, /*include_turns*/ false)
Expand Down Expand Up @@ -402,7 +395,7 @@ async fn lifecycle_removes_background_and_current_tasks_without_losing_the_dashb
.await?;
app.enqueue_primary_thread_session(resumed.session, resumed.turns)
.await?;
app.open_agents_overview(&app_server, AgentsOverviewFocus::List);
app.open_agents_overview(&app_server);
}
let background = ThreadId::from_string(
&app_test_support::create_fake_rollout(
Expand Down Expand Up @@ -586,20 +579,28 @@ async fn disabled_footer_shortcuts_stay_bold_when_wrapped() {
let mut buffer = ratatui::buffer::Buffer::empty(area);
view.render(area, &mut buffer);
let delete_key = crate::key_hint::plain(KeyCode::Delete).display_label();
for key in ["ctrl+x", "ctrl+w", "ctrl+e", delete_key.as_str()] {
for (key, label) in [
("x", "x stop"),
("h", "h hide"),
("a", "a archive"),
(delete_key.as_str(), delete_key.as_str()),
] {
let cells = buffer
.content()
.windows(key.len())
.windows(label.len())
.find(|cells| {
cells
.iter()
.map(ratatui::buffer::Cell::symbol)
.collect::<String>()
== key
== label
})
.expect("footer shortcut");
assert_eq!(
cells.iter().map(|cell| cell.modifier).collect::<Vec<_>>(),
cells[..key.len()]
.iter()
.map(|cell| cell.modifier)
.collect::<Vec<_>>(),
vec![ratatui::style::Modifier::BOLD | ratatui::style::Modifier::DIM; key.len()]
);
}
Expand Down
83 changes: 0 additions & 83 deletions codex-rs/tui/src/app/agents_overview_composer.rs

This file was deleted.

19 changes: 2 additions & 17 deletions codex-rs/tui/src/app/agents_overview_errors.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
//! Reports command-center action failures above the retained dashboard, with access
//! to unsent drafts when restoring them would overwrite newer input.
//! Reports command-center action failures above the retained dashboard.

use super::*;
use crate::wrapping::word_wrap_lines;
Expand All @@ -23,30 +22,16 @@ impl Renderable for AgentsOverviewErrorHeader {

impl App {
pub(in crate::app) fn add_agents_overview_error(&mut self, message: String) {
let unsent_prompt = self.agents_overview.unsent_prompt.take();
if self
.chat_widget
.selected_index_for_present_view(AGENTS_OVERVIEW_VIEW_ID)
.is_some()
{
let mut items = vec![SelectionItem {
let items = vec![SelectionItem {
name: "Return to command center".to_string(),
dismiss_on_select: true,
..Default::default()
}];
if let Some(text) = unsent_prompt {
items.push(SelectionItem {
name: "View unsent task".to_string(),
description: Some(
"Your newer draft has been kept in the composer.".to_string(),
),
actions: vec![Box::new(move |tx| {
tx.send(AppEvent::ViewAgentsOverviewUnsentPrompt(text.clone()));
})],
dismiss_on_select: false,
..Default::default()
});
}
self.chat_widget.show_selection_view(SelectionViewParams {
header: Box::new(AgentsOverviewErrorHeader(vec![
Line::from("Unable to complete action".bold()),
Expand Down
Loading
Loading