mirror of
https://github.com/openai/codex.git
synced 2026-10-30 19:18:49 +00:00
remove /image and rename command slashcommand
This commit is contained in:
+1
-14
@@ -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 => {
|
||||
|
||||
@@ -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),
|
||||
|
||||
|
||||
@@ -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).",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user