Skip to content

Commit c202fb0

Browse files
authored
ux - tweak status locations including copilot to be more aligned with our UX standards (microsoft#242154)
1 parent fb28dca commit c202fb0

File tree

11 files changed

+16
-38
lines changed

11 files changed

+16
-38
lines changed

build/lib/stylelint/vscode-known-variables.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -656,10 +656,6 @@
656656
"--vscode-statusBar-noFolderForeground",
657657
"--vscode-statusBarItem-activeBackground",
658658
"--vscode-statusBarItem-compactHoverBackground",
659-
"--vscode-statusBarItem-copilotBackground",
660-
"--vscode-statusBarItem-copilotForeground",
661-
"--vscode-statusBarItem-copilotHoverBackground",
662-
"--vscode-statusBarItem-copilotHoverForeground",
663659
"--vscode-statusBarItem-errorBackground",
664660
"--vscode-statusBarItem-errorForeground",
665661
"--vscode-statusBarItem-errorHoverBackground",

src/vs/workbench/api/browser/mainThreadOutputService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export class MainThreadOutputService extends Disposable implements MainThreadOut
106106
statusProperties,
107107
'status.view.showQuietly',
108108
StatusbarAlignment.RIGHT,
109-
{ location: { id: 'status.notifications', priority: -Number.MAX_VALUE }, alignment: StatusbarAlignment.LEFT }
109+
{ location: { id: 'status.notifications', priority: Number.NEGATIVE_INFINITY }, alignment: StatusbarAlignment.LEFT }
110110
);
111111
} else {
112112
this._outputStatusItem.value.update(statusProperties);

src/vs/workbench/browser/parts/editor/editorStatus.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -994,9 +994,10 @@ class ShowCurrentMarkerInStatusbarContribution extends Disposable {
994994
const line = splitLines(this.currentMarker.message)[0];
995995
const text = `${this.getType(this.currentMarker)} ${line}`;
996996
if (!this.statusBarEntryAccessor.value) {
997-
this.statusBarEntryAccessor.value = this.statusbarService.addEntry({ name: localize('currentProblem', "Current Problem"), text: '', ariaLabel: '' }, 'statusbar.currentProblem', StatusbarAlignment.LEFT);
997+
this.statusBarEntryAccessor.value = this.statusbarService.addEntry({ name: localize('currentProblem', "Current Problem"), text, ariaLabel: text }, 'statusbar.currentProblem', StatusbarAlignment.LEFT, { location: { id: 'status.problems', priority: 50 }, alignment: StatusbarAlignment.RIGHT });
998+
} else {
999+
this.statusBarEntryAccessor.value.update({ name: localize('currentProblem', "Current Problem"), text, ariaLabel: text });
9981000
}
999-
this.statusBarEntryAccessor.value.update({ name: localize('currentProblem', "Current Problem"), text, ariaLabel: text });
10001001
} else {
10011002
this.statusBarEntryAccessor.clear();
10021003
}

src/vs/workbench/browser/parts/notifications/notificationsStatus.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export class NotificationsStatus extends Disposable {
9797
statusProperties,
9898
'status.notifications',
9999
StatusbarAlignment.RIGHT,
100-
-Number.MAX_VALUE /* towards the far end of the right hand side */
100+
Number.NEGATIVE_INFINITY /* last entry */
101101
);
102102
} else {
103103
this.notificationsCenterStatusItem.update(statusProperties);
@@ -200,7 +200,7 @@ export class NotificationsStatus extends Disposable {
200200
},
201201
'status.message',
202202
StatusbarAlignment.LEFT,
203-
-Number.MAX_VALUE /* far right on left hand side */
203+
Number.NEGATIVE_INFINITY /* last entry */
204204
);
205205
showHandle = null;
206206
}, showAfter);

src/vs/workbench/browser/parts/statusbar/media/statusbarpart.css

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -239,13 +239,3 @@
239239
color: var(--vscode-statusBarItem-offlineHoverForeground);
240240
background-color: var(--vscode-statusBarItem-offlineHoverBackground) !important;
241241
}
242-
243-
.monaco-workbench .part.statusbar > .items-container > .statusbar-item.copilot-kind {
244-
color: var(--vscode-statusBarItem-copilotForeground);
245-
background-color: var(--vscode-statusBarItem-copilotBackground);
246-
}
247-
248-
.monaco-workbench .part.statusbar > .items-container > .statusbar-item.copilot-kind a:hover:not(.disabled) {
249-
color: var(--vscode-statusBarItem-copilotHoverForeground);
250-
background-color: var(--vscode-statusBarItem-copilotHoverBackground) !important;
251-
}

src/vs/workbench/common/theme.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -599,17 +599,6 @@ export const EXTENSION_BADGE_REMOTE_BACKGROUND = registerColor('extensionBadge.r
599599
export const EXTENSION_BADGE_REMOTE_FOREGROUND = registerColor('extensionBadge.remoteForeground', ACTIVITY_BAR_BADGE_FOREGROUND, localize('extensionBadge.remoteForeground', "Foreground color for the remote badge in the extensions view."));
600600

601601

602-
// < --- Copilot --- >
603-
604-
export const STATUS_BAR_COPILOT_ITEM_BACKGROUND = registerColor('statusBarItem.copilotBackground', STATUS_BAR_REMOTE_ITEM_BACKGROUND, localize('statusBarItemCopilotBackground', "Background color for the Copilot indicator on the status bar."));
605-
606-
export const STATUS_BAR_COPILOT_ITEM_FOREGROUND = registerColor('statusBarItem.copilotForeground', STATUS_BAR_REMOTE_ITEM_FOREGROUND, localize('statusBarItemCopilotForeground', "Foreground color for the Copilot indicator on the status bar."));
607-
608-
export const STATUS_BAR_COPILOT_ITEM_HOVER_FOREGROUND = registerColor('statusBarItem.copilotHoverForeground', STATUS_BAR_REMOTE_ITEM_HOVER_FOREGROUND, localize('statusBarCopilotItemHoverForeground', "Foreground color for the Copilot indicator on the status bar when hovering."));
609-
610-
export const STATUS_BAR_COPILOT_ITEM_HOVER_BACKGROUND = registerColor('statusBarItem.copilotHoverBackground', STATUS_BAR_REMOTE_ITEM_HOVER_BACKGROUND, localize('statusBarAiItemHoverBackground', "Background color for the Copilot indicator on the status bar when hovering."));
611-
612-
613602
// < --- Side Bar --- >
614603

615604
export const SIDE_BAR_BACKGROUND = registerColor('sideBar.background', {

src/vs/workbench/contrib/chat/browser/chatStatus.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { localize } from '../../../../nls.js';
1111
import { ContextKeyExpr, IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';
1212
import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';
1313
import { IWorkbenchContribution } from '../../../common/contributions.js';
14-
import { IStatusbarEntry, IStatusbarEntryAccessor, IStatusbarService, ShowTooltipCommand, StatusbarAlignment, TooltipContent } from '../../../services/statusbar/browser/statusbar.js';
14+
import { IStatusbarEntry, IStatusbarEntryAccessor, IStatusbarService, ShowTooltipCommand, StatusbarAlignment, StatusbarEntryKind, TooltipContent } from '../../../services/statusbar/browser/statusbar.js';
1515
import { ChatContextKeys } from '../common/chatContextKeys.js';
1616
import { IChatQuotasService } from '../common/chatQuotasService.js';
1717
import { quotaToButtonMessage, OPEN_CHAT_QUOTA_EXCEEDED_DIALOG, CHAT_SETUP_ACTION_LABEL, TOGGLE_CHAT_ACTION_ID, CHAT_OPEN_ACTION_ID } from './actions/chatActions.js';
@@ -119,7 +119,7 @@ export class ChatStatusBarEntry extends Disposable implements IWorkbenchContribu
119119

120120
private async create(): Promise<void> {
121121
if (this.configurationService.getValue<boolean>('chat.experimental.statusIndicator.enabled') === true) {
122-
this.entry ||= this.statusbarService.addEntry(this.getEntryProps(), ChatStatusBarEntry.ID, StatusbarAlignment.RIGHT, Number.NEGATIVE_INFINITY /* the end of the right hand side */);
122+
this.entry ||= this.statusbarService.addEntry(this.getEntryProps(), ChatStatusBarEntry.ID, StatusbarAlignment.RIGHT, { location: { id: 'status.editor.mode', priority: 100.1 }, alignment: StatusbarAlignment.RIGHT });
123123
this.statusbarService.updateEntryVisibility(`${this.productService.defaultChatAgent?.extensionId}.status`, false); // TODO@bpasero: remove this eventually
124124
} else {
125125
this.entry?.dispose();
@@ -161,6 +161,7 @@ export class ChatStatusBarEntry extends Disposable implements IWorkbenchContribu
161161
let ariaLabel = localize('chatStatus', "Copilot Status");
162162
let command: string | Command = TOGGLE_CHAT_ACTION_ID;
163163
let tooltip: TooltipContent = localize('openChat', "Open Chat ({0})", this.keybindingService.lookupKeybinding(command)?.getLabel() ?? '');
164+
let kind: StatusbarEntryKind | undefined;
164165

165166
// Quota Exceeded
166167
const { chatQuotaExceeded, completionsQuotaExceeded } = this.chatQuotasService.quotas;
@@ -178,6 +179,7 @@ export class ChatStatusBarEntry extends Disposable implements IWorkbenchContribu
178179
ariaLabel = quotaWarning;
179180
command = OPEN_CHAT_QUOTA_EXCEEDED_DIALOG;
180181
tooltip = quotaToButtonMessage({ chatQuotaExceeded, completionsQuotaExceeded });
182+
kind = 'prominent';
181183
}
182184

183185
// Copilot Not Installed
@@ -273,7 +275,7 @@ export class ChatStatusBarEntry extends Disposable implements IWorkbenchContribu
273275
ariaLabel,
274276
command,
275277
showInAllWindows: true,
276-
kind: 'copilot',
278+
kind,
277279
tooltip
278280
};
279281
}

src/vs/workbench/contrib/tasks/browser/task.contribution.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export class TaskStatusBarContributions extends Disposable implements IWorkbench
142142
};
143143

144144
if (!this._runningTasksStatusItem) {
145-
this._runningTasksStatusItem = this._statusbarService.addEntry(itemProps, 'status.runningTasks', StatusbarAlignment.LEFT, 49 /* Medium Priority, next to Markers */);
145+
this._runningTasksStatusItem = this._statusbarService.addEntry(itemProps, 'status.runningTasks', StatusbarAlignment.LEFT, { location: { id: 'status.problems', priority: 50 }, alignment: StatusbarAlignment.RIGHT });
146146
} else {
147147
this._runningTasksStatusItem.update(itemProps);
148148
}

src/vs/workbench/contrib/workspace/browser/workspace.contribution.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ export class WorkspaceTrustUXHandler extends Disposable implements IWorkbenchCon
627627

628628
if (!trusted && !this.statusbarEntryAccessor.value) {
629629
const entry = this.getRestrictedModeStatusbarEntry();
630-
this.statusbarEntryAccessor.value = this.statusbarService.addEntry(entry, this.entryId, StatusbarAlignment.LEFT, 0.99 * Number.MAX_VALUE /* Right of remote indicator */);
630+
this.statusbarEntryAccessor.value = this.statusbarService.addEntry(entry, this.entryId, StatusbarAlignment.LEFT, { location: { id: 'status.host', priority: Number.POSITIVE_INFINITY }, alignment: StatusbarAlignment.RIGHT });
631631
}
632632
}
633633

src/vs/workbench/services/progress/browser/progressService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ export class ProgressService extends Disposable implements IProgressService {
190190
if (this.windowProgressStatusEntry) {
191191
this.windowProgressStatusEntry.update(statusEntryProperties);
192192
} else {
193-
this.windowProgressStatusEntry = this.statusbarService.addEntry(statusEntryProperties, 'status.progress', StatusbarAlignment.LEFT);
193+
this.windowProgressStatusEntry = this.statusbarService.addEntry(statusEntryProperties, 'status.progress', StatusbarAlignment.LEFT, Number.NEGATIVE_INFINITY /* last entry */);
194194
}
195195
}
196196

0 commit comments

Comments
 (0)