disable feedback options when setting is enabled (#244285)

* disable feedback

* swap
This commit is contained in:
Justin Chen
2025-03-21 15:36:34 -07:00
committed by GitHub
parent bd3dfc4726
commit aee64540d1

View File

@@ -41,6 +41,7 @@ import { ChatViewPane } from '../chatViewPane.js';
import { CHAT_CATEGORY } from './chatActions.js';
export const MarkUnhelpfulActionId = 'workbench.action.chat.markUnhelpful';
const disableFeedbackConfig = 'config.telemetry.disableFeedback';
export function registerChatTitleActions() {
registerAction2(class MarkHelpfulAction extends Action2 {
@@ -56,12 +57,12 @@ export function registerChatTitleActions() {
id: MenuId.ChatMessageFooter,
group: 'navigation',
order: 1,
when: ContextKeyExpr.and(ChatContextKeys.isResponse, ChatContextKeys.responseHasError.negate())
when: ContextKeyExpr.and(ChatContextKeys.isResponse, ChatContextKeys.responseHasError.negate(), ContextKeyExpr.has(disableFeedbackConfig).negate())
}, {
id: MENU_INLINE_CHAT_WIDGET_SECONDARY,
group: 'navigation',
order: 1,
when: ContextKeyExpr.and(ChatContextKeys.isResponse, ChatContextKeys.responseHasError.negate())
when: ContextKeyExpr.and(ChatContextKeys.isResponse, ChatContextKeys.responseHasError.negate(), ContextKeyExpr.has(disableFeedbackConfig).negate())
}]
});
}
@@ -103,12 +104,12 @@ export function registerChatTitleActions() {
id: MenuId.ChatMessageFooter,
group: 'navigation',
order: 2,
when: ContextKeyExpr.and(ChatContextKeys.isResponse)
when: ContextKeyExpr.and(ChatContextKeys.isResponse, ContextKeyExpr.has(disableFeedbackConfig).negate())
}, {
id: MENU_INLINE_CHAT_WIDGET_SECONDARY,
group: 'navigation',
order: 2,
when: ContextKeyExpr.and(ChatContextKeys.isResponse, ChatContextKeys.responseHasError.negate())
when: ContextKeyExpr.and(ChatContextKeys.isResponse, ChatContextKeys.responseHasError.negate(), ContextKeyExpr.has(disableFeedbackConfig).negate())
}]
});
}
@@ -155,12 +156,12 @@ export function registerChatTitleActions() {
id: MenuId.ChatMessageFooter,
group: 'navigation',
order: 3,
when: ContextKeyExpr.and(ChatContextKeys.responseSupportsIssueReporting, ChatContextKeys.isResponse)
when: ContextKeyExpr.and(ChatContextKeys.responseSupportsIssueReporting, ChatContextKeys.isResponse, ContextKeyExpr.has(disableFeedbackConfig).negate())
}, {
id: MENU_INLINE_CHAT_WIDGET_SECONDARY,
group: 'navigation',
order: 3,
when: ContextKeyExpr.and(ChatContextKeys.responseSupportsIssueReporting, ChatContextKeys.isResponse)
when: ContextKeyExpr.and(ChatContextKeys.responseSupportsIssueReporting, ChatContextKeys.isResponse, ContextKeyExpr.has(disableFeedbackConfig).negate())
}]
});
}