Skip to content

Conversation

@roblourens
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings January 26, 2026 23:54
@roblourens roblourens self-assigned this Jan 26, 2026
Copy link
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 adds a resize sash to the chat input part, allowing users to manually adjust the editor height by dragging a horizontal sash at the top of the input area.

Changes:

  • Added a horizontal sash component to ChatInputPart for manual height resizing
  • Implemented height calculation logic with user-set minimum and maximum constraints
  • Added unit tests for the resize logic mathematical constraints
  • Added CSS positioning for the sash at the top of the input part

Reviewed changes

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

File Description
src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.ts Added sash creation, event handlers for drag operations, and helper methods for height calculations
src/vs/workbench/contrib/chat/browser/widget/media/chat.css Added CSS to position the sash at the top of the input part
src/vs/workbench/contrib/chat/test/browser/widget/input/chatInputPartSash.test.ts Added unit tests for sash resize logic and editor height calculations

this._sash = this._register(new Sash(container, layoutProvider, { orientation: Orientation.HORIZONTAL }));

this._register(this._sash.onDidStart(() => {
this._sashStartHeight = this._getEffectiveMinHeight();
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

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

The sash start height should be set to the current editor height, not the effective minimum height. When dragging starts, the calculation should be based on where the editor currently is, not just the user-set minimum. This should be this._sashStartHeight = this.inputEditorHeight; to match the test logic and expected behavior.

Suggested change
this._sashStartHeight = this._getEffectiveMinHeight();
this._sashStartHeight = this.inputEditorHeight;

Copilot uses AI. Check for mistakes.
Comment on lines +1841 to +1842
const contentHeight = Math.min(this._inputEditor.getContentHeight(), this._getMaxAllowedHeight());
const currentHeight = Math.max(contentHeight, this._getEffectiveMinHeight());
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

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

The height calculation logic needs to be consistent. While the onDidChangeModelContent handler now correctly applies constraints using _getMaxAllowedHeight() and _getEffectiveMinHeight(), the onDidContentSizeChange handler at line 1860 (outside this diff) sets height to e.contentHeight directly without these constraints. This could cause inconsistent behavior between the two handlers.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants