-
Notifications
You must be signed in to change notification settings - Fork 37.6k
Chat resize sash #290621
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
base: main
Are you sure you want to change the base?
Chat resize sash #290621
Conversation
There was a problem hiding this 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(); |
Copilot
AI
Jan 27, 2026
There was a problem hiding this comment.
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.
| this._sashStartHeight = this._getEffectiveMinHeight(); | |
| this._sashStartHeight = this.inputEditorHeight; |
| const contentHeight = Math.min(this._inputEditor.getContentHeight(), this._getMaxAllowedHeight()); | ||
| const currentHeight = Math.max(contentHeight, this._getEffectiveMinHeight()); |
Copilot
AI
Jan 27, 2026
There was a problem hiding this comment.
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.
No description provided.