mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
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:
parent
08b0de6fb3
commit
110b68473b
|
@ -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),
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue