Skip to content

Commit 259bfba

Browse files
committed
setup - tweak default window dimensions to better account for secondary sidebar
1 parent 0a35317 commit 259bfba

File tree

8 files changed

+27
-22
lines changed

8 files changed

+27
-22
lines changed

src/vs/platform/auxiliaryWindow/electron-main/auxiliaryWindowsMainService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export class AuxiliaryWindowsMainService extends Disposable implements IAuxiliar
9898
const windowState: IWindowState = {};
9999
const overrides: IDefaultBrowserWindowOptionsOverrides = {};
100100

101-
const features = details.features.split(','); // for example: popup=yes,left=270,top=14.5,width=800,height=600
101+
const features = details.features.split(','); // for example: popup=yes,left=270,top=14.5,width=1024,height=768
102102
for (const feature of features) {
103103
const [key, value] = feature.split('=');
104104
switch (key) {

src/vs/platform/window/electron-main/window.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ export interface IWindowState {
139139

140140
export const defaultWindowState = function (mode = WindowMode.Normal): IWindowState {
141141
return {
142-
width: 1024,
143-
height: 768,
142+
width: 1200,
143+
height: 800,
144144
mode
145145
};
146146
};
@@ -154,8 +154,8 @@ export const defaultAuxWindowState = function (): IWindowState {
154154
// we need to set not only width and height but also x and y to
155155
// a good location on the primary display.
156156

157-
const width = 800;
158-
const height = 600;
157+
const width = 1024;
158+
const height = 768;
159159
const workArea = electron.screen.getPrimaryDisplay().workArea;
160160
const x = Math.max(workArea.x + (workArea.width / 2) - (width / 2), 0);
161161
const y = Math.max(workArea.y + (workArea.height / 2) - (height / 2), 0);

src/vs/platform/windows/test/electron-main/windowsStateHandler.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ suite('Windows State Storing', () => {
183183
"mode": 1,
184184
"x": 768,
185185
"y": 336,
186-
"width": 1024,
187-
"height": 768
186+
"width": 1200,
187+
"height": 800
188188
}
189189
}
190190
}`;
@@ -194,7 +194,7 @@ suite('Windows State Storing', () => {
194194
openedWindows: [],
195195
lastActiveWindow: {
196196
backupPath: '/home/user/.config/code-oss-dev/Backups/1549539668998',
197-
uiState: { mode: WindowMode.Normal, x: 768, y: 336, width: 1024, height: 768 }
197+
uiState: { mode: WindowMode.Normal, x: 768, y: 336, width: 1200, height: 800 }
198198
}
199199
};
200200
assertEqualWindowsState(expected, windowsState, 'v1_32_empty_window');

src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export class ChatGettingStartedContribution extends Disposable implements IWorkb
7777

7878
// Open and configure chat view
7979
await this.commandService.executeCommand(CHAT_OPEN_ACTION_ID);
80-
ensureSideBarChatViewSize(400, this.viewDescriptorService, this.layoutService);
80+
ensureSideBarChatViewSize(this.viewDescriptorService, this.layoutService);
8181

8282
// Only do this once
8383
this.storageService.store(ChatGettingStartedContribution.hideWelcomeView, true, StorageScope.APPLICATION, StorageTarget.MACHINE);

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,16 @@ export async function showEditsView(viewsService: IViewsService): Promise<IChatW
5252
return (await viewsService.openView<ChatViewPane>(EditsViewId))?.widget;
5353
}
5454

55-
export function ensureSideBarChatViewSize(width: number, viewDescriptorService: IViewDescriptorService, layoutService: IWorkbenchLayoutService): void {
55+
export function ensureSideBarChatViewSize(viewDescriptorService: IViewDescriptorService, layoutService: IWorkbenchLayoutService): void {
5656
const location = viewDescriptorService.getViewLocationById(ChatViewId);
5757
if (location === ViewContainerLocation.Panel) {
5858
return; // panel is typically very wide
5959
}
6060

6161
const viewPart = location === ViewContainerLocation.Sidebar ? Parts.SIDEBAR_PART : Parts.AUXILIARYBAR_PART;
6262
const partSize = layoutService.getSize(viewPart);
63-
if (partSize.width < width) {
64-
layoutService.setSize(viewPart, { width: width, height: partSize.height });
63+
if (partSize.width < 300) {
64+
layoutService.setSize(viewPart, { width: 300, height: partSize.height });
6565
}
6666
}
6767

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

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ export class ChatSetupContribution extends Disposable implements IWorkbenchContr
172172
await that.context.update({ hidden: false });
173173

174174
showCopilotView(viewsService, layoutService);
175-
ensureSideBarChatViewSize(400, viewDescriptorService, layoutService);
175+
ensureSideBarChatViewSize(viewDescriptorService, layoutService);
176176

177177
if (startSetup === true) {
178178
that.controller.value.setup();
@@ -911,26 +911,29 @@ class ChatSetupWelcomeContent extends Disposable {
911911
const header = localize({ key: 'header', comment: ['{Locked="[Copilot]({0})"}'] }, "[Copilot]({0}) is your AI pair programmer.", this.context.state.installed ? 'command:github.copilot.open.walkthrough' : defaultChat.documentationUrl);
912912
this.element.appendChild($('p')).appendChild(this._register(markdown.render(new MarkdownString(header, { isTrusted: true }))).element);
913913

914-
const features = this.element.appendChild($('div.chat-features-container'));
915-
this.element.appendChild(features);
914+
const featuresParent = this.element.appendChild($('div.chat-features-container'));
915+
this.element.appendChild(featuresParent);
916916

917-
const featureChatContainer = features.appendChild($('div.chat-feature-container'));
917+
const featuresContainer = this.element.appendChild($('div'));
918+
featuresParent.appendChild(featuresContainer);
919+
920+
const featureChatContainer = featuresContainer.appendChild($('div.chat-feature-container'));
918921
featureChatContainer.appendChild(renderIcon(Codicon.code));
919922

920923
const featureChatLabel = featureChatContainer.appendChild($('span'));
921-
featureChatLabel.textContent = localize('featureChat', "Code faster with completions and Inline Chat");
924+
featureChatLabel.textContent = localize('featureChat', "Code faster with Completions");
922925

923-
const featureEditsContainer = features.appendChild($('div.chat-feature-container'));
926+
const featureEditsContainer = featuresContainer.appendChild($('div.chat-feature-container'));
924927
featureEditsContainer.appendChild(renderIcon(Codicon.editSession));
925928

926929
const featureEditsLabel = featureEditsContainer.appendChild($('span'));
927-
featureEditsLabel.textContent = localize('featureEdits', "Build features and resolve bugs with Copilot Edits");
930+
featureEditsLabel.textContent = localize('featureEdits', "Build features with Copilot Edits");
928931

929-
const featureExploreContainer = features.appendChild($('div.chat-feature-container'));
932+
const featureExploreContainer = featuresContainer.appendChild($('div.chat-feature-container'));
930933
featureExploreContainer.appendChild(renderIcon(Codicon.commentDiscussion));
931934

932935
const featureExploreLabel = featureExploreContainer.appendChild($('span'));
933-
featureExploreLabel.textContent = localize('featureExplore', "Explore your codebase with chat");
936+
featureExploreLabel.textContent = localize('featureExplore', "Explore your codebase with Chat");
934937
}
935938

936939
// Limited SKU

src/vs/workbench/contrib/chat/browser/media/chatViewSetup.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
}
1212

1313
.chat-features-container {
14+
display: flex;
15+
justify-content: center;
1416
text-align: initial;
1517
border-radius: 2px;
1618
border: 1px solid var(--vscode-chat-requestBorder);

src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ export class BrowserAuxiliaryWindowService extends Disposable implements IAuxili
225225

226226
declare readonly _serviceBrand: undefined;
227227

228-
private static readonly DEFAULT_SIZE = { width: 800, height: 600 };
228+
private static readonly DEFAULT_SIZE = { width: 1024, height: 768 };
229229

230230
private static WINDOW_IDS = getWindowId(mainWindow) + 1; // start from the main window ID + 1
231231

0 commit comments

Comments
 (0)