Skip to content

Commit 110b684

Browse files
authored
Always set max-width on chat views, not just in editor (microsoft#183484)
* Cleanup from microsoft#183481 * Always set max-width on chat views, not just in editor
1 parent 08b0de6 commit 110b684

File tree

3 files changed

+4
-32
lines changed

3 files changed

+4
-32
lines changed

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

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const getMoveToEditorChatActionDescriptorForViewTitle = (viewId: string, provide
3232
viewId,
3333
menu: {
3434
id: MenuId.ViewTitle,
35-
when: ContextKeyExpr.and(ContextKeyExpr.equals('view', viewId)),
35+
when: ContextKeyExpr.equals('view', viewId),
3636
order: 0
3737
},
3838
});
@@ -56,35 +56,6 @@ export function getMoveToEditorAction(viewId: string, providerId: string) {
5656
};
5757
}
5858

59-
const getMoveToSidebarChatActionDescriptorForViewTitle = (viewId: string, providerId: string): Readonly<IAction2Options> & { viewId: string } => ({
60-
id: `workbench.action.chat.${providerId}.openInSidebar`,
61-
title: {
62-
value: localize('chat.openInSidebar.label', "Open In Sidebar"),
63-
original: 'Open In Sidebar'
64-
},
65-
category: CHAT_CATEGORY,
66-
precondition: CONTEXT_PROVIDER_EXISTS,
67-
f1: false,
68-
viewId,
69-
menu: [{
70-
id: MenuId.EditorTitle,
71-
order: 0,
72-
when: ContextKeyExpr.and(ActiveEditorContext.isEqualTo(ChatEditorInput.EditorID)),
73-
}]
74-
});
75-
76-
export function getMoveToSidebarAction(viewId: string, providerId: string) {
77-
return class MoveToSidebarAction extends Action2 {
78-
constructor() {
79-
super(getMoveToSidebarChatActionDescriptorForViewTitle(viewId, providerId));
80-
}
81-
82-
override async run(accessor: ServicesAccessor, ...args: any[]) {
83-
return moveToSidebar(accessor);
84-
}
85-
};
86-
}
87-
8859
async function moveToSidebar(accessor: ServicesAccessor): Promise<void> {
8960
const viewsService = accessor.get(IViewsService);
9061
const editorService = accessor.get(IEditorService);
@@ -151,7 +122,7 @@ export function registerMoveActions() {
151122
menu: [{
152123
id: MenuId.EditorTitle,
153124
order: 0,
154-
when: ContextKeyExpr.and(ActiveEditorContext.isEqualTo(ChatEditorInput.EditorID)),
125+
when: ActiveEditorContext.isEqualTo(ChatEditorInput.EditorID),
155126
}]
156127
});
157128
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ export class ChatWidget extends Disposable implements IChatWidget {
418418
}
419419

420420
layout(height: number, width: number): void {
421+
width = Math.min(width, 600);
421422
this.bodyDimension = new dom.Dimension(width, height);
422423

423424
const inputPartHeight = this.inputPart.layout(height, width);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
.editor-instance .interactive-session {
6+
.interactive-session {
77
max-width: 600px;
88
margin: auto;
99
}

0 commit comments

Comments
 (0)