Refactor NotebookCellOutline
layers to remove target
+ breadcrumb fix
#212002
+207
−167
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: #211998
This is conveniently part of the ongoing outline refactor to pull filters out of the primary outline provider, in favor of filtering at higher layers.
Previously, the
recomputeActive()
call withinNotebookCellOutlineProvider
was only resetting the outlineactiveElement
according to passing the threeoutlinePane
filters for headers, code cells, and symbols. ThisactiveElement
was also used by thebreadcrumbsDataSource
, which meant that if you have code cells filtered out of your outline pane, 🐛 you will never see your breadcrumbs update as long as you click through code cells (because the active element is never getting set).The fix:
NotebookCellOutlineProvider.activeElement
will now always hold the active entry, even if it will be filtered down the line.activeBreadcrumbsElement
. This allows us to filter code cells out of the outline pane while still showing them in breadcrumbs (if that's something someone would ever do... regardless.)New behavior to the outline pane:
This is only really relevant if you have
Follow Cursor
enabled for the view. Previously, if you were clicking around in cells that weren't directly displayed in the outline, the highlight in the outline just wouldn't move. Now, the selection will shift to the nearest valid parentOutlineEntry
of the cell you selected. Makes this feature a touch more useful.Current behavior:
20240504-0007-03.2021220.mp4
New Proposed behavior:
20240504-0010-56.7367964.mp4