Skip to content

Commit 2267472

Browse files
authored
feat: aria status for when results are not ready (#252320)
Also fixes up some localized strings for consistency
1 parent 2b10e9b commit 2267472

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

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

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,9 @@ export class SettingsEditor2 extends EditorPane {
766766

767767
toggleAiSearch(): void {
768768
if (this.showAiResultsAction) {
769+
if (!this.showAiResultsAction.enabled) {
770+
aria.status(localize('noAiResults', "No AI results available at this time."));
771+
}
769772
this.showAiResultsAction.checked = !this.showAiResultsAction.checked;
770773
}
771774
}
@@ -1931,17 +1934,19 @@ export class SettingsEditor2 extends EditorPane {
19311934
} else {
19321935
const count = this.searchResultModel.getUniqueResultsCount();
19331936
let resultString: string;
1934-
switch (count) {
1935-
case 0: resultString = localize('noResults', "No Settings Found"); break;
1936-
case 1: resultString = localize('oneResult', "1 Setting Found"); break;
1937-
default: resultString = localize('moreThanOneResult', "{0} Settings Found", count);
1938-
}
19391937

19401938
if (showAiResultsMessage) {
1941-
resultString += localize({
1942-
key: 'aiSearchResults',
1943-
comment: ['This string is appended after noResults, oneResult, or moreThanOneResult']
1944-
}, ". AI Results Available");
1939+
switch (count) {
1940+
case 0: resultString = localize('noResultsWithAiAvailable', "No Settings Found. AI Results Available"); break;
1941+
case 1: resultString = localize('oneResultWithAiAvailable', "1 Setting Found. AI Results Available"); break;
1942+
default: resultString = localize('moreThanOneResultWithAiAvailable', "{0} Settings Found. AI Results Available", count);
1943+
}
1944+
} else {
1945+
switch (count) {
1946+
case 0: resultString = localize('noResults', "No Settings Found"); break;
1947+
case 1: resultString = localize('oneResult', "1 Setting Found"); break;
1948+
default: resultString = localize('moreThanOneResult', "{0} Settings Found", count);
1949+
}
19451950
}
19461951

19471952
this.searchResultLabel = resultString;

0 commit comments

Comments
 (0)