Open the agents overview from an empty composer (#41917)

## What changed

- Open the agents overview with Left from an empty, focused composer in local-daemon sessions.
- Keep the shortcut inactive while editing text, using transient input surfaces, or when Left has been explicitly remapped.
- Show the contextual shortcut in the footer and shortcuts overlay.
- Leave the configurable `open_agents` action unbound by default instead of assigning `Alt+A`.

## Testing

- Add coverage for session eligibility, input-state guards, editor and Vim remaps, event dispatch, and footer rendering.

GitOrigin-RevId: ef17db3d9d09c3a08c3f7353c5b8a02f2b61c696
This commit is contained in:
Eric Traut authored and copyberry committed 2026-08-31 21:53:02 +00:00
1 parent 907c34e867
commit 0a2e2bf957
23 files changed
+335 -71

No files matched your search

@@ -0,0 +1,46 @@
use super::*;
#[tokio::test]
async fn agents_navigation_requires_local_daemon() -> Result<()> {
let (mut app, mut events, _op_rx) = make_test_app_with_channels().await;
let mut tui = crate::tui::test_support::make_test_tui()?;
let mut app_server = start_config_write_test_app_server(&app).await?;
let endpoint = crate::RemoteAppServerEndpoint::UnixSocket {
socket_path: AbsolutePathBuf::relative_to_current_dir("codex.sock")?,
};
for target in [
AppServerTarget::Embedded,
AppServerTarget::Remote {
endpoint: endpoint.clone(),
},
AppServerTarget::LocalDaemon { endpoint },
] {
let enabled = matches!(target, AppServerTarget::LocalDaemon { .. });
app.app_server_target = target;
let init = app.chatwidget_init_for_forked_or_resumed_thread(
&mut tui,
app.config.clone(),
/*initial_user_message*/ None,
);
app.replace_chat_widget(ChatWidget::new_with_app_event(init));
while events.try_recv().is_ok() {}
app.handle_tui_event(
&mut tui,
&mut app_server,
TuiEvent::Key(KeyCode::Left.into()),
)
.await?;
if enabled {
let event = events.try_recv()?;
assert_matches!(event, AppEvent::OpenAgentsOverview);
app.handle_event(&mut tui, &mut app_server, event).await?;
assert!(!app.chat_widget.no_modal_or_popup_active());
} else {
assert!(events.try_recv().is_err());
assert!(app.chat_widget.no_modal_or_popup_active());
assert!(!render_bottom_popup(&app.chat_widget, /*width*/ 96).contains("for agents"));
}
}
app_server.shutdown().await?;
Ok(())
}