Skip to content

Respect explorer.compactFolders in the search results tree#325654

Open
dobbydobap wants to merge 1 commit into
microsoft:mainfrom
dobbydobap:fix-301832-search-compactfolders
Open

Respect explorer.compactFolders in the search results tree#325654
dobbydobap wants to merge 1 commit into
microsoft:mainfrom
dobbydobap:fix-301832-search-compactfolders

Conversation

@dobbydobap

Copy link
Copy Markdown
Contributor

Fixes #301832. The Search view's results tree (WorkbenchCompressibleAsyncDataTree) never set compressionEnabled, so it always compacted single-child folders regardless of explorer.compactFolders. This reads the setting at construction and updates on change, mirroring how the Explorer view already does it no new setting, just honoring the existing one in Search too.

Copilot AI review requested due to automatic review settings July 13, 2026 16:55

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Search tree folder compression to honor explorer.compactFolders.

Changes:

  • Initializes Search tree compression from the setting.
  • Updates compression when the setting changes.

],
this.searchDataSource,
{
compressionEnabled: this.configurationService.getValue<boolean>('explorer.compactFolders'),
Comment on lines +1013 to +1014
this._register(Event.filter(this.configurationService.onDidChangeConfiguration, e => e.affectsConfiguration('explorer.compactFolders'))(() =>
this.tree.updateOptions({ compressionEnabled: this.configurationService.getValue<boolean>('explorer.compactFolders') })));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I'd only mirrored half of the Explorer's isCompressionEnabled. Added the screen-reader-optimized guard to compressionEnabled and a matching onDidChangeScreenReaderOptimized subscription so both update paths recompute together, same as explorerView. Thanks!

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.

Search pane compacts folders despite "explorer.compactFolders": false in settings

3 participants