Always set max-width on chat views, not just in editor (#183484)

* Cleanup from #183481

* Always set max-width on chat views, not just in editor
This commit is contained in:
Rob Lourens 2023-05-25 17:55:06 -07:00 committed by GitHub
parent 08b0de6fb3
commit 110b68473b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 32 deletions

View file

@ -32,7 +32,7 @@ const getMoveToEditorChatActionDescriptorForViewTitle = (viewId: string, provide
viewId,
menu: {
id: MenuId.ViewTitle,
when: ContextKeyExpr.and(ContextKeyExpr.equals('view', viewId)),
when: ContextKeyExpr.equals('view', viewId),
order: 0
},
});
@ -56,35 +56,6 @@ export function getMoveToEditorAction(viewId: string, providerId: string) {
};
}
const getMoveToSidebarChatActionDescriptorForViewTitle = (viewId: string, providerId: string): Readonly<IAction2Options> & { viewId: string } => ({
id: `workbench.action.chat.${providerId}.openInSidebar`,
title: {
value: localize('chat.openInSidebar.label', "Open In Sidebar"),
original: 'Open In Sidebar'
},
category: CHAT_CATEGORY,
precondition: CONTEXT_PROVIDER_EXISTS,
f1: false,
viewId,
menu: [{
id: MenuId.EditorTitle,
order: 0,
when: ContextKeyExpr.and(ActiveEditorContext.isEqualTo(ChatEditorInput.EditorID)),
}]
});
export function getMoveToSidebarAction(viewId: string, providerId: string) {
return class MoveToSidebarAction extends Action2 {
constructor() {
super(getMoveToSidebarChatActionDescriptorForViewTitle(viewId, providerId));
}
override async run(accessor: ServicesAccessor, ...args: any[]) {
return moveToSidebar(accessor);
}
};
}
async function moveToSidebar(accessor: ServicesAccessor): Promise<void> {
const viewsService = accessor.get(IViewsService);
const editorService = accessor.get(IEditorService);
@ -151,7 +122,7 @@ export function registerMoveActions() {
menu: [{
id: MenuId.EditorTitle,
order: 0,
when: ContextKeyExpr.and(ActiveEditorContext.isEqualTo(ChatEditorInput.EditorID)),
when: ActiveEditorContext.isEqualTo(ChatEditorInput.EditorID),
}]
});
}

View file

@ -418,6 +418,7 @@ export class ChatWidget extends Disposable implements IChatWidget {
}
layout(height: number, width: number): void {
width = Math.min(width, 600);
this.bodyDimension = new dom.Dimension(width, height);
const inputPartHeight = this.inputPart.layout(height, width);

View file

@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.editor-instance .interactive-session {
.interactive-session {
max-width: 600px;
margin: auto;
}