From 71d37310fd985f7675b61294298022e2ea3da1aa Mon Sep 17 00:00:00 2001 From: pap Date: Sun, 27 Jul 2025 23:09:45 +0100 Subject: [PATCH] remove /image and rename command slashcommand --- codex-rs/tui/src/app.rs | 15 +-------------- codex-rs/tui/src/app_event.rs | 2 +- codex-rs/tui/src/slash_command.rs | 2 -- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/codex-rs/tui/src/app.rs b/codex-rs/tui/src/app.rs index 52cb0ce628..3f009a2437 100644 --- a/codex-rs/tui/src/app.rs +++ b/codex-rs/tui/src/app.rs @@ -348,7 +348,7 @@ impl App<'_> { AppState::Chat { widget } => widget.update_latest_log(line), AppState::Login { .. } | AppState::GitWarning { .. } => {} }, - AppEvent::DispatchCommand(command) => match command { + AppEvent::DispatchSlashCommand(command) => match command { SlashCommand::New => { let new_widget = Box::new(ChatWidget::new( self.config.clone(), @@ -383,19 +383,6 @@ impl App<'_> { widget.add_diff_output(text); } } - SlashCommand::Image => { - match crate::clipboard_paste::paste_image_to_temp_png() { - Ok((path, info)) => { - tracing::info!("slash_command_image imported path={:?} width={} height={} format={}", path, info.width, info.height, info.encoded_format_label); - self.app_event_tx.send(AppEvent::AttachImage { path, width: info.width, height: info.height, format_label: info.encoded_format_label }); - } - Err(err) => { - if let AppState::Chat { widget } = &mut self.app_state { - widget.add_background_event(format!("image import failed: {err}")); - } - } - } - } }, AppEvent::DispatchAtCommand(at_command) => match at_command { crate::at_command::AtCommand::Image => { diff --git a/codex-rs/tui/src/app_event.rs b/codex-rs/tui/src/app_event.rs index 889b58ce7c..545e88b9fe 100644 --- a/codex-rs/tui/src/app_event.rs +++ b/codex-rs/tui/src/app_event.rs @@ -38,7 +38,7 @@ pub(crate) enum AppEvent { /// Dispatch a recognized slash command from the UI (composer) to the app /// layer so it can be handled centrally. - DispatchCommand(SlashCommand), + DispatchSlashCommand(SlashCommand), /// Dispatch an @ command. DispatchAtCommand(AtCommand), diff --git a/codex-rs/tui/src/slash_command.rs b/codex-rs/tui/src/slash_command.rs index ca414fa081..603eb721cd 100644 --- a/codex-rs/tui/src/slash_command.rs +++ b/codex-rs/tui/src/slash_command.rs @@ -14,7 +14,6 @@ pub enum SlashCommand { // more frequently used commands should be listed first. New, Diff, - Image, // import image from clipboard Quit, } @@ -27,7 +26,6 @@ impl SlashCommand { SlashCommand::Diff => { "Show git diff of the working directory (including untracked files)" } - SlashCommand::Image => "Import an image from the system clipboard (can be used with ctrl+v).", } }