Fix logic for notebook outline data source isEmpty() fn #236525
Merged
+39
−22
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.
Fixes: #208553
Slightly different fix than expected. The notebook outline datasource will send all entries to the view provider, and then the viewprovider will filter out entries based on the relevant notebook outline filters.
However, the placeholder message referenced by this issue is controlled by the outline pane checking the outline's isEmpty fn. This calls down to the data source, which just checks if there is a nonzero number of entries.
Issue is that it doesn't take into account that entries do exist, but may be filtered out by the view provider.
Fix is to just bulk up the logic for isEmpty, checking the entries against the outline filters to take into account what the user will see vs the entries object itself.
cc/ @rebornix, previously we discussed keeping the outline filters out of certain layers. We had one of the settings here already, as it related to computing symbols. This pulls in the other two, but still keeps the filtering concept out of the data source itself which is what we initially tried to avoid.
Fixed behavior:
20241218-2142-48.4952111.mp4