mirror of
https://github.com/openai/codex.git
synced 2026-11-15 21:50:46 +00:00
Open tasks with Right from the agents overview (#44344)
## What changed Allow `Right` to open the selected task from the task list or an empty, focused composer. Preserve editor keybindings and guard against pending input, active popups, and offline state. Keep metadata editing unaffected and show the shortcut in navigation hints. ## Testing Add regression tests for opening the current or highlighted task, preserving cursor movement and renaming, and preventing navigation while offline. Update snapshots to cover the new hints. GitOrigin-RevId: 9fc01b62ad0829b964509ae6286a041fc4936b9d
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
//! # Key Event Routing
|
||||
//!
|
||||
//! Plain Left opens agents when the local-daemon composer is empty and available for input.
|
||||
//! The agents dashboard uses the matching empty-editor guards for Right to open a task.
|
||||
//! Explicit editor remaps take precedence.
|
||||
//! Most key handling goes through [`ChatComposer::handle_key_event`], which dispatches to a
|
||||
//! popup-specific handler if a popup is visible and otherwise to
|
||||
|
||||
@@ -2,10 +2,26 @@
|
||||
//!
|
||||
//! Only local-daemon sessions enable this shortcut. Draft contents, transient input surfaces,
|
||||
//! and explicit editor remaps take precedence over navigation.
|
||||
//! The dashboard can also leave an empty editor with Right under the same input guards.
|
||||
|
||||
use super::*;
|
||||
|
||||
impl ChatComposer {
|
||||
pub(crate) fn can_leave_empty_prompt_with_right(&self) -> bool {
|
||||
let move_right = if self.draft.textarea.is_vim_normal_mode() {
|
||||
&self.vim_normal_keymap.move_right
|
||||
} else {
|
||||
&self.editor_keymap.move_right
|
||||
};
|
||||
move_right.is_pressed(KeyCode::Right.into())
|
||||
&& self.has_focus
|
||||
&& self.draft.input_enabled
|
||||
&& self.is_empty()
|
||||
&& !self.is_in_paste_burst()
|
||||
&& !self.popup_active()
|
||||
&& !self.draft.textarea.is_vim_operator_pending()
|
||||
}
|
||||
|
||||
pub(crate) fn set_agents_navigation_enabled(&mut self, enabled: bool) {
|
||||
self.agents_navigation_enabled = enabled;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user