mirror of
https://github.com/openai/codex.git
synced 2026-10-30 19:18:49 +00:00
tui: clear empty-arg slash drafts on dispatch
Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
co-authored by
Codex
parent
a80a654b04
commit
02f6733dea
@@ -4719,6 +4719,8 @@ impl ChatWidget {
|
||||
if should_queue && !cmd.requires_interaction() {
|
||||
self.queue_current_inline_bare_slash_command(cmd);
|
||||
} else {
|
||||
self.set_composer_text(String::new(), Vec::new(), Vec::new());
|
||||
self.set_remote_image_urls(Vec::new());
|
||||
self.dispatch_command(cmd);
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -6055,6 +6055,19 @@ async fn slash_help_opens_reference_popup() {
|
||||
assert!(scrolled.contains("/review <instructions>"));
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn slash_help_with_whitespace_only_args_clears_composer() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(None).await;
|
||||
|
||||
chat.bottom_pane
|
||||
.set_composer_text("/help ".to_string(), Vec::new(), Vec::new());
|
||||
chat.handle_key_event(KeyEvent::new(KeyCode::Enter, KeyModifiers::NONE));
|
||||
|
||||
assert!(chat.bottom_pane.has_active_view());
|
||||
assert_eq!(chat.bottom_pane.composer_text(), "");
|
||||
assert!(chat.remote_image_urls().is_empty());
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn slash_help_search_jumps_to_lower_match() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(None).await;
|
||||
|
||||
Reference in New Issue
Block a user