Skip to content

Comments

sessions - allow to open editors in new window#296701

Open
bpasero wants to merge 1 commit intomainfrom
ben/cloudy-bobcat
Open

sessions - allow to open editors in new window#296701
bpasero wants to merge 1 commit intomainfrom
ben/cloudy-bobcat

Conversation

@bpasero
Copy link
Member

@bpasero bpasero commented Feb 21, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 21, 2026 07:27
@bpasero bpasero enabled auto-merge (squash) February 21, 2026 07:27
@bpasero bpasero self-assigned this Feb 21, 2026
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 21, 2026
Copy link
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

This pull request adds functionality to allow opening modal editors in a new window within sessions environments. The implementation introduces a new command that moves editors from a modal part to an auxiliary editor part (new window), complementing the existing functionality to move modal editors to the main window.

Changes:

  • Added new MOVE_MODAL_EDITOR_TO_WINDOW_COMMAND_ID command that creates an auxiliary editor part and moves all modal editors to it
  • Updated modal editor part to include the new command in the allowable commands list
  • Added a test case demonstrating the ability to move editors from modal to another group

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/vs/workbench/browser/parts/editor/editorCommands.ts Added new command MOVE_MODAL_EDITOR_TO_WINDOW_COMMAND_ID with async implementation that creates auxiliary editor part and moves modal editors to it
src/vs/workbench/browser/parts/editor/modalEditorPart.ts Added new command to defaultModalEditorAllowableCommands set and imported the command constant
src/vs/workbench/services/editor/test/browser/modalEditorGroup.test.ts Added test case validating that modal editor part editors can be moved to another group using moveEditors API
Comments suppressed due to low confidence (1)

src/vs/workbench/services/editor/test/browser/modalEditorGroup.test.ts:614

  • This test validates moving editors from modal to the main part group, but it doesn't test the new MOVE_MODAL_EDITOR_TO_WINDOW_COMMAND_ID functionality which moves editors to an auxiliary window (new window) via createAuxiliaryEditorPart(). Consider adding a test that specifically validates the new command's behavior of creating an auxiliary editor part and moving editors to it.
	test('modal editor part editors can be moved to another group', async () => {
		const instantiationService = workbenchInstantiationService({ contextKeyService: instantiationService => instantiationService.createInstance(MockScopableContextKeyService) }, disposables);
		instantiationService.invokeFunction(accessor => Registry.as<IEditorFactoryRegistry>(EditorExtensions.EditorFactory).start(accessor));
		const parts = await createEditorParts(instantiationService, disposables);
		instantiationService.stub(IEditorGroupsService, parts);

		// Create modal and open editors
		const modalPart = await parts.createModalEditorPart();
		const input1 = createTestFileEditorInput(URI.file('foo/bar'), TEST_EDITOR_INPUT_ID);
		const input2 = createTestFileEditorInput(URI.file('foo/baz'), TEST_EDITOR_INPUT_ID);
		await modalPart.activeGroup.openEditor(input1, { pinned: true });
		await modalPart.activeGroup.openEditor(input2, { pinned: true });

		assert.strictEqual(modalPart.activeGroup.count, 2);

		// Move editors from modal to main part group
		const targetGroup = parts.mainPart.activeGroup;
		for (const group of modalPart.getGroups(GroupsOrder.MOST_RECENTLY_ACTIVE)) {
			group.moveEditors(group.editors.map(editor => ({ editor, options: { preserveFocus: true } })), targetGroup);
		}

		// Editors should be in the target group now
		assert.strictEqual(targetGroup.count, 2);
		assert.strictEqual(modalPart.activeGroup.count, 0);

		// Close modal
		modalPart.close();
		assert.strictEqual(parts.activeModalEditorPart, undefined);
	});

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.

1 participant