fix(search): only show Notebook Find Filters toggle for visible notebooks#309137
Open
yogeshwaran-c wants to merge 1 commit into
Open
fix(search): only show Notebook Find Filters toggle for visible notebooks#309137yogeshwaran-c wants to merge 1 commit into
yogeshwaran-c wants to merge 1 commit into
Conversation
Previously the Notebook Find Filters button appeared in the search panel whenever any notebook editor was present in the list of open editors. With tabs disabled a notebook can stay opened without being visible, which caused the filter toggle to show when no notebook was actually on screen. Switch the check to editorService.visibleEditors and listen to onDidVisibleEditorsChange so the toggle only shows when a notebook is currently the active editor in some group. Fixes microsoft#224043
osortega
reviewed
May 15, 2026
| if (this.searchInput && | ||
| e.event.editor instanceof NotebookEditorInput && | ||
| (e.event.kind === GroupModelChangeKind.EDITOR_OPEN || e.event.kind === GroupModelChangeKind.EDITOR_CLOSE)) { | ||
| this._register(this.editorService.onDidVisibleEditorsChange(() => { |
Contributor
There was a problem hiding this comment.
Why removing the check here? Shouldn't the hasNotebookOpen change do the trick?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #224043
The Notebook Find Filters toggle in the Search view appeared whenever any notebook editor was present in the list of opened editors, even if no notebook was actually visible on screen. With tabs disabled this is easy to hit: a notebook can stay opened (still in the editor stack) without being the active editor in any group, and the toggle would still show even though there is no visible notebook to filter against.
This change:
_hasNotebookOpento useeditorService.visibleEditorsso we only consider notebooks that are currently active in some editor group.onDidVisibleEditorsChangeinstead ofonDidEditorsChange(filtered byEDITOR_OPEN/EDITOR_CLOSE), so the toggle reacts to a notebook becoming visible/hidden, not just to it being added/removed from the list of opened editors.The result is that the Notebook Find Filters button only appears when a notebook editor is actually visible.
Test plan
.ipynbfile. Confirm the toggle appears in the Search view.workbench.editor.showTabs: 'none'), open a notebook, then open a non-notebook editor on top. Confirm the toggle disappears even though the notebook is still in the editor stack.