Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc UX polishes of Quick Chat #191483

Merged
merged 1 commit into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/vs/workbench/contrib/chat/browser/chatQuick.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class QuickChatService extends Disposable implements IQuickChatService {
readonly onDidClose = this._onDidClose.event;

private _input: IQuickWidget | undefined;
// TODO: support multiple chat providers eventually
// TODO@TylerLeonhardt: support multiple chat providers eventually
private _currentChat: QuickChat | undefined;
private _container: HTMLElement | undefined;

Expand Down Expand Up @@ -119,6 +119,10 @@ export class QuickChatService extends Disposable implements IQuickChatService {
}

class QuickChat extends Disposable {
// TODO@TylerLeonhardt: be responsive to window size
static DEFAULT_MIN_HEIGHT = 200;
static DEFAULT_MAX_HEIGHT = 900;

private widget!: ChatWidget;
private sash!: Sash;
private model: ChatModel | undefined;
Expand Down Expand Up @@ -178,7 +182,7 @@ class QuickChat extends Disposable {
}));
this.widget.render(parent);
this.widget.setVisible(true);
this.widget.setDynamicChatTreeItemLayout(2, 900);
this.widget.setDynamicChatTreeItemLayout(2, QuickChat.DEFAULT_MAX_HEIGHT);
this.updateModel();
this.sash = this._register(new Sash(parent, { getHorizontalSashTop: () => parent.offsetHeight }, { orientation: Orientation.HORIZONTAL }));
this.registerListeners(parent);
Expand All @@ -192,7 +196,7 @@ class QuickChat extends Disposable {
this._register(this.widget.onDidChangeHeight((e) => this.sash.layout()));
const width = parent.offsetWidth;
this._register(this.sash.onDidChange((e) => {
if (e.currentY < 200) {
if (e.currentY < QuickChat.DEFAULT_MIN_HEIGHT || e.currentY > QuickChat.DEFAULT_MAX_HEIGHT) {
return;
}
this.widget.layout(e.currentY, width);
Expand Down
5 changes: 5 additions & 0 deletions src/vs/workbench/contrib/chat/browser/media/chat.css
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,11 @@
border-radius: 2px;
}

.quick-input-widget .interactive-list {
border-bottom-right-radius: 6px;
border-bottom-left-radius: 6px;
}

/* #endregion */

.interactive-response-progress-tree .monaco-tl-row:hover {
Expand Down