mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
Add config to disable /feedback (#8909)
Some enterprises do not want their users to be able to `/feedback`. <img width="395" height="325" alt="image" src="https://github.com/user-attachments/assets/2dae9c0b-20c3-4a15-bcd3-0187857ebbd8" /> Adds to `config.toml`: ```toml [feedback] enabled = false ``` I've deliberately decided to: 1. leave other references to `/feedback` (e.g. in the interrupt message, tips of the day) unchanged. I think we should continue to promote the feature even if it is not usable currently. 2. leave the `/feedback` menu item selectable and display an error saying it's disabled, rather than remove the menu item (which I believe would raise more questions). but happy to discuss these. This will be followed by a change to requirements.toml that admins can use to force the value of feedback.enabled.
This commit is contained in:
1 parent
ea56186c2b
commit
5b5a5b92b5
9 files changed
+97
No files matched your search
@@ -380,6 +380,21 @@ pub(crate) fn feedback_selection_params(
|
||||
}
|
||||
}
|
||||
|
||||
/// Build the selection popup params shown when feedback is disabled.
|
||||
pub(crate) fn feedback_disabled_params() -> super::SelectionViewParams {
|
||||
super::SelectionViewParams {
|
||||
title: Some("Sending feedback is disabled".to_string()),
|
||||
subtitle: Some("This action is disabled by configuration.".to_string()),
|
||||
footer_hint: Some(standard_popup_hint_line()),
|
||||
items: vec![super::SelectionItem {
|
||||
name: "Close".to_string(),
|
||||
dismiss_on_select: true,
|
||||
..Default::default()
|
||||
}],
|
||||
..Default::default()
|
||||
}
|
||||
}
|
||||
|
||||
fn make_feedback_item(
|
||||
app_event_tx: AppEventSender,
|
||||
name: &str,
|
||||
|
||||
@@ -32,6 +32,7 @@ mod prompt_args;
|
||||
mod skill_popup;
|
||||
pub(crate) use list_selection_view::SelectionViewParams;
|
||||
mod feedback_view;
|
||||
pub(crate) use feedback_view::feedback_disabled_params;
|
||||
pub(crate) use feedback_view::feedback_selection_params;
|
||||
pub(crate) use feedback_view::feedback_upload_consent_params;
|
||||
mod paste_burst;
|
||||
|
||||
@@ -1537,6 +1537,12 @@ impl ChatWidget {
|
||||
}
|
||||
match cmd {
|
||||
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;
|
||||
}
|
||||
// Step 1: pick a category (UI built in feedback_view)
|
||||
let params =
|
||||
crate::bottom_pane::feedback_selection_params(self.app_event_tx.clone());
|
||||
|
||||
Reference in new issue
Block a user