8000 feat: add AI results available message to count element by rzhao271 · Pull Request #252315 · microsoft/vscode · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: add AI results available message to count element #252315

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,7 @@ export class SettingsEditor2 extends EditorPane {
private async onDidToggleAiSearch(): Promise<void> {
if (this.searchResultModel && this.showAiResultsAction) {
this.searchResultModel.showAiResults = this.showAiResultsAction.checked ?? false;
this.renderResultCountMessages(false);
this.onDidFinishSearch(true, undefined);
}
}
Expand Down Expand Up @@ -1596,7 +1597,7 @@ export class SettingsEditor2 extends EditorPane {
}
}

this.renderResultCountMessages();
this.renderResultCountMessages(false);

if (key) {
const elements = this.currentSettingsModel?.getElementsByName(key);
Expand Down Expand Up @@ -1735,14 +1736,14 @@ export class SettingsEditor2 extends EditorPane {
this.tocTree.expandAll();
}
this.refreshTOCTree();
this.renderResultCountMessages();
this.renderResultCountMessages(false);
this.refreshTree();
this.toggleTocBySearchBehaviorType();
} else if (!this.tocTreeDisposed) {
// Leaving search mode
this.tocTree.collapseAll();
this.refreshTOCTree();
this.renderResultCountMessages();
this.renderResultCountMessages(false);
this.refreshTree();
this.layoutSplitView(this.dimension);
}
Expand Down Expand Up @@ -1819,6 +1820,7 @@ export class SettingsEditor2 extends EditorPane {
return this.doAiSearch(query, token).then((results) => {
if (results && this.showAiResultsAction) {
this.showAiResultsAction.enabled = true;
this.renderResultCountMessages(true);
}
}).catch(e => {
if (!isCancellationError(e)) {
Expand Down Expand Up @@ -1905,7 +1907,7 @@ export class SettingsEditor2 extends EditorPane {
return result;
}

private renderResultCountMessages() {
private renderResultCountMessages(showAiResultsMessage: boolean) {
if (!this.currentSettingsModel) {
return;
}
Expand Down Expand Up @@ -1935,6 +1937,13 @@ export class SettingsEditor2 extends EditorPane {
default: resultString = localize('moreThanOneResult', "{0} Settings Found", count);
}

if (showAiResultsMessage) {
resultString += localize({
key: 'aiSearchResults',
comment: ['This string is appended after noResults, oneResult, or moreThanOneResult']
}, ". AI Results Available");
}

this.searchResultLabel = resultString;
this.updateInputAriaLabel();
this.countElement.innerText = resultString;
Expand Down
Loading
0