Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 26, 2026

Settings editor with a filter query (e.g., @tag:accessibility) rendered all settings briefly before applying the filter.

Root Cause

setInput_setOptions sets search widget value (debounced search) → onConfigUpdate renders unfiltered tree → debounced search fires → re-render with filter.

Changes

In onConfigUpdate, trigger search synchronously before initial render when:

  • Search widget has a value
  • No search result model exists yet
  • Not in recursive call (new skipInitialSearch guard)
if (!skipInitialSearch && this.searchWidget.getValue() && !this.searchResultModel) {
    await this.onSearchInputChanged(true);
    return; // Skip unfiltered render
}

Recursion guard prevents infinite loop when triggerSearch calls onConfigUpdate to rebuild tree for advanced filter changes.

Original prompt

This section details on the original issue you should resolve

<issue_title>Settings: Opening settings editor with a filter will render settings twice</issue_title>
<issue_description>1. Run Preferences: Open Accessibility Settings

🐛 Settings editor opens and gets a 2 stage render: first all settings are displayed, then it filters down to only accessibility settings. This happens every time the settings editor opens anew, scoped to a particular filter.

https://github.com/user-attachments/assets/d2af5a62-fd1c-47b5-b7ca-8a37d7cfb429</issue_description>

<agent_instructions>In src\vs\workbench\contrib\preferences\browser\settingsEditor2.ts, check whether the editor can apply all filters first before rendering.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits January 26, 2026 23:31
When opening settings editor with a filter (e.g., "Preferences: Open Accessibility Settings"),
apply the filter before the initial render to prevent showing all settings briefly before
filtering down to the requested subset.

The fix checks if there's a query in viewState but no searchResultModel yet, and if so,
triggers onSearchInputChanged before rendering to ensure the filtered model is used
for the initial render.

Co-authored-by: rzhao271 <7199958+rzhao271@users.noreply.github.com>
When triggerSearch calls onConfigUpdate to rebuild the tree for advanced filter changes,
we need to skip the initial search logic to avoid infinite recursion.

Co-authored-by: rzhao271 <7199958+rzhao271@users.noreply.github.com>
Use searchWidget.getValue() instead of viewState.query to check if there's a search query.
This is more robust as getValue() returns the trimmed value, avoiding triggering
unnecessary searches for empty or whitespace-only queries. This also matches the
pattern used in the existing code (else branch).

Co-authored-by: rzhao271 <7199958+rzhao271@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix settings editor rendering twice with a filter Fix settings editor double render when opening with filter Jan 26, 2026
Copilot AI requested a review from rzhao271 January 26, 2026 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Settings: Opening settings editor with a filter will render settings twice

2 participants