@codingame/monaco-vscode-view-title-bar-service-override 28.4.0 → 29.0.0
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/package.json +2 -2
- package/vscode/src/vs/workbench/browser/parts/titlebar/commandCenterControl.js +25 -9
- package/vscode/src/vs/workbench/browser/parts/titlebar/media/titlebarpart.css +32 -3
- package/vscode/src/vs/workbench/browser/parts/titlebar/titlebarPart.d.ts +1 -0
- package/vscode/src/vs/workbench/browser/parts/titlebar/titlebarPart.js +21 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-view-title-bar-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "29.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - view-title-bar service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-api": "
|
|
18
|
+
"@codingame/monaco-vscode-api": "29.0.0"
|
|
19
19
|
},
|
|
20
20
|
"main": "index.js",
|
|
21
21
|
"module": "index.js",
|
|
@@ -17,8 +17,12 @@ import { IKeybindingService } from '@codingame/monaco-vscode-api/vscode/vs/platf
|
|
|
17
17
|
import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service';
|
|
18
18
|
import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
19
19
|
import { IHoverService } from '@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service';
|
|
20
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
20
21
|
|
|
21
22
|
var CommandCenterCenterViewItem_1;
|
|
23
|
+
const AI_DISABLED_SETTING = "chat.disableAIFeatures";
|
|
24
|
+
const AI_CUSTOMIZATION_MENU_ENABLED_SETTING = "chat.customizationsMenu.enabled";
|
|
25
|
+
const AGENT_STATUS_ENABLED_SETTING = "chat.agentsControl.enabled";
|
|
22
26
|
let CommandCenterControl = class CommandCenterControl {
|
|
23
27
|
constructor(windowTitle, hoverDelegate, instantiationService, quickInputService) {
|
|
24
28
|
this._disposables = ( new DisposableStore());
|
|
@@ -78,7 +82,8 @@ let CommandCenterCenterViewItem = class CommandCenterCenterViewItem extends Base
|
|
|
78
82
|
_hoverService,
|
|
79
83
|
_keybindingService,
|
|
80
84
|
_instaService,
|
|
81
|
-
_editorGroupService
|
|
85
|
+
_editorGroupService,
|
|
86
|
+
_configurationService
|
|
82
87
|
) {
|
|
83
88
|
super(
|
|
84
89
|
undefined,
|
|
@@ -91,6 +96,7 @@ let CommandCenterCenterViewItem = class CommandCenterCenterViewItem extends Base
|
|
|
91
96
|
this._keybindingService = _keybindingService;
|
|
92
97
|
this._instaService = _instaService;
|
|
93
98
|
this._editorGroupService = _editorGroupService;
|
|
99
|
+
this._configurationService = _configurationService;
|
|
94
100
|
this._hoverDelegate = options.hoverDelegate ?? getDefaultHoverDelegate("mouse");
|
|
95
101
|
}
|
|
96
102
|
render(container) {
|
|
@@ -134,6 +140,12 @@ let CommandCenterCenterViewItem = class CommandCenterCenterViewItem extends Base
|
|
|
134
140
|
container.classList.toggle("command-center-quick-pick");
|
|
135
141
|
container.role = "button";
|
|
136
142
|
container.setAttribute("aria-description", this.getTooltip());
|
|
143
|
+
const aiFeaturesDisabled = that._configurationService.getValue(AI_DISABLED_SETTING) === true;
|
|
144
|
+
const aiCustomizationsDisabled = that._configurationService.getValue("disableAICustomizations") === true || that._configurationService.getValue("workbench.disableAICustomizations") === true || that._configurationService.getValue(AI_CUSTOMIZATION_MENU_ENABLED_SETTING) === false;
|
|
145
|
+
const forcedHidden = aiFeaturesDisabled && aiCustomizationsDisabled;
|
|
146
|
+
const agentControlValue = that._configurationService.getValue(AGENT_STATUS_ENABLED_SETTING);
|
|
147
|
+
const isCompactMode = !forcedHidden && (agentControlValue === true || agentControlValue === undefined || agentControlValue === "compact");
|
|
148
|
+
container.classList.toggle("compact-mode", isCompactMode);
|
|
137
149
|
const action = this.action;
|
|
138
150
|
const searchIcon = createElement("span");
|
|
139
151
|
searchIcon.ariaHidden = "true";
|
|
@@ -143,7 +155,11 @@ let CommandCenterCenterViewItem = class CommandCenterCenterViewItem extends Base
|
|
|
143
155
|
const labelElement = createElement("span");
|
|
144
156
|
labelElement.classList.add("search-label");
|
|
145
157
|
labelElement.textContent = label;
|
|
146
|
-
|
|
158
|
+
if (isCompactMode) {
|
|
159
|
+
reset(container, labelElement);
|
|
160
|
+
} else {
|
|
161
|
+
reset(container, searchIcon, labelElement);
|
|
162
|
+
}
|
|
147
163
|
const hover = this._store.add(
|
|
148
164
|
that._hoverService.setupManagedHover(that._hoverDelegate, container, this.getTooltip())
|
|
149
165
|
);
|
|
@@ -178,13 +194,13 @@ let CommandCenterCenterViewItem = class CommandCenterCenterViewItem extends Base
|
|
|
178
194
|
label = that._windowTitle.fileName ?? label;
|
|
179
195
|
}
|
|
180
196
|
if (!label) {
|
|
181
|
-
label = ( localize(
|
|
197
|
+
label = ( localize(3724, "Search"));
|
|
182
198
|
}
|
|
183
199
|
if (prefix) {
|
|
184
|
-
label = ( localize(
|
|
200
|
+
label = ( localize(3725, "{0} {1}", prefix, label));
|
|
185
201
|
}
|
|
186
202
|
if (suffix) {
|
|
187
|
-
label = ( localize(
|
|
203
|
+
label = ( localize(3726, "{0} {1}", label, suffix));
|
|
188
204
|
}
|
|
189
205
|
return label.replaceAll(/\r\n|\r|\n/g, "⏎");
|
|
190
206
|
}
|
|
@@ -205,13 +221,13 @@ let CommandCenterCenterViewItem = class CommandCenterCenterViewItem extends Base
|
|
|
205
221
|
getTooltip() {
|
|
206
222
|
const kb = this._keybindingService.lookupKeybinding(this.action.id)?.getLabel();
|
|
207
223
|
const title = kb ? ( localize(
|
|
208
|
-
|
|
224
|
+
3727,
|
|
209
225
|
"Search {0} ({1}) — {2}",
|
|
210
226
|
this._windowTitle.workspaceName,
|
|
211
227
|
kb,
|
|
212
228
|
this._windowTitle.value
|
|
213
229
|
)) : ( localize(
|
|
214
|
-
|
|
230
|
+
3728,
|
|
215
231
|
"Search {0} — {1}",
|
|
216
232
|
this._windowTitle.workspaceName,
|
|
217
233
|
this._windowTitle.value
|
|
@@ -219,10 +235,10 @@ let CommandCenterCenterViewItem = class CommandCenterCenterViewItem extends Base
|
|
|
219
235
|
return title;
|
|
220
236
|
}
|
|
221
237
|
};
|
|
222
|
-
CommandCenterCenterViewItem = CommandCenterCenterViewItem_1 = ( __decorate([( __param(3, IHoverService)), ( __param(4, IKeybindingService)), ( __param(5, IInstantiationService)), ( __param(6, IEditorGroupsService))], CommandCenterCenterViewItem));
|
|
238
|
+
CommandCenterCenterViewItem = CommandCenterCenterViewItem_1 = ( __decorate([( __param(3, IHoverService)), ( __param(4, IKeybindingService)), ( __param(5, IInstantiationService)), ( __param(6, IEditorGroupsService)), ( __param(7, IConfigurationService))], CommandCenterCenterViewItem));
|
|
223
239
|
MenuRegistry.appendMenuItem(MenuId.CommandCenter, {
|
|
224
240
|
submenu: MenuId.CommandCenterCenter,
|
|
225
|
-
title: ( localize(
|
|
241
|
+
title: ( localize(3729, "Command Center")),
|
|
226
242
|
icon: Codicon.shield,
|
|
227
243
|
order: 101
|
|
228
244
|
});
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
.monaco-workbench .part.titlebar.inactive > * {
|
|
151
|
-
opacity: 0.
|
|
151
|
+
opacity: 0.6;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-center > .window-title > .command-center > .monaco-toolbar > .monaco-action-bar > .actions-container > .action-item > .action-label,
|
|
@@ -173,11 +173,10 @@
|
|
|
173
173
|
border: 1px solid var(--vscode-commandCenter-border);
|
|
174
174
|
overflow: hidden;
|
|
175
175
|
margin: 0 6px;
|
|
176
|
-
border-radius: var(--vscode-cornerRadius-
|
|
176
|
+
border-radius: var(--vscode-cornerRadius-medium);
|
|
177
177
|
height: 22px;
|
|
178
178
|
width: 38vw;
|
|
179
179
|
max-width: 600px;
|
|
180
|
-
box-shadow: inset var(--vscode-shadow-sm);
|
|
181
180
|
}
|
|
182
181
|
|
|
183
182
|
.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-center > .window-title > .command-center .action-item.command-center-center .action-item.command-center-quick-pick {
|
|
@@ -204,6 +203,25 @@
|
|
|
204
203
|
text-overflow: ellipsis;
|
|
205
204
|
}
|
|
206
205
|
|
|
206
|
+
/* Compact mode: left-aligned label, no icon, full width */
|
|
207
|
+
.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-center > .window-title > .command-center .action-item.command-center-center .action-item.command-center-quick-pick.compact-mode {
|
|
208
|
+
margin: auto auto auto 0;
|
|
209
|
+
padding-left: 8px;
|
|
210
|
+
flex: 1;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-center > .window-title > .command-center .action-item.command-center-center:has(.compact-mode) > .monaco-toolbar > .monaco-action-bar > .actions-container {
|
|
214
|
+
margin: 0;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-center > .window-title > .command-center .action-item.command-center-center:has(.compact-mode) > .monaco-toolbar {
|
|
218
|
+
flex: 1;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-center > .window-title > .command-center .action-item.command-center-center:has(.compact-mode) > .monaco-toolbar > .monaco-action-bar {
|
|
222
|
+
width: 100%;
|
|
223
|
+
}
|
|
224
|
+
|
|
207
225
|
.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-center > .window-title > .command-center .action-item.command-center-center.multiple {
|
|
208
226
|
justify-content: flex-start;
|
|
209
227
|
padding: 0 12px;
|
|
@@ -379,6 +397,17 @@
|
|
|
379
397
|
color: white;
|
|
380
398
|
}
|
|
381
399
|
|
|
400
|
+
/* Center-Adjacent Toolbar (e.g., update indicator) */
|
|
401
|
+
.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-right > .center-adjacent-toolbar-container {
|
|
402
|
+
z-index: 2500;
|
|
403
|
+
-webkit-app-region: no-drag;
|
|
404
|
+
margin-right: auto;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-right > .center-adjacent-toolbar-container.has-no-actions {
|
|
408
|
+
display: none;
|
|
409
|
+
}
|
|
410
|
+
|
|
382
411
|
/* Action Tool Bar Controls */
|
|
383
412
|
.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-right > .action-toolbar-container {
|
|
384
413
|
display: none;
|
|
@@ -97,6 +97,7 @@ export declare class BrowserTitlebarPart extends Part implements ITitlebarPart {
|
|
|
97
97
|
private readonly actionToolBarDisposable;
|
|
98
98
|
private readonly editorActionsChangeDisposable;
|
|
99
99
|
private actionToolBarElement;
|
|
100
|
+
private readonly centerAdjacentToolBarDisposable;
|
|
100
101
|
private globalToolbarMenu;
|
|
101
102
|
private layoutToolbarMenu;
|
|
102
103
|
private readonly globalToolbarMenuDisposables;
|
|
@@ -31,7 +31,7 @@ import { IHostService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/s
|
|
|
31
31
|
import { WindowTitle } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/parts/titlebar/windowTitle';
|
|
32
32
|
import { CommandCenterControl } from './commandCenterControl.js';
|
|
33
33
|
import { Categories } from '@codingame/monaco-vscode-api/vscode/vs/platform/action/common/actionCommonCategories';
|
|
34
|
-
import { WorkbenchToolBar } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/toolbar';
|
|
34
|
+
import { MenuWorkbenchToolBar, HiddenItemStrategy, WorkbenchToolBar } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/toolbar';
|
|
35
35
|
import { GLOBAL_ACTIVITY_ID, ACCOUNTS_ACTIVITY_ID } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/activity';
|
|
36
36
|
import { SimpleGlobalActivityActionViewItem, SimpleAccountActivityActionViewItem, isAccountsActionVisible, AccountsActivityActionViewItem } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/parts/globalCompositeBar';
|
|
37
37
|
import { HoverPosition } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/hover/hoverWidget';
|
|
@@ -75,7 +75,7 @@ let BrowserTitleService = class BrowserTitleService extends MultiWindowParts {
|
|
|
75
75
|
constructor() {
|
|
76
76
|
super({
|
|
77
77
|
id: `workbench.action.focusTitleBar`,
|
|
78
|
-
title: ( localize2(
|
|
78
|
+
title: ( localize2(3765, "Focus Title Bar")),
|
|
79
79
|
category: Categories.View,
|
|
80
80
|
f1: true,
|
|
81
81
|
precondition: TitleBarVisibleContext
|
|
@@ -216,6 +216,7 @@ let BrowserTitlebarPart = class BrowserTitlebarPart extends Part {
|
|
|
216
216
|
this.customMenubar = this._register(( new MutableDisposable()));
|
|
217
217
|
this.actionToolBarDisposable = this._register(( new DisposableStore()));
|
|
218
218
|
this.editorActionsChangeDisposable = this._register(( new DisposableStore()));
|
|
219
|
+
this.centerAdjacentToolBarDisposable = this._register(( new DisposableStore()));
|
|
219
220
|
this.globalToolbarMenuDisposables = this._register(( new DisposableStore()));
|
|
220
221
|
this.editorToolbarMenuDisposables = this._register(( new DisposableStore()));
|
|
221
222
|
this.layoutToolbarMenuDisposables = this._register(( new DisposableStore()));
|
|
@@ -353,6 +354,23 @@ let BrowserTitlebarPart = class BrowserTitlebarPart extends Part {
|
|
|
353
354
|
}
|
|
354
355
|
this.title = append(this.centerContent, $("div.window-title"));
|
|
355
356
|
this.createTitle();
|
|
357
|
+
{
|
|
358
|
+
const centerAdjacentToolBarElement = append(this.rightContent, $("div.center-adjacent-toolbar-container"));
|
|
359
|
+
this.centerAdjacentToolBarDisposable.add(this.instantiationService.createInstance(
|
|
360
|
+
MenuWorkbenchToolBar,
|
|
361
|
+
centerAdjacentToolBarElement,
|
|
362
|
+
MenuId.TitleBarAdjacentCenter,
|
|
363
|
+
{
|
|
364
|
+
contextMenu: MenuId.TitleBarContext,
|
|
365
|
+
hiddenItemStrategy: HiddenItemStrategy.NoHide,
|
|
366
|
+
toolbarOptions: {
|
|
367
|
+
primaryGroup: () => true
|
|
368
|
+
},
|
|
369
|
+
actionViewItemProvider: (action, options) => createActionViewItem(this.instantiationService, action, options),
|
|
370
|
+
hoverDelegate: this.hoverDelegate
|
|
371
|
+
}
|
|
372
|
+
));
|
|
373
|
+
}
|
|
356
374
|
{
|
|
357
375
|
this.actionToolBarElement = append(this.rightContent, $("div.action-toolbar-container"));
|
|
358
376
|
this.createActionToolBar();
|
|
@@ -465,7 +483,7 @@ let BrowserTitlebarPart = class BrowserTitlebarPart extends Part {
|
|
|
465
483
|
this.instantiationService.createInstance(WorkbenchToolBar, this.actionToolBarElement, {
|
|
466
484
|
contextMenu: MenuId.TitleBarContext,
|
|
467
485
|
orientation: ActionsOrientation.HORIZONTAL,
|
|
468
|
-
ariaLabel: ( localize(
|
|
486
|
+
ariaLabel: ( localize(3766, "Title actions")),
|
|
469
487
|
getKeyBinding: action => this.getKeybinding(action),
|
|
470
488
|
overflowBehavior: {
|
|
471
489
|
maxItems: 9,
|