Skip to content

Conversation

@dhruvisompura
Copy link
Contributor

@dhruvisompura dhruvisompura commented Nov 13, 2025

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.EditorContext which is the menu used by editors (see Clear Output):

. This is the same menu that the notebook cell actions are contributed too. Other editor specific actions such as "Go To Definition" which are contributed to MenuId.EditorContext also check if the editor has focus via context keys like editorTextFocus which 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

  • N/A

Bug Fixes

  • N/A

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

@github-actions
Copy link

github-actions bot commented Nov 13, 2025

E2E Tests 🚀
This PR will run tests tagged with: @:critical @:positron-notebooks

readme  valid tags

Copy link
Contributor

@nstrayer nstrayer left a comment

Choose a reason for hiding this comment

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

Good catch. Glad it's just as simple as messing with the when clause!

@dhruvisompura dhruvisompura merged commit 8795f34 into main Nov 15, 2025
19 of 20 checks passed
@dhruvisompura dhruvisompura deleted the bugfix/notebook-cell-submenu branch November 15, 2025 00:54
@github-actions github-actions bot locked and limited conversation to collaborators Nov 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants