remove /image and rename command slashcommand

This commit is contained in:
pap
2025-07-27 23:09:45 +01:00
parent 92f97f0641
commit 71d37310fd
3 changed files with 2 additions and 17 deletions
+1 -14
View File
@@ -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 => {
+1 -1
View File
@@ -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),
-2
View File
@@ -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).",
}
}