Skip to content

adjust padding and height for chat editor and welcome widget#297693

Merged
sandy081 merged 1 commit intomainfrom
sandy081/convinced-echidna
Feb 25, 2026
Merged

adjust padding and height for chat editor and welcome widget#297693
sandy081 merged 1 commit intomainfrom
sandy081/convinced-echidna

Conversation

@sandy081
Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings February 25, 2026 14:49
@sandy081 sandy081 enabled auto-merge (squash) February 25, 2026 14:49
@sandy081 sandy081 self-assigned this Feb 25, 2026
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 25, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements dynamic height adjustment for the chat editor in the Agent Sessions window and adds horizontal padding to the welcome widget. The changes enable the editor to grow and shrink based on content while respecting minimum and maximum height constraints, improving the user experience during text input.

Changes:

  • Added dynamic height adjustment to the chat editor that responds to content size changes (50-200px range)
  • Updated CSS min-height from 36px to 50px to align with the new minimum height constraint
  • Added horizontal padding (12px) to the chat welcome container for better visual spacing

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/vs/sessions/contrib/chat/browser/newChatViewPane.ts Added _editorContainer field and onDidContentSizeChange handler to dynamically adjust editor height based on content
src/vs/sessions/contrib/chat/browser/media/chatWidget.css Updated min-height from 36px to 50px to match the minimum height constraint used in TypeScript
src/vs/sessions/contrib/chat/browser/media/chatWelcomePart.css Added horizontal padding (0 12px 10% 12px) to the welcome container for consistent spacing

Comment on lines 439 to 443
this._register(this._editor.onDidContentSizeChange(() => {
const contentHeight = this._editor.getContentHeight();
const clampedHeight = Math.min(200, Math.max(50, contentHeight));
this._editorContainer.style.height = `${clampedHeight}px`;
this._editor.layout();
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation should check if the height actually changed before updating the DOM and calling layout(). Similar implementations in chatInputPart.ts (line 2114) check e.contentHeightChanged before proceeding. Additionally, consider tracking the previous height to avoid unnecessary DOM updates when the clamped height remains the same, as this event can fire frequently during typing.

Copilot uses AI. Check for mistakes.

this._register(this._editor.onDidContentSizeChange(() => {
const contentHeight = this._editor.getContentHeight();
const clampedHeight = Math.min(200, Math.max(50, contentHeight));
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CSS defines min-height: 50px and max-height: 200px, but the TypeScript clamping uses Math.min(200, Math.max(50, contentHeight)). While functionally equivalent, this creates a potential maintenance issue where the height constraints are duplicated in two places. If these values need to change in the future, both locations must be updated. Consider extracting these as named constants (e.g., MIN_EDITOR_HEIGHT, MAX_EDITOR_HEIGHT) that can be shared or at least documented together.

Copilot uses AI. Check for mistakes.
@@ -41,7 +41,7 @@
.sessions-chat-editor {
padding: 0 6px 6px 6px;
height: 50px;
Copy link

Copilot AI Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CSS static height property (line 43: height: 50px) may conflict with the dynamic height being set via inline styles in TypeScript (line 442). When both are present, the inline style will take precedence, but this creates confusion about the source of truth for the height. Consider removing the static height: 50px from the CSS since it's now being managed dynamically, leaving only min-height and max-height as constraints.

Suggested change
height: 50px;

Copilot uses AI. Check for mistakes.
@sandy081 sandy081 merged commit 731aa3c into main Feb 25, 2026
24 checks passed
@sandy081 sandy081 deleted the sandy081/convinced-echidna branch February 25, 2026 15:26
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Apr 11, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants