diff --git a/codex-rs/tui/src/app.rs b/codex-rs/tui/src/app.rs index 3f009a2437..1dd925bf61 100644 --- a/codex-rs/tui/src/app.rs +++ b/codex-rs/tui/src/app.rs @@ -385,7 +385,7 @@ impl App<'_> { } }, AppEvent::DispatchAtCommand(at_command) => match at_command { - crate::at_command::AtCommand::Image => { + crate::at_command::AtCommand::ClipboardImage => { match crate::clipboard_paste::paste_image_to_temp_png() { Ok((path, info)) => { tracing::info!("at_command_image imported path={:?} width={} height={} format={}", path, info.width, info.height, info.encoded_format_label); diff --git a/codex-rs/tui/src/at_command.rs b/codex-rs/tui/src/at_command.rs index 0fad1bf960..b07386bf62 100644 --- a/codex-rs/tui/src/at_command.rs +++ b/codex-rs/tui/src/at_command.rs @@ -5,14 +5,14 @@ use strum_macros::{AsRefStr, EnumIter, EnumString, IntoStaticStr}; #[strum(serialize_all = "kebab-case")] pub enum AtCommand { // Order is presentation order in @ popup. - Image, // import image from clipboard + ClipboardImage, // import image from clipboard File, // open file search popup } impl AtCommand { pub fn description(self) -> &'static str { match self { - AtCommand::Image => "Import an image from the system clipboard (can be used with ctrl+v).", + AtCommand::ClipboardImage => "Import an image from the system clipboard (can be used with ctrl+v).", AtCommand::File => "Search for a file to insert its path.", } } diff --git a/codex-rs/tui/src/bottom_pane/chat_composer.rs b/codex-rs/tui/src/bottom_pane/chat_composer.rs index 9e79fc282e..6209204d3f 100644 --- a/codex-rs/tui/src/bottom_pane/chat_composer.rs +++ b/codex-rs/tui/src/bottom_pane/chat_composer.rs @@ -342,7 +342,7 @@ impl ChatComposer<'_> { Input { key: Key::Enter, shift: false, alt: false, ctrl: false } => { if let Some(cmd) = popup.selected_command() { match cmd { - AtCommand::Image => { + AtCommand::ClipboardImage => { // Dispatch image import request but only remove the @token itself (not entire input). self.app_event_tx.send(AppEvent::DispatchAtCommand(*cmd)); self.remove_current_at_token(); @@ -1503,7 +1503,7 @@ mod tests { } #[test] - fn at_image_command_triggers_dispatch() { + fn at_clipboard_image_command_triggers_dispatch() { use crossterm::event::{KeyCode, KeyEvent, KeyModifiers}; use std::sync::mpsc::Receiver; use crate::app_event::AppEvent; @@ -1518,6 +1518,6 @@ mod tests { composer.handle_key_event(KeyEvent::new(KeyCode::Enter, KeyModifiers::NONE)); // Expect a DispatchAtCommand(Image) or DispatchAtCommand(File); slash commands use DispatchSlashCommand let ev = rx.try_recv().expect("expected an event"); - match ev { AppEvent::DispatchAtCommand(AtCommand::Image) => {}, AppEvent::DispatchAtCommand(AtCommand::File) => {}, other => panic!("unexpected event: {:?}", other) } + match ev { AppEvent::DispatchAtCommand(AtCommand::ClipboardImage) => {}, AppEvent::DispatchAtCommand(AtCommand::File) => {}, other => panic!("unexpected event: {:?}", other) } } }