@codingame/monaco-vscode-workbench-service-override 37.5.0 → 37.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +2 -2
- package/package.json +10 -10
- package/session.js +45 -28
- package/vscode/src/vs/sessions/browser/singlePaneWorkbench.d.ts +76 -0
- package/vscode/src/vs/sessions/browser/singlePaneWorkbench.js +320 -0
- package/vscode/src/vs/sessions/contrib/accountMenu/browser/account.contribution.js +42 -42
- package/vscode/src/vs/sessions/contrib/accountMenu/browser/chatPetAchievementBadges.js +11 -11
- package/vscode/src/vs/sessions/contrib/aiCustomizationTreeView/browser/aiCustomizationTreeView.contribution.js +18 -18
- package/vscode/src/vs/sessions/contrib/aiCustomizationTreeView/browser/aiCustomizationTreeViewViews.js +12 -12
- package/vscode/src/vs/sessions/contrib/applyCommitsToParentRepo/browser/applyChangesToParentRepo.js +7 -7
- package/vscode/src/vs/sessions/contrib/aquarium/browser/aquarium.contribution.js +12 -12
- package/vscode/src/vs/sessions/contrib/aquarium/browser/aquariumOverlay.js +10 -10
- package/vscode/src/vs/sessions/contrib/automations/browser/automationDialog.js +68 -68
- package/vscode/src/vs/sessions/contrib/automations/browser/automationDialogService.js +7 -7
- package/vscode/src/vs/sessions/contrib/automations/browser/automationRunner.js +4 -4
- package/vscode/src/vs/sessions/contrib/automations/browser/automationScheduler.js +2 -2
- package/vscode/src/vs/sessions/contrib/automations/browser/automationTools.js +38 -38
- package/vscode/src/vs/sessions/contrib/automations/browser/automations.contribution.js +2 -2
- package/vscode/src/vs/sessions/contrib/automations/browser/providerAutomationService.js +1 -1
- package/vscode/src/vs/sessions/contrib/changes/browser/changes.contribution.js +6 -6
- package/vscode/src/vs/sessions/contrib/changes/browser/changesActions.js +4 -4
- package/vscode/src/vs/sessions/contrib/changes/browser/changesViewActions.js +20 -20
- package/vscode/src/vs/sessions/contrib/changes/browser/changesetReviewActions.js +1 -1
- package/vscode/src/vs/sessions/contrib/changes/browser/sessionSyncChanges.js +9 -9
- package/vscode/src/vs/sessions/contrib/changes/browser/sessionsChangesAccessibilityHelp.js +17 -17
- package/vscode/src/vs/sessions/contrib/chat/browser/sessionChatInputToolbarDebug.js +17 -17
- package/vscode/src/vs/sessions/contrib/chatDebug/browser/chatDebug.contribution.js +2 -2
- package/vscode/src/vs/sessions/contrib/codeReview/browser/codeReview.contributions.js +2 -2
- package/vscode/src/vs/sessions/contrib/customViewTest/browser/customViewTest.contribution.js +7 -7
- package/vscode/src/vs/sessions/contrib/editor/browser/addTabActions.js +9 -7
- package/vscode/src/vs/sessions/contrib/editor/browser/editor.contribution.js +8 -8
- package/vscode/src/vs/sessions/contrib/editor/browser/emptyFileEditor.contribution.js +1 -1
- package/vscode/src/vs/sessions/contrib/editor/browser/emptyFileEditor.js +5 -5
- package/vscode/src/vs/sessions/contrib/editor/browser/emptyFileEditorInput.js +1 -1
- package/vscode/src/vs/sessions/contrib/files/browser/files.contribution.js +7 -7
- package/vscode/src/vs/sessions/contrib/files/browser/filesView.js +1 -1
- package/vscode/src/vs/sessions/contrib/layout/browser/baseSessionLayoutController.js +5 -24
- package/vscode/src/vs/sessions/contrib/layout/browser/sessions.layout.contribution.js +2 -2
- package/vscode/src/vs/sessions/contrib/layout/browser/singlePane/singlePaneExistingSessionStrategy.js +1 -1
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/newSessionViewV3Prompt.js +19 -19
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionTour.js +4 -4
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionViewTour.js +6 -6
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionViewTourShared.js +2 -2
- package/vscode/src/vs/sessions/contrib/onboardingTours/browser/tours/newSessionViewV2Tour.js +4 -4
- package/vscode/src/vs/sessions/contrib/policyBlocked/browser/sessionsPolicyBlocked.js +24 -24
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostClaudePermissionModePicker.js +3 -3
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostCodexApprovalsPicker.js +3 -3
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostModePicker.js +2 -2
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostPermissionPickerDelegate.js +8 -8
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionBranchActions.js +3 -3
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionConfigPicker.js +32 -32
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentMergeActions.js +29 -29
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/exportDebugLogsAction.js +1 -1
- package/vscode/src/vs/sessions/contrib/providers/agentHost/browser/mobile/mobileChatInputConfigPicker.js +3 -3
- package/vscode/src/vs/sessions/contrib/providers/remoteAgentHost/browser/devContainerAgentHostService.js +6 -6
- package/vscode/src/vs/sessions/contrib/search/browser/search.contribution.js +3 -3
- package/vscode/src/vs/sessions/contrib/search/browser/searchEditorEmptyState.contribution.js +1 -1
- package/vscode/src/vs/sessions/contrib/sessions/browser/blockedSessionsIndicatorModel.js +4 -4
- package/vscode/src/vs/sessions/contrib/sessions/browser/blockedSessionsList.js +5 -5
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionDetailsAction.js +2 -2
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessions.contribution.js +8 -8
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsActions.js +58 -58
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsTitleBarWidget.js +8 -8
- package/vscode/src/vs/sessions/contrib/sessions/browser/sessionsWindowNotifier.js +5 -5
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/automationTemplates.js +10 -10
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/automationsAccessibility.js +38 -38
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/automationsView.js +118 -118
- package/vscode/src/vs/sessions/contrib/sessions/browser/views/sessionsViewActions.js +53 -53
- package/vscode/src/vs/sessions/contrib/terminal/browser/agentHostSessionTaskRunner.js +1 -1
- package/vscode/src/vs/sessions/contrib/terminal/browser/sessionsTerminalContribution.js +2 -2
- package/vscode/src/vs/sessions/services/sessions/browser/sessionsManagementService.js +2 -2
- package/vscode/src/vs/sessions/services/sessions/browser/sessionsService.js +2 -2
- package/vscode/src/vs/workbench/browser/layout.d.ts +46 -70
- package/vscode/src/vs/workbench/browser/layout.js +243 -44
- package/vscode/src/vs/workbench/browser/workbench.d.ts +1 -1
- package/vscode/src/vs/workbench/browser/workbench.js +3 -4
package/index.js
CHANGED
|
@@ -52,9 +52,9 @@ let CustomWorkbench = class CustomWorkbench extends Workbench {
|
|
|
52
52
|
initServices() {
|
|
53
53
|
return this.instantiationService;
|
|
54
54
|
}
|
|
55
|
-
restore(
|
|
55
|
+
restore(instantiationService) {
|
|
56
56
|
try {
|
|
57
|
-
this.restoreParts(
|
|
57
|
+
this.restoreParts(instantiationService);
|
|
58
58
|
}
|
|
59
59
|
catch (error) {
|
|
60
60
|
onUnexpectedError(error);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-workbench-service-override",
|
|
3
|
-
"version": "37.
|
|
3
|
+
"version": "37.6.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - workbench service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,15 +15,15 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-api": "37.
|
|
19
|
-
"@codingame/monaco-vscode-environment-service-override": "37.
|
|
20
|
-
"@codingame/monaco-vscode-katex-common": "37.
|
|
21
|
-
"@codingame/monaco-vscode-keybindings-service-override": "37.
|
|
22
|
-
"@codingame/monaco-vscode-quickaccess-service-override": "37.
|
|
23
|
-
"@codingame/monaco-vscode-view-banner-service-override": "37.
|
|
24
|
-
"@codingame/monaco-vscode-view-common-service-override": "37.
|
|
25
|
-
"@codingame/monaco-vscode-view-status-bar-service-override": "37.
|
|
26
|
-
"@codingame/monaco-vscode-view-title-bar-service-override": "37.
|
|
18
|
+
"@codingame/monaco-vscode-api": "37.6.1",
|
|
19
|
+
"@codingame/monaco-vscode-environment-service-override": "37.6.1",
|
|
20
|
+
"@codingame/monaco-vscode-katex-common": "37.6.1",
|
|
21
|
+
"@codingame/monaco-vscode-keybindings-service-override": "37.6.1",
|
|
22
|
+
"@codingame/monaco-vscode-quickaccess-service-override": "37.6.1",
|
|
23
|
+
"@codingame/monaco-vscode-view-banner-service-override": "37.6.1",
|
|
24
|
+
"@codingame/monaco-vscode-view-common-service-override": "37.6.1",
|
|
25
|
+
"@codingame/monaco-vscode-view-status-bar-service-override": "37.6.1",
|
|
26
|
+
"@codingame/monaco-vscode-view-title-bar-service-override": "37.6.1"
|
|
27
27
|
},
|
|
28
28
|
"main": "index.js",
|
|
29
29
|
"module": "index.js",
|
package/session.js
CHANGED
|
@@ -21,6 +21,7 @@ import { SessionsParts } from './vscode/src/vs/sessions/browser/parts/sessionsPa
|
|
|
21
21
|
import { SessionsSetUpService } from './vscode/src/vs/sessions/browser/sessionsSetUpService.js';
|
|
22
22
|
import { ISessionsSetUpService } from '@codingame/monaco-vscode-api/vscode/vs/sessions/browser/sessionsSetUpService.service';
|
|
23
23
|
import { Workbench } from '@codingame/monaco-vscode-api/vscode/vs/sessions/browser/workbench';
|
|
24
|
+
import { SinglePaneWorkbench } from './vscode/src/vs/sessions/browser/singlePaneWorkbench.js';
|
|
24
25
|
import { IDevContainerAgentHostService } from '@codingame/monaco-vscode-api/vscode/vs/sessions/common/devContainerAgentHostService.service';
|
|
25
26
|
import { ChatDashboardServiceImpl } from './vscode/src/vs/sessions/contrib/accountMenu/browser/account.contribution.js';
|
|
26
27
|
import { IAgentFeedbackService } from '@codingame/monaco-vscode-api/vscode/vs/sessions/contrib/agentFeedback/browser/agentFeedbackService.service';
|
|
@@ -120,6 +121,7 @@ import { EditorParts } from './vscode/src/vs/sessions/browser/parts/editorParts.
|
|
|
120
121
|
import getServiceOverride$3 from '@codingame/monaco-vscode-environment-service-override';
|
|
121
122
|
export { agentHostUri } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentHostFileSystemProvider';
|
|
122
123
|
export { agentHostAuthority } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentHostUri';
|
|
124
|
+
import { DOCK_DETAIL_PANEL_SETTING } from '@codingame/monaco-vscode-api/vscode/vs/sessions/common/sessionConfig';
|
|
123
125
|
import './vscode/src/vs/sessions/browser/parts/menubar.contribution.js';
|
|
124
126
|
import './vscode/src/vs/sessions/contrib/aiCustomizationTreeView/browser/aiCustomizationTreeView.contribution.js';
|
|
125
127
|
import './vscode/src/vs/sessions/contrib/aquarium/browser/aquarium.contribution.js';
|
|
@@ -159,6 +161,7 @@ import './vscode/src/vs/sessions/contrib/terminal/browser/sessionsTerminalContri
|
|
|
159
161
|
import './vscode/src/vs/sessions/contrib/applyCommitsToParentRepo/browser/applyChangesToParentRepo.js';
|
|
160
162
|
import './vscode/src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionBranchActions.js';
|
|
161
163
|
import '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/parts/sidebar/sidebarActions';
|
|
164
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
162
165
|
import { observableFromPromise } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/utils/utils';
|
|
163
166
|
export { AbstractResourceEditorInput } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor/resourceEditorInput';
|
|
164
167
|
export { AbstractTextResourceEditorInput } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor/textResourceEditorInput';
|
|
@@ -173,37 +176,51 @@ export { SplitView } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/u
|
|
|
173
176
|
export { ViewContainerLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/views';
|
|
174
177
|
export { ViewPaneContainer } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
|
|
175
178
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
createNotificationsHandlers() {
|
|
186
|
-
this.registerNotificationRowHeight();
|
|
187
|
-
}
|
|
188
|
-
initServices() {
|
|
189
|
-
return this._instantiationService;
|
|
190
|
-
}
|
|
191
|
-
restore(accessor) {
|
|
192
|
-
try {
|
|
193
|
-
this.restoreParts(accessor);
|
|
179
|
+
function createCustomWorkbench(BaseWorkbench) {
|
|
180
|
+
let CustomWorkbench = class CustomWorkbench extends BaseWorkbench {
|
|
181
|
+
constructor(options, logService, _instantiationService, _configurationService) {
|
|
182
|
+
super(getWorkbenchContainer(), options, new ServiceCollection(), logService);
|
|
183
|
+
this._instantiationService = _instantiationService;
|
|
184
|
+
this.mainContainer.classList.add('monaco-workbench-part');
|
|
185
|
+
}
|
|
186
|
+
registerErrorHandler(logService) {
|
|
187
|
+
setUnexpectedErrorHandler((error) => this.handleUnexpectedError(error, logService));
|
|
194
188
|
}
|
|
195
|
-
|
|
196
|
-
|
|
189
|
+
createNotificationsHandlers() {
|
|
190
|
+
this.registerNotificationRowHeight();
|
|
197
191
|
}
|
|
198
|
-
|
|
199
|
-
this.
|
|
200
|
-
}
|
|
192
|
+
initServices() {
|
|
193
|
+
return this._instantiationService;
|
|
194
|
+
}
|
|
195
|
+
restore(lifecycleService) {
|
|
196
|
+
try {
|
|
197
|
+
this.restoreParts();
|
|
198
|
+
}
|
|
199
|
+
catch (error) {
|
|
200
|
+
onUnexpectedError(error);
|
|
201
|
+
}
|
|
202
|
+
void this.sessionsService.restoreVisibleSessions().catch((e) => {
|
|
203
|
+
this.logService.error('[Workbench] restoreVisibleSessions failed', e);
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
CustomWorkbench = __decorate([
|
|
208
|
+
__param(1, ILogService),
|
|
209
|
+
__param(2, IInstantiationService),
|
|
210
|
+
__param(3, IConfigurationService)
|
|
211
|
+
], CustomWorkbench);
|
|
212
|
+
return CustomWorkbench;
|
|
213
|
+
}
|
|
214
|
+
const CustomSinglePaneWorkbench = createCustomWorkbench(SinglePaneWorkbench);
|
|
215
|
+
const CustomWorkbench = new Proxy(createCustomWorkbench(Workbench), {
|
|
216
|
+
construct(target, args) {
|
|
217
|
+
const configurationService = args[3];
|
|
218
|
+
const WorkbenchClass = configurationService.getValue(DOCK_DETAIL_PANEL_SETTING)
|
|
219
|
+
? CustomSinglePaneWorkbench
|
|
220
|
+
: target;
|
|
221
|
+
return Reflect.construct(WorkbenchClass, args);
|
|
201
222
|
}
|
|
202
|
-
};
|
|
203
|
-
CustomWorkbench = __decorate([
|
|
204
|
-
__param(1, ILogService),
|
|
205
|
-
__param(2, IInstantiationService)
|
|
206
|
-
], CustomWorkbench);
|
|
223
|
+
});
|
|
207
224
|
onLayout(async (accessor) => {
|
|
208
225
|
accessor.get(IWorkbenchLayoutService).startup();
|
|
209
226
|
const detectedFullScreen = detectFullscreen(mainWindow, getWorkbenchContainer());
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { ISerializableView, ISerializedNode, IViewSize } from "@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/grid/grid";
|
|
2
|
+
import { IEditorWillOpenEvent } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor";
|
|
3
|
+
import { Workbench } from "@codingame/monaco-vscode-api/vscode/vs/sessions/browser/workbench";
|
|
4
|
+
/**
|
|
5
|
+
* Remembers the editor width captured around visibility transitions.
|
|
6
|
+
*/
|
|
7
|
+
export declare class DockedEditorSizeMemento {
|
|
8
|
+
/** Editor node size captured when the editor is hidden with the detail still visible. */
|
|
9
|
+
dockedEditorSizeBeforeHide: IViewSize | undefined;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Single-pane workbench: the auxiliary bar is docked inside the editor part (below
|
|
13
|
+
* a shared tab bar) rather than being its own grid column. The editor part
|
|
14
|
+
* ({@link SinglePaneMainEditorPart}) owns the auxiliary bar and its docked
|
|
15
|
+
* controller; this workbench owns the docked width, the reveal-sync, and the
|
|
16
|
+
* docked size bookkeeping.
|
|
17
|
+
*/
|
|
18
|
+
export declare class SinglePaneWorkbench extends Workbench {
|
|
19
|
+
/** Node width past the detail width at which editor content counts as visible. */
|
|
20
|
+
private static readonly _EDITOR_CONTENT_VISIBLE_THRESHOLD;
|
|
21
|
+
private _dockedAuxiliaryBarWidth;
|
|
22
|
+
private _syncingEditorVisibility;
|
|
23
|
+
private readonly _memento;
|
|
24
|
+
get isSinglePaneLayoutEnabled(): boolean;
|
|
25
|
+
isEditorPaneVisible(): boolean;
|
|
26
|
+
toggleSecondarySideBar(): void;
|
|
27
|
+
isSecondarySideBarVisible(): boolean;
|
|
28
|
+
protected readonly _defaultSidePaneState: {
|
|
29
|
+
editor: boolean;
|
|
30
|
+
auxiliaryBar: boolean;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* A docked-detail editor (Changes/Files) renders its content in the docked
|
|
34
|
+
* detail panel. While that panel is open and the editor area is closed,
|
|
35
|
+
* re-activating such an editor (closing a neighbouring tab, or clicking the
|
|
36
|
+
* tab) must not reveal the editor area. When the detail panel is closed the
|
|
37
|
+
* base reveal still runs so the content becomes visible.
|
|
38
|
+
*/
|
|
39
|
+
protected revealEditorOnOpen(e: IEditorWillOpenEvent): void;
|
|
40
|
+
getDockedAuxiliaryBarWidth(): number;
|
|
41
|
+
setDockedAuxiliaryBarWidth(width: number): void;
|
|
42
|
+
getPreferredEditorPartWidth(): number | undefined;
|
|
43
|
+
/** Re-layouts the docked auxiliary bar, which the editor part owns. */
|
|
44
|
+
private _layoutDockedAuxBar;
|
|
45
|
+
protected _applyLayoutContainerClass(): void;
|
|
46
|
+
protected _auxiliaryBarLayoutWidth(): number;
|
|
47
|
+
protected _auxiliaryBarViewSize(): IViewSize;
|
|
48
|
+
protected _setAuxiliaryBarViewSize(size: IViewSize): void;
|
|
49
|
+
protected _resizeAuxiliaryBarBy(deltaWidth: number, _deltaHeight: number): void;
|
|
50
|
+
protected _restoreAuxiliaryBarWidth(width: number): void;
|
|
51
|
+
protected _persistedEditorWidth(editorGridWidth: number | undefined): number | undefined;
|
|
52
|
+
protected _persistedGridViewSize(view: ISerializableView, dimension: "width" | "height", visible: boolean): number | undefined;
|
|
53
|
+
protected _defaultSideBarSize(policySideBarSize: number): number;
|
|
54
|
+
protected _editorNodeSize(effectiveEditorWidth: number, effectiveAuxBarWidth: number): number;
|
|
55
|
+
protected _editorNodeVisible(editorVisible: boolean, auxBarVisible: boolean): boolean;
|
|
56
|
+
protected _minimumPartWidthForActivation(view: ISerializableView): number;
|
|
57
|
+
protected _topRightSectionChildren(sessionsNode: ISerializedNode, editorNode: ISerializedNode, _auxiliaryBarNode: ISerializedNode, customViewGridNode: ISerializedNode): ISerializedNode[];
|
|
58
|
+
protected _layoutSidePane(): void;
|
|
59
|
+
protected _layoutGrid(): void;
|
|
60
|
+
private _preserveSessionsEditorRatio;
|
|
61
|
+
protected _applyEditorAreaVisibility(): void;
|
|
62
|
+
protected _onGridDidChange(): void;
|
|
63
|
+
protected _onEditorNodeResized(nodeWidth: number): void;
|
|
64
|
+
private _syncEditorVisibility;
|
|
65
|
+
protected _runWithEditorResizeSyncSuspended(fn: () => void): void;
|
|
66
|
+
protected _applyEditorVisibility(hidden: boolean): void;
|
|
67
|
+
protected _onWillHideAuxiliaryBar(hidden: boolean): void;
|
|
68
|
+
/**
|
|
69
|
+
* No-op unless detail-only (editor content hidden): there the shared node is a
|
|
70
|
+
* snap view, so sash-drag collapse/reveal maps onto hiding/showing the auxiliary bar.
|
|
71
|
+
*/
|
|
72
|
+
protected _onEditorPartGridVisibilityChange(visible: boolean): void;
|
|
73
|
+
protected _applyAuxiliaryBarVisibility(hidden: boolean, source?: "resize"): void;
|
|
74
|
+
protected _shouldOpenAuxiliaryPaneComposite(containerId: string): boolean;
|
|
75
|
+
protected _handleAllEditorsClosed(): void;
|
|
76
|
+
}
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
|
|
2
|
+
import { Sizing } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/grid/grid';
|
|
3
|
+
import { alert } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/aria/aria';
|
|
4
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
5
|
+
import { Parts } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/layout/browser/layoutService';
|
|
6
|
+
import { DockedEditorInput } from '@codingame/monaco-vscode-api/vscode/vs/sessions/common/dockedEditorInput';
|
|
7
|
+
import { DockedAuxiliaryBarController } from './dockedAuxiliaryBarController.js';
|
|
8
|
+
import { EDITOR_PART_MINIMUM_WIDTH } from '@codingame/monaco-vscode-api/vscode/vs/sessions/browser/parts/editorPartSizing';
|
|
9
|
+
import { Workbench } from '@codingame/monaco-vscode-api/vscode/vs/sessions/browser/workbench';
|
|
10
|
+
|
|
11
|
+
class DockedEditorSizeMemento {}
|
|
12
|
+
class SinglePaneWorkbench extends Workbench {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this._dockedAuxiliaryBarWidth = DockedAuxiliaryBarController.DEFAULT_WIDTH;
|
|
16
|
+
this._syncingEditorVisibility = false;
|
|
17
|
+
this._memento = ( new DockedEditorSizeMemento());
|
|
18
|
+
this._defaultSidePaneState = {
|
|
19
|
+
editor: true,
|
|
20
|
+
auxiliaryBar: false
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
static {
|
|
24
|
+
this._EDITOR_CONTENT_VISIBLE_THRESHOLD = 4;
|
|
25
|
+
}
|
|
26
|
+
get isSinglePaneLayoutEnabled() {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
isEditorPaneVisible() {
|
|
30
|
+
return this.workbenchGrid ? this.workbenchGrid.isViewVisible(this.editorPartView) : super.isEditorPaneVisible();
|
|
31
|
+
}
|
|
32
|
+
toggleSecondarySideBar() {
|
|
33
|
+
const visible = this.toggleSidePane();
|
|
34
|
+
alert(visible ? ( localize(3071, "Side pane shown")) : ( localize(3072, "Side pane hidden")));
|
|
35
|
+
}
|
|
36
|
+
isSecondarySideBarVisible() {
|
|
37
|
+
return this.isSidePaneVisible();
|
|
38
|
+
}
|
|
39
|
+
revealEditorOnOpen(e) {
|
|
40
|
+
if (!this.isRestored() && !this.partVisibility.editor) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (e.editor instanceof DockedEditorInput && this.partVisibility.auxiliaryBar && !this.partVisibility.editor) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
super.revealEditorOnOpen(e);
|
|
47
|
+
}
|
|
48
|
+
getDockedAuxiliaryBarWidth() {
|
|
49
|
+
return this._dockedAuxiliaryBarWidth;
|
|
50
|
+
}
|
|
51
|
+
setDockedAuxiliaryBarWidth(width) {
|
|
52
|
+
this._dockedAuxiliaryBarWidth = width;
|
|
53
|
+
if (this.workbenchGrid && this.partVisibility.auxiliaryBar && !this.partVisibility.editor) {
|
|
54
|
+
this._syncingEditorVisibility = true;
|
|
55
|
+
try {
|
|
56
|
+
this.workbenchGrid.resizeView(this.editorPartView, {
|
|
57
|
+
width: this._dockedAuxiliaryBarWidth,
|
|
58
|
+
height: this.workbenchGrid.getViewSize(this.editorPartView).height
|
|
59
|
+
});
|
|
60
|
+
} finally {
|
|
61
|
+
this._syncingEditorVisibility = false;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
this._layoutDockedAuxBar();
|
|
65
|
+
}
|
|
66
|
+
getPreferredEditorPartWidth() {
|
|
67
|
+
if (!this.partVisibility.editor) {
|
|
68
|
+
return DockedAuxiliaryBarController.DEFAULT_WIDTH;
|
|
69
|
+
}
|
|
70
|
+
if (!this.partVisibility.auxiliaryBar || !this.workbenchGrid) {
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
const sessionsWidth = this.workbenchGrid.getViewSize(this.sessionsPartView).width;
|
|
74
|
+
const editorNodeWidth = this.workbenchGrid.getViewSize(this.editorPartView).width;
|
|
75
|
+
const totalWidth = sessionsWidth + editorNodeWidth;
|
|
76
|
+
return Math.round(
|
|
77
|
+
this._dockedAuxiliaryBarWidth + (totalWidth - this._dockedAuxiliaryBarWidth) / 2
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
_layoutDockedAuxBar() {
|
|
81
|
+
this.editorGroupService.mainPart.layoutDockedAuxiliaryBar();
|
|
82
|
+
}
|
|
83
|
+
_applyLayoutContainerClass() {
|
|
84
|
+
this.mainContainer.classList.toggle("dock-detail-panel", true);
|
|
85
|
+
}
|
|
86
|
+
_auxiliaryBarLayoutWidth() {
|
|
87
|
+
return this._dockedAuxiliaryBarWidth;
|
|
88
|
+
}
|
|
89
|
+
_auxiliaryBarViewSize() {
|
|
90
|
+
return {
|
|
91
|
+
width: this._dockedAuxiliaryBarWidth,
|
|
92
|
+
height: this._editorPartContainer?.clientHeight ?? 0
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
_setAuxiliaryBarViewSize(size) {
|
|
96
|
+
this._dockedAuxiliaryBarWidth = Math.max(DockedAuxiliaryBarController.MIN_WIDTH, size.width);
|
|
97
|
+
this._layoutDockedAuxBar();
|
|
98
|
+
}
|
|
99
|
+
_resizeAuxiliaryBarBy(deltaWidth, _deltaHeight) {
|
|
100
|
+
this._dockedAuxiliaryBarWidth = Math.max(
|
|
101
|
+
DockedAuxiliaryBarController.MIN_WIDTH,
|
|
102
|
+
this._dockedAuxiliaryBarWidth + deltaWidth
|
|
103
|
+
);
|
|
104
|
+
this._layoutDockedAuxBar();
|
|
105
|
+
}
|
|
106
|
+
_restoreAuxiliaryBarWidth(width) {
|
|
107
|
+
this._dockedAuxiliaryBarWidth = Math.max(DockedAuxiliaryBarController.MIN_WIDTH, width);
|
|
108
|
+
}
|
|
109
|
+
_persistedEditorWidth(editorGridWidth) {
|
|
110
|
+
if (typeof editorGridWidth !== "number") {
|
|
111
|
+
return editorGridWidth;
|
|
112
|
+
}
|
|
113
|
+
const dockedDetailWidth = this.partVisibility.auxiliaryBar ? this._dockedAuxiliaryBarWidth : 0;
|
|
114
|
+
return Math.max(0, editorGridWidth - dockedDetailWidth);
|
|
115
|
+
}
|
|
116
|
+
_persistedGridViewSize(view, dimension, visible) {
|
|
117
|
+
if (view === this.auxiliaryBarPartView) {
|
|
118
|
+
return this._dockedAuxiliaryBarWidth;
|
|
119
|
+
}
|
|
120
|
+
return super._persistedGridViewSize(view, dimension, visible);
|
|
121
|
+
}
|
|
122
|
+
_defaultSideBarSize(policySideBarSize) {
|
|
123
|
+
return Math.min(policySideBarSize, 280);
|
|
124
|
+
}
|
|
125
|
+
_editorNodeSize(effectiveEditorWidth, effectiveAuxBarWidth) {
|
|
126
|
+
if (!this.partVisibility.editor && this.partVisibility.auxiliaryBar) {
|
|
127
|
+
return this._dockedAuxiliaryBarWidth;
|
|
128
|
+
}
|
|
129
|
+
return effectiveEditorWidth + effectiveAuxBarWidth;
|
|
130
|
+
}
|
|
131
|
+
_editorNodeVisible(editorVisible, auxBarVisible) {
|
|
132
|
+
return editorVisible || auxBarVisible;
|
|
133
|
+
}
|
|
134
|
+
_minimumPartWidthForActivation(view) {
|
|
135
|
+
if (view === this.editorPartView && this.partVisibility.auxiliaryBar) {
|
|
136
|
+
return view.minimumWidth + this._dockedAuxiliaryBarWidth;
|
|
137
|
+
}
|
|
138
|
+
return super._minimumPartWidthForActivation(view);
|
|
139
|
+
}
|
|
140
|
+
_topRightSectionChildren(sessionsNode, editorNode, _auxiliaryBarNode, customViewGridNode) {
|
|
141
|
+
return [sessionsNode, editorNode, customViewGridNode];
|
|
142
|
+
}
|
|
143
|
+
_layoutSidePane() {
|
|
144
|
+
this._layoutDockedAuxBar();
|
|
145
|
+
}
|
|
146
|
+
_layoutGrid() {
|
|
147
|
+
const sessionsSize = this.workbenchGrid.getViewSize(this.sessionsPartView);
|
|
148
|
+
const editorSize = this.workbenchGrid.getViewSize(this.editorPartView);
|
|
149
|
+
const preserveRatio = this.partVisibility.editor && this.workbenchGrid.isViewVisible(this.sessionsPartView) && this.workbenchGrid.isViewVisible(this.editorPartView) && sessionsSize.width > 0 && editorSize.width > 0;
|
|
150
|
+
super._layoutGrid();
|
|
151
|
+
if (preserveRatio) {
|
|
152
|
+
this._preserveSessionsEditorRatio(sessionsSize.width, editorSize.width);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
_preserveSessionsEditorRatio(previousSessionsWidth, previousEditorWidth) {
|
|
156
|
+
const sessionsSize = this.workbenchGrid.getViewSize(this.sessionsPartView);
|
|
157
|
+
const editorSize = this.workbenchGrid.getViewSize(this.editorPartView);
|
|
158
|
+
const previousTotalWidth = previousSessionsWidth + previousEditorWidth;
|
|
159
|
+
const totalWidth = sessionsSize.width + editorSize.width;
|
|
160
|
+
if (totalWidth === previousTotalWidth) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
const minimumEditorWidth = this._minimumPartWidthForActivation(this.editorPartView);
|
|
164
|
+
const maximumEditorWidth = totalWidth - this._minimumPartWidthForActivation(this.sessionsPartView);
|
|
165
|
+
if (maximumEditorWidth < minimumEditorWidth) {
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
const proportionalEditorWidth = Math.round(totalWidth * previousEditorWidth / previousTotalWidth);
|
|
169
|
+
const targetEditorWidth = Math.min(maximumEditorWidth, Math.max(minimumEditorWidth, proportionalEditorWidth));
|
|
170
|
+
if (targetEditorWidth === editorSize.width) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
this._runWithEditorResizeSyncSuspended(() => {
|
|
174
|
+
this.workbenchGrid.resizeView(this.editorPartView, {
|
|
175
|
+
width: targetEditorWidth,
|
|
176
|
+
height: editorSize.height
|
|
177
|
+
});
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
_applyEditorAreaVisibility() {
|
|
181
|
+
this.workbenchGrid.setViewVisible(this.editorPartView, this._editorNodeShouldBeVisible());
|
|
182
|
+
this._layoutDockedAuxBar();
|
|
183
|
+
}
|
|
184
|
+
_onGridDidChange() {
|
|
185
|
+
const nodeWidth = this.workbenchGrid.getViewSize(this.editorPartView).width;
|
|
186
|
+
this._syncEditorVisibility(nodeWidth);
|
|
187
|
+
}
|
|
188
|
+
_onEditorNodeResized(nodeWidth) {
|
|
189
|
+
this._syncEditorVisibility(nodeWidth);
|
|
190
|
+
}
|
|
191
|
+
_syncEditorVisibility(nodeWidth) {
|
|
192
|
+
if (this._syncingEditorVisibility) {
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
if (this._isEditorPartAutoVisibilitySuppressed) {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
this._syncingEditorVisibility = true;
|
|
199
|
+
try {
|
|
200
|
+
const effectiveAuxiliaryBarWidth = DockedAuxiliaryBarController.getEffectiveWidth(this._dockedAuxiliaryBarWidth, nodeWidth);
|
|
201
|
+
const editorContentVisible = nodeWidth > effectiveAuxiliaryBarWidth + SinglePaneWorkbench._EDITOR_CONTENT_VISIBLE_THRESHOLD;
|
|
202
|
+
if (this.partVisibility.editor && !editorContentVisible && this.partVisibility.auxiliaryBar) {
|
|
203
|
+
this.partVisibility.editor = false;
|
|
204
|
+
this._setMainEditorAreaHidden(true);
|
|
205
|
+
this._editorRevealedExplicitly = false;
|
|
206
|
+
this._layoutDockedAuxBar();
|
|
207
|
+
this._fireDidChangePartVisibility(Parts.EDITOR_PART, false);
|
|
208
|
+
this._savePartVisibility();
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
} finally {
|
|
212
|
+
this._syncingEditorVisibility = false;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
_runWithEditorResizeSyncSuspended(fn) {
|
|
216
|
+
this._syncingEditorVisibility = true;
|
|
217
|
+
try {
|
|
218
|
+
fn();
|
|
219
|
+
} finally {
|
|
220
|
+
this._syncingEditorVisibility = false;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
_applyEditorVisibility(hidden) {
|
|
224
|
+
if (hidden) {
|
|
225
|
+
const contentWidth = this._persistedEditorWidth(this.workbenchGrid.getViewSize(this.editorPartView).width);
|
|
226
|
+
if (contentWidth !== undefined && contentWidth >= EDITOR_PART_MINIMUM_WIDTH) {
|
|
227
|
+
this._savedPartSizes = {
|
|
228
|
+
...this._savedPartSizes,
|
|
229
|
+
editor: contentWidth
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
const dockedEditorSizeBeforeHide = this._memento.dockedEditorSizeBeforeHide;
|
|
234
|
+
const savedEditorWidth = this._savedPartSizes.editor;
|
|
235
|
+
const canRestoreSavedWidth = savedEditorWidth !== undefined && savedEditorWidth >= EDITOR_PART_MINIMUM_WIDTH;
|
|
236
|
+
const shouldRestoreDockedEditorSize = !hidden && !!dockedEditorSizeBeforeHide;
|
|
237
|
+
const shouldRestoreSavedWidth = !hidden && !shouldRestoreDockedEditorSize && canRestoreSavedWidth;
|
|
238
|
+
const shouldApplyEvenSplit = !hidden && !shouldRestoreDockedEditorSize && !shouldRestoreSavedWidth;
|
|
239
|
+
this.workbenchGrid.setViewVisible(
|
|
240
|
+
this.editorPartView,
|
|
241
|
+
this._editorNodeShouldBeVisible(),
|
|
242
|
+
shouldApplyEvenSplit ? Sizing.Distribute : undefined
|
|
243
|
+
);
|
|
244
|
+
if (hidden) {
|
|
245
|
+
if (this.partVisibility.auxiliaryBar) {
|
|
246
|
+
this._memento.dockedEditorSizeBeforeHide = this.workbenchGrid.getViewSize(this.editorPartView);
|
|
247
|
+
this.workbenchGrid.resizeView(this.editorPartView, {
|
|
248
|
+
width: this._dockedAuxiliaryBarWidth,
|
|
249
|
+
height: this._memento.dockedEditorSizeBeforeHide.height
|
|
250
|
+
});
|
|
251
|
+
} else {
|
|
252
|
+
this._memento.dockedEditorSizeBeforeHide = undefined;
|
|
253
|
+
}
|
|
254
|
+
} else if (shouldRestoreDockedEditorSize && dockedEditorSizeBeforeHide) {
|
|
255
|
+
this.workbenchGrid.resizeView(this.editorPartView, dockedEditorSizeBeforeHide);
|
|
256
|
+
this._memento.dockedEditorSizeBeforeHide = undefined;
|
|
257
|
+
} else if (shouldRestoreSavedWidth) {
|
|
258
|
+
this._memento.dockedEditorSizeBeforeHide = undefined;
|
|
259
|
+
const height = this.workbenchGrid.getViewSize(this.editorPartView).height;
|
|
260
|
+
const detailWidth = this.partVisibility.auxiliaryBar ? this._dockedAuxiliaryBarWidth : 0;
|
|
261
|
+
this.workbenchGrid.resizeView(this.editorPartView, {
|
|
262
|
+
width: savedEditorWidth + detailWidth,
|
|
263
|
+
height
|
|
264
|
+
});
|
|
265
|
+
} else if (!hidden) {
|
|
266
|
+
this._memento.dockedEditorSizeBeforeHide = undefined;
|
|
267
|
+
}
|
|
268
|
+
if (shouldApplyEvenSplit) {
|
|
269
|
+
this._hasAppliedInitialEditorSplit = true;
|
|
270
|
+
}
|
|
271
|
+
this._layoutDockedAuxBar();
|
|
272
|
+
this._fireDidChangePartVisibility(Parts.EDITOR_PART, !hidden);
|
|
273
|
+
this._notifyContainerDidLayout();
|
|
274
|
+
}
|
|
275
|
+
_onWillHideAuxiliaryBar(hidden) {
|
|
276
|
+
if (hidden && !this.partVisibility.editor && !this._isEditorPartAutoVisibilitySuppressed) {
|
|
277
|
+
this.setEditorHidden(false, true);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
_onEditorPartGridVisibilityChange(visible) {
|
|
281
|
+
if (this.partVisibility.editor) {
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
if (!visible) {
|
|
285
|
+
const suppression = this.suppressEditorPartAutoVisibility();
|
|
286
|
+
try {
|
|
287
|
+
this.setAuxiliaryBarHiddenForResize(true);
|
|
288
|
+
} finally {
|
|
289
|
+
suppression.dispose();
|
|
290
|
+
}
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
this.setAuxiliaryBarHiddenForResize(false);
|
|
294
|
+
}
|
|
295
|
+
_applyAuxiliaryBarVisibility(hidden, source) {
|
|
296
|
+
if (this.workbenchGrid) {
|
|
297
|
+
this.workbenchGrid.setViewVisible(this.editorPartView, this._editorNodeShouldBeVisible());
|
|
298
|
+
if (!hidden && !this.partVisibility.editor) {
|
|
299
|
+
this._syncingEditorVisibility = true;
|
|
300
|
+
try {
|
|
301
|
+
this.workbenchGrid.resizeView(this.editorPartView, {
|
|
302
|
+
width: this._dockedAuxiliaryBarWidth,
|
|
303
|
+
height: this.workbenchGrid.getViewSize(this.editorPartView).height
|
|
304
|
+
});
|
|
305
|
+
} finally {
|
|
306
|
+
this._syncingEditorVisibility = false;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
this._layoutDockedAuxBar();
|
|
311
|
+
this._fireDidChangePartVisibility(Parts.AUXILIARYBAR_PART, !hidden, source);
|
|
312
|
+
this._notifyContainerDidLayout();
|
|
313
|
+
}
|
|
314
|
+
_shouldOpenAuxiliaryPaneComposite(containerId) {
|
|
315
|
+
return this._isAuxViewContainerActive(containerId);
|
|
316
|
+
}
|
|
317
|
+
_handleAllEditorsClosed() {}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export { DockedEditorSizeMemento, SinglePaneWorkbench };
|