Only show notebook cell context menu items in notebook editor #10523
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.
Addresses #10518
This PR addresses the issue where the notebook cell context menu incorrectly appeared in the Output panel right-click menu WHEN a positron notebook was the active editor.
I did some testing and noticed that the Output pane was the only place I was seeing the notebook cell menu items. They don't show up if you right-click in the Primary or Secondary Side Bars. It turns that this is because the Output panel is a Monaco editor under the hood (based off a quick look at the dom elements via dev tools) and contributes its actions to
MenuId.EditorContextwhich is the menu used by editors (seeClear Output):positron/src/vs/workbench/contrib/output/browser/output.contribution.ts
Line 319 in 20c6627
MenuId.EditorContextalso check if the editor has focus via context keys likeeditorTextFocuswhich prevents them from showing up in the Output panel.I think the solution here is to do what the other editor commands do, and check if the notebook editor has focus.
BEFORE - notebook cell menu in output panel when a notebook is the active editor
Screen.Recording.2025-11-12.at.3.58.15.PM.mov
AFTER - no notebook cell menu in output panel when a notebook is the active editor
Screen.Recording.2025-11-12.at.3.59.52.PM.mov
Release Notes
New Features
Bug Fixes
QA Notes
the main testing notes are in #10518 for the regression.
We should also test to make sure the submenu still appears in positron notebooks as expected. I do want to point out that prior to this change, the notebook cell context menu only showed up when a user right-clicked in a cell when it was in edit mode this same behavior has been maintained. You can't right click on a markdown cell that is NOT in edit mode. I think this is because we contribute these menu items to the "Editor" menu and the view mode of a markdown cell is not an editor so the menu can't be brought up. I think this is something that we could fix in the future but isn't part of this issue.
@:positron-notebooks