Skip to content

Commit 4040ecd

Browse files
authored
fix: use separate label for disabled sparkle toggle (#252455)
1 parent b84b028 commit 4040ecd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,11 @@ interface IFocusEventFromScroll extends KeyboardEvent {
9797
const searchBoxLabel = localize('SearchSettings.AriaLabel', "Search settings");
9898
const SEARCH_TOC_BEHAVIOR_KEY = 'workbench.settings.settingsSearchTocBehavior';
9999

100+
const SHOW_AI_RESULTS_ENABLED_LABEL = localize('showAiResultsEnabled', "Show AI-recommended results");
101+
const SHOW_AI_RESULTS_DISABLED_LABEL = localize('showAiResultsDisabled', "No AI results available at this time...");
102+
100103
const SETTINGS_EDITOR_STATE_KEY = 'settingsEditorState';
104+
101105
export class SettingsEditor2 extends EditorPane {
102106

103107
static readonly ID: string = 'workbench.editor.settings2';
@@ -335,6 +339,7 @@ export class SettingsEditor2 extends EditorPane {
335339
if (this.showAiResultsAction) {
336340
this.showAiResultsAction.checked = false;
337341
this.showAiResultsAction.enabled = false;
342+
this.showAiResultsAction.label = SHOW_AI_RESULTS_DISABLED_LABEL;
338343
}
339344
}
340345

@@ -666,7 +671,7 @@ export class SettingsEditor2 extends EditorPane {
666671

667672
const showAiResultActionClassNames = ['action-label', ThemeIcon.asClassName(preferencesAiResultsIcon)];
668673
this.showAiResultsAction = this._register(new Action(SETTINGS_EDITOR_COMMAND_SHOW_AI_RESULTS,
669-
localize('showAiResults', "Show AI-recommended results"), showAiResultActionClassNames.join(' '), true
674+
SHOW_AI_RESULTS_DISABLED_LABEL, showAiResultActionClassNames.join(' '), true
670675
));
671676
this._register(this.showAiResultsAction.onDidChange(async () => {
672677
await this.onDidToggleAiSearch();
@@ -1823,6 +1828,7 @@ export class SettingsEditor2 extends EditorPane {
18231828
return this.doAiSearch(query, token).then((results) => {
18241829
if (results && this.showAiResultsAction) {
18251830
this.showAiResultsAction.enabled = true;
1831+
this.showAiResultsAction.label = SHOW_AI_RESULTS_ENABLED_LABEL;
18261832
this.renderResultCountMessages(true);
18271833
}
18281834
}).catch(e => {

0 commit comments

Comments
 (0)