Skip to content

Commit cefe82c

Browse files
bpaseroCopilot
andauthored
sessions - tweaks to chat input to make it larger (#298416)
* sessions - tweaks to chat input to make it larger * Update src/vs/sessions/browser/media/style.css Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent b41db22 commit cefe82c

File tree

5 files changed

+9
-2
lines changed

5 files changed

+9
-2
lines changed

src/vs/sessions/browser/media/style.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,6 @@
5252
.agent-sessions-workbench .interactive-session .interactive-input-part {
5353
margin: 0 8px !important;
5454
display: inherit !important;
55-
padding: 4px 0 8px 0px !important;
55+
/* Align with changes view */
56+
padding: 4px 0 6px 0 !important;
5657
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ export interface IChatWidgetViewOptions {
263263
enableWorkingSet?: 'explicit' | 'implicit';
264264
supportsChangingModes?: boolean;
265265
dndContainer?: HTMLElement;
266+
inputEditorMinLines?: number;
266267
defaultMode?: IChatMode;
267268
/**
268269
* Optional delegate for the session target picker.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1715,6 +1715,7 @@ export class ChatWidget extends Disposable implements IChatWidget {
17151715
renderWorkingSet: this.viewOptions.enableWorkingSet === 'explicit',
17161716
supportsChangingModes: this.viewOptions.supportsChangingModes,
17171717
dndContainer: this.viewOptions.dndContainer,
1718+
inputEditorMinLines: this.viewOptions.inputEditorMinLines,
17181719
widgetViewKindTag: this.getWidgetViewKindTag(),
17191720
defaultMode: this.viewOptions.defaultMode,
17201721
sessionTypePickerDelegate: this.viewOptions.sessionTypePickerDelegate,

src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ export interface IChatInputPartOptions {
154154
enableImplicitContext?: boolean;
155155
supportsChangingModes?: boolean;
156156
dndContainer?: HTMLElement;
157+
inputEditorMinLines?: number;
157158
widgetViewKindTag: string;
158159
/**
159160
* Optional delegate for the session target picker.
@@ -272,6 +273,7 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
272273
private readonly _contextResourceLabels: ResourceLabels;
273274

274275
private readonly inputEditorMaxHeight: number;
276+
private readonly inputEditorMinHeight: number | undefined;
275277
private inputEditorHeight: number = 0;
276278
private container!: HTMLElement;
277279

@@ -560,6 +562,7 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
560562
this.dnd = this._register(this.instantiationService.createInstance(ChatDragAndDrop, () => this._widget, this._attachmentModel, styles));
561563

562564
this.inputEditorMaxHeight = this.options.renderStyle === 'compact' ? INPUT_EDITOR_MAX_HEIGHT / 3 : INPUT_EDITOR_MAX_HEIGHT;
565+
this.inputEditorMinHeight = this.options.inputEditorMinLines ? this.options.inputEditorMinLines * 20 + (this.options.renderStyle === 'compact' ? 4 : 16) : undefined; // lineHeight is 20, padding is top+bottom
563566

564567
this.inputEditorHasText = ChatContextKeys.inputHasText.bindTo(contextKeyService);
565568
this.chatCursorAtTop = ChatContextKeys.inputCursorAtTop.bindTo(contextKeyService);
@@ -3004,7 +3007,7 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
30043007

30053008
const initialEditorScrollWidth = this._inputEditor.getScrollWidth();
30063009
const newEditorWidth = width - data.inputPartHorizontalPadding - data.editorBorder - data.inputPartHorizontalPaddingInside - data.toolbarsWidth - data.sideToolbarWidth;
3007-
const inputEditorHeight = Math.min(this._inputEditor.getContentHeight(), this.inputEditorMaxHeight);
3010+
const inputEditorHeight = this.inputEditorMinHeight ? Math.max(this.inputEditorMinHeight, Math.min(this._inputEditor.getContentHeight(), this.inputEditorMaxHeight)) : Math.min(this._inputEditor.getContentHeight(), this.inputEditorMaxHeight);
30083011
const newDimension = { width: newEditorWidth, height: inputEditorHeight };
30093012
if (!this.previousInputEditorDimension || (this.previousInputEditorDimension.width !== newDimension.width || this.previousInputEditorDimension.height !== newDimension.height)) {
30103013
// This layout call has side-effects that are hard to understand. eg if we are calling this inside a onDidChangeContent handler, this can trigger the next onDidChangeContent handler

src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@ export class ChatViewPane extends ViewPane implements IViewWelcomeDelegate {
539539
: 'explicit',
540540
supportsChangingModes: true,
541541
dndContainer: parent,
542+
inputEditorMinLines: this.workbenchEnvironmentService.isSessionsWindow ? 2 : undefined,
542543
},
543544
{
544545
listForeground: SIDE_BAR_FOREGROUND,

0 commit comments

Comments
 (0)