From 61b5a3c89fd761a594c15c580646f0000f26653b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 10 Dec 2025 02:19:50 +0000 Subject: [PATCH 1/3] Initial plan From 4b618ecf1425efbeee346448ce4ad88988823d91 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 10 Dec 2025 02:30:04 +0000 Subject: [PATCH 2/3] Add toggle command for inline/side-by-side diff view - Added ToggleDiffSideBySide action to toggle between inline and side-by-side diff views - Registered the action with icon and menu placement in editor title bar - Action appears in diff editor navigation with split horizontal icon - Toggles renderSideBySide configuration setting Co-authored-by: DonJayamanne <1948812+DonJayamanne@users.noreply.github.com> --- .../browser/widget/diffEditor/commands.ts | 24 +++++++++++++++++++ .../diffEditor/diffEditor.contribution.ts | 3 ++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/vs/editor/browser/widget/diffEditor/commands.ts b/src/vs/editor/browser/widget/diffEditor/commands.ts index 425266acea8d1..c8f0075f313a7 100644 --- a/src/vs/editor/browser/widget/diffEditor/commands.ts +++ b/src/vs/editor/browser/widget/diffEditor/commands.ts @@ -78,6 +78,30 @@ export class ToggleUseInlineViewWhenSpaceIsLimited extends Action2 { } } +export class ToggleDiffSideBySide extends Action2 { + constructor() { + super({ + id: 'diffEditor.toggleDiffSideBySide', + title: localize2('toggleDiffSideBySide', 'Toggle Inline View'), + icon: Codicon.splitHorizontal, + toggled: EditorContextKeys.diffEditorInlineMode.toNegated(), + precondition: ContextKeyExpr.has('isInDiffEditor'), + menu: { + when: ContextKeyExpr.has('isInDiffEditor'), + id: MenuId.EditorTitle, + order: 21, + group: 'navigation', + }, + }); + } + + run(accessor: ServicesAccessor, ...args: unknown[]): void { + const configurationService = accessor.get(IConfigurationService); + const newValue = !configurationService.getValue('diffEditor.renderSideBySide'); + configurationService.updateValue('diffEditor.renderSideBySide', newValue); + } +} + const diffEditorCategory: ILocalizedString = localize2('diffEditor', "Diff Editor"); export class SwitchSide extends EditorAction2 { diff --git a/src/vs/editor/browser/widget/diffEditor/diffEditor.contribution.ts b/src/vs/editor/browser/widget/diffEditor/diffEditor.contribution.ts index d264028a74950..b12b0ddb21653 100644 --- a/src/vs/editor/browser/widget/diffEditor/diffEditor.contribution.ts +++ b/src/vs/editor/browser/widget/diffEditor/diffEditor.contribution.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { Codicon } from '../../../../base/common/codicons.js'; -import { AccessibleDiffViewerNext, AccessibleDiffViewerPrev, CollapseAllUnchangedRegions, ExitCompareMove, RevertHunkOrSelection, ShowAllUnchangedRegions, SwitchSide, ToggleCollapseUnchangedRegions, ToggleShowMovedCodeBlocks, ToggleUseInlineViewWhenSpaceIsLimited } from './commands.js'; +import { AccessibleDiffViewerNext, AccessibleDiffViewerPrev, CollapseAllUnchangedRegions, ExitCompareMove, RevertHunkOrSelection, ShowAllUnchangedRegions, SwitchSide, ToggleCollapseUnchangedRegions, ToggleDiffSideBySide, ToggleShowMovedCodeBlocks, ToggleUseInlineViewWhenSpaceIsLimited } from './commands.js'; import { EditorContextKeys } from '../../../common/editorContextKeys.js'; import { localize } from '../../../../nls.js'; import { MenuId, MenuRegistry, registerAction2 } from '../../../../platform/actions/common/actions.js'; @@ -15,6 +15,7 @@ import './registrations.contribution.js'; registerAction2(ToggleCollapseUnchangedRegions); registerAction2(ToggleShowMovedCodeBlocks); registerAction2(ToggleUseInlineViewWhenSpaceIsLimited); +registerAction2(ToggleDiffSideBySide); MenuRegistry.appendMenuItem(MenuId.EditorTitle, { command: { From c0be036ad86c39503477c2b4eab323bd3efe455f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 10 Dec 2025 02:36:26 +0000 Subject: [PATCH 3/3] Add F1 command palette support for toggle inline view - Added f1: true and category to make command discoverable in command palette - Moved diffEditorCategory definition before usage for proper scope - Command now accessible via "Diff Editor: Toggle Inline View" in command palette Co-authored-by: DonJayamanne <1948812+DonJayamanne@users.noreply.github.com> --- src/vs/editor/browser/widget/diffEditor/commands.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vs/editor/browser/widget/diffEditor/commands.ts b/src/vs/editor/browser/widget/diffEditor/commands.ts index c8f0075f313a7..a3c2b7f212b4d 100644 --- a/src/vs/editor/browser/widget/diffEditor/commands.ts +++ b/src/vs/editor/browser/widget/diffEditor/commands.ts @@ -78,6 +78,8 @@ export class ToggleUseInlineViewWhenSpaceIsLimited extends Action2 { } } +const diffEditorCategory: ILocalizedString = localize2('diffEditor', "Diff Editor"); + export class ToggleDiffSideBySide extends Action2 { constructor() { super({ @@ -86,6 +88,8 @@ export class ToggleDiffSideBySide extends Action2 { icon: Codicon.splitHorizontal, toggled: EditorContextKeys.diffEditorInlineMode.toNegated(), precondition: ContextKeyExpr.has('isInDiffEditor'), + f1: true, + category: diffEditorCategory, menu: { when: ContextKeyExpr.has('isInDiffEditor'), id: MenuId.EditorTitle, @@ -102,8 +106,6 @@ export class ToggleDiffSideBySide extends Action2 { } } -const diffEditorCategory: ILocalizedString = localize2('diffEditor', "Diff Editor"); - export class SwitchSide extends EditorAction2 { constructor() { super({