Skip to content

Add notebook commands to collapse code cell inputs#317045

Open
AlexanderMerkel wants to merge 1 commit into
microsoft:mainfrom
AlexanderMerkel:notebook-collapse-code-cell-inputs
Open

Add notebook commands to collapse code cell inputs#317045
AlexanderMerkel wants to merge 1 commit into
microsoft:mainfrom
AlexanderMerkel:notebook-collapse-code-cell-inputs

Conversation

@AlexanderMerkel
Copy link
Copy Markdown

Adds command-palette actions to collapse and expand inputs for code cells only:

  • Notebook: Collapse All Code Cell Inputs
  • Notebook: Expand All Code Cell Inputs

The existing all-cell input collapse/expand commands are unchanged. These new commands let notebook users hide code inputs while keeping rendered markdown cells visible, which is useful for presentation-style notebook reading.

Testing:

  • npm run compile-check-ts-native
  • npm run valid-layers-check
  • node node_modules/eslint/bin/eslint.js --quiet src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.ts
  • node test/unit/browser/index.js --run src/vs/workbench/contrib/notebook/test/browser/view/cellPart.test.ts --browser chromium --sequential

Fixes #212186

Copilot AI review requested due to automatic review settings May 18, 2026 15:04
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds notebook command-palette actions for collapsing and expanding inputs on code cells only, leaving markdown cell inputs unaffected.

Changes:

  • Introduces command IDs for collapsing/expanding all code cell inputs.
  • Registers two new notebook actions in the Command Palette.
  • Adds a helper to iterate only code cells.

@AlexanderMerkel
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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.

Collapse/expand all code cells in jupyter notebook editor

3 participants