Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 10, 2025

The notebook.cellToolbarLocation setting used an object format ({"default": "right"}) to support notebook-type-specific configurations, but this was confusing for users. The setting is now a simple enum matching the pattern of notebook.cellToolbarVisibility.

Changes

  • Setting schema: Changed from type: 'object' to type: 'string' with enum: ['left', 'right', 'hidden']
  • Type definitions: Updated NotebookDisplayOptions.cellToolbarLocation to 'left' | 'right' | 'hidden'
  • Migration: Added automatic conversion from old object format to new enum format across all configuration scopes
  • Code simplification: Removed notebook-type-specific logic from computeCellToolbarLocation() and ToggleCellToolbarPositionAction
  • Tests: Updated to verify enum-based toggling

Migration Behavior

Old settings are automatically converted on startup:

  • {"default": "right"}"right"
  • {"default": "left", "jupyter-notebook": "hidden"}"left" (extracts default key)
  • Missing or invalid values → "right" (fallback)

The migration updates settings in-place across user, workspace, and folder configuration scopes.

Original prompt

This section details on the original issue you should resolve

<issue_title>Unclear what adding an item does</issue_title>
<issue_description>Testing #125013

unclear
</issue_description>

<agent_instructions>The only values support in the key are right , left, hidden
One cannot add mutliple items into the list, you can only have one key default
Ideally this setting needs to be based on an enum with the default being right

Change this setting to be a enum instead of an object. like notebook.cellToolbarVisibility.
Write code to ensure we migrate the old user settings into new.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@roblourens @rebornix are we going to make this a flat value again instead of the object with type keys? @rebornix @roblourens I like this to be a flat value but only after we have a generic way to specify "notebookType" scoped settings. @rebornix I wish to have intellisense for the keys in the settings editor somehow, though @roblourens Why leave it for just this one setting though? It's confusing. If you want to leave it, update the description to explain the keys @rebornix > Why leave it for just this one setting though? It's confusing.

Note that this setting was there for quite a while, way before we started working on notebook profile. We didn't add such style of new customizations we recently introduced. Why leave it? we are not going to break jupyter users without giving them a fallback.

If you want to leave it, update the description to explain the keys

I already did that additionalProperties#markdownDescription, Settings Editor didn't pick it up.

[CellToolbarLocation]: {
			description: nls.localize('notebook.cellToolbarLocation.description', "Where the cell toolbar should be shown, or whether it should be hidden."),
			type: 'object',
			additionalProperties: {
				markdownDescription: nls.localize('notebook.cellToolbarLocation.viewType', "Configure the cell toolbar position for for specific file types"),
				type: 'string',
				enum: ['left', 'right', 'hidden']
			},
			default: {
				'default': 'right'
			},
			tags: ['notebookLayout']
		},
```</body></comment_new>
<comment_new><author>@roblourens</author><body>
I mean the keys that correspond to notebook types</body></comment_new>
<comment_new><author>@roblourens</author><body>
I wonder whether we could make these flat values and just have users use settings profiles or workspace settings.</body></comment_new>
</comments>


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: DonJayamanne <1948812+DonJayamanne@users.noreply.github.com>
Copilot AI changed the title [WIP] Update item addition setting to use enum Convert notebook.cellToolbarLocation from object to enum Dec 10, 2025
Copilot AI requested a review from DonJayamanne December 10, 2025 02:12
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.

Unclear what adding an item does

2 participants