Skip to content
Draft
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
12 changes: 10 additions & 2 deletions src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1464,7 +1464,7 @@ export class SettingsEditor2 extends EditorPane {
this.settingsOrderByTocIndex = this.createSettingsOrderByTocIndex(resolvedSettingsRoot);
}

private async onConfigUpdate(keys?: ReadonlySet<string>, forceRefresh = false, triggerSearch = false): Promise<void> {
private async onConfigUpdate(keys?: ReadonlySet<string>, forceRefresh = false, triggerSearch = false, skipInitialSearch = false): Promise<void> {
if (keys && this.settingsTreeModel) {
return this.updateElementsByKey(keys);
}
Expand Down Expand Up @@ -1634,6 +1634,14 @@ export class SettingsEditor2 extends EditorPane {
return await this.onSearchInputChanged(false);
}

// If there's a query present (e.g., opening with a filter like @tag:accessibility),
// trigger the search before rendering to avoid showing all settings first
if (!skipInitialSearch && this.searchWidget.getValue() && !this.searchResultModel) {
await this.onSearchInputChanged(true);
// onSearchInputChanged already handles refreshing TOC and rendering the tree
return;
}

this.refreshTOCTree();
this.renderTree(undefined, forceRefresh);

Expand Down Expand Up @@ -1863,7 +1871,7 @@ export class SettingsEditor2 extends EditorPane {
}

if (showAdvanced !== this.viewState.tagFilters?.has(ADVANCED_SETTING_TAG)) {
await this.onConfigUpdate();
await this.onConfigUpdate(undefined, false, false, true);
}

this.settingsTargetsWidget.updateLanguageFilterIndicators(this.viewState.languageFilter);
Expand Down