Skip to content

Commit

Permalink
Always set max-width on chat views, not just in editor (#183484)
Browse files Browse the repository at this point in the history
* Cleanup from #183481

* Always set max-width on chat views, not just in editor
  • Loading branch information
roblourens committed May 26, 2023
1 parent 08b0de6 commit 110b684
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 32 deletions.
33 changes: 2 additions & 31 deletions src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
});
Expand All @@ -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);
Expand Down Expand Up @@ -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),
}]
});
}
Expand Down
1 change: 1 addition & 0 deletions src/vs/workbench/contrib/chat/browser/chatWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/contrib/chat/browser/media/chat.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 110b684

Please sign in to comment.