Skip to content

Fix cell editor context menu missing actions#13798

Open
seeM wants to merge 4 commits into
refactor/cell-context-key-servicefrom
bugfix/editor-submenu-context-keys
Open

Fix cell editor context menu missing actions#13798
seeM wants to merge 4 commits into
refactor/cell-context-key-servicefrom
bugfix/editor-submenu-context-keys

Conversation

@seeM
Copy link
Copy Markdown
Contributor

@seeM seeM commented May 27, 2026

Fixes #10466

Cell-scoped context keys (e.g. positronNotebookCellIsFirst) were not visible to cell editor menus because the editor's context key service was scoped to the notebook - not the cell.

Release Notes

New Features

  • N/A

Bug Fixes

Validation Steps

@:notebooks @:positron-notebooks

  1. Open a notebook with multiple cells
  2. Right-click inside the editor of the second cell
  3. Verify the "Notebook Cells" submenu contains "Run All Above"
  4. Run "Run All Above" and verify the first cell executes
  5. Right-click inside the editor of the first cell
  6. Verify "Run All Above" does not appear (it is conditional on not being the first cell)

seeM added 4 commits May 27, 2026 14:59
Replaces the useCellContextKeys hook with a CellContextKeyManager that is
created when the cell container is attached. This moves context key lifecycle
management out of the React layer and into the cell model, keeping the scoped
context key service on the cell instance for consumers to access directly.
…scope

The editor's scoped context key service was created as a sibling of the
cell's scope (both children of the notebook scope). This meant cell-level
context keys like positronNotebookCellIsFirst were invisible to menus
evaluated inside the editor. Fix by creating the editor scope as a child
of the cell's scope via useCellScopedContextKeyService().
@seeM seeM changed the title Fix editor submenu context keys by parenting editor scope under cell scope Fix cell editor context menu missing actions May 27, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 27, 2026

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

readme  valid tags

@seeM seeM requested a review from nstrayer May 27, 2026 14:41
Copy link
Copy Markdown
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.

🫡 Thank you for your bravery and dealing with scoped context keys.

@seeM seeM force-pushed the refactor/cell-context-key-service branch 2 times, most recently from 523ba5e to 357e4f8 Compare May 28, 2026 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants