mirror of
https://github.com/openai/codex.git
synced 2026-11-03 19:53:25 +00:00
tui: gate inline feedback command
Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
co-authored by
Codex
parent
6d0be7f9d8
commit
f34490a3f2
@@ -5153,6 +5153,12 @@ impl ChatWidget {
|
||||
}
|
||||
}
|
||||
SlashCommand::Feedback => {
|
||||
if !self.config.feedback_enabled {
|
||||
let params = crate::bottom_pane::feedback_disabled_params();
|
||||
self.bottom_pane.show_selection_view(params);
|
||||
self.request_redraw();
|
||||
return QueueReplayControl::Stop;
|
||||
}
|
||||
let args = match SlashCommandInvocation::parse_args(
|
||||
&args_message.text,
|
||||
"Usage: /feedback <bug|bad-result|good-result|safety-check|other>",
|
||||
|
||||
@@ -8388,6 +8388,20 @@ async fn feedback_selection_popup_emits_serialized_slash_draft() {
|
||||
assert_matches!(rx.try_recv(), Ok(AppEvent::BottomPaneViewCompleted));
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn feedback_inline_args_respect_feedback_disabled_flag() {
|
||||
let (mut chat, mut rx, mut op_rx) = make_chatwidget_manual(None).await;
|
||||
chat.config.feedback_enabled = false;
|
||||
|
||||
chat.handle_serialized_slash_command(UserMessage::from("/feedback bug".to_string()));
|
||||
|
||||
let popup = render_bottom_popup(&chat, 80);
|
||||
assert!(popup.contains("Sending feedback is disabled"));
|
||||
assert!(popup.contains("This action is disabled by configuration."));
|
||||
assert_matches!(rx.try_recv(), Err(TryRecvError::Empty));
|
||||
assert_no_submit_op(&mut op_rx);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn skills_menu_emits_serialized_slash_drafts() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(None).await;
|
||||
|
||||
Reference in New Issue
Block a user