mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
Fix inline chat content widget dimensions (#208890)
* tweak min/max width on inline chat content widget fixes https://github.com/microsoft/vscode/issues/208882 fixes https://github.com/microsoft/vscode/issues/208879 * use a fixed width, cap overall height
This commit is contained in:
parent
7ae09768ca
commit
6363ecfa73
|
@ -10,7 +10,6 @@ import { IDimension } from 'vs/editor/common/core/dimension';
|
|||
import { Emitter, Event } from 'vs/base/common/event';
|
||||
import { DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { IPosition, Position } from 'vs/editor/common/core/position';
|
||||
import { clamp } from 'vs/base/common/numbers';
|
||||
import { renderLabelWithIcons } from 'vs/base/browser/ui/iconLabel/iconLabels';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { inlineChatBackground } from 'vs/workbench/contrib/inlineChat/common/inlineChat';
|
||||
|
@ -22,6 +21,7 @@ import { ChatModel } from 'vs/workbench/contrib/chat/common/chatModel';
|
|||
import { Range } from 'vs/editor/common/core/range';
|
||||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { EditorOption } from 'vs/editor/common/config/editorOptions';
|
||||
|
||||
export class InlineChatContentWidget implements IContentWidget {
|
||||
|
||||
|
@ -130,14 +130,10 @@ export class InlineChatContentWidget implements IContentWidget {
|
|||
|
||||
beforeRender(): IDimension | null {
|
||||
|
||||
const contentWidth = this._editor.getLayoutInfo().contentWidth;
|
||||
const minWidth = Math.round(contentWidth * 0.38);
|
||||
const maxWidth = Math.round(contentWidth * 0.82);
|
||||
|
||||
const width = clamp(220, minWidth, maxWidth);
|
||||
|
||||
const maxHeight = this._widget.input.inputEditor.getOption(EditorOption.lineHeight) * 5;
|
||||
const inputEditorHeight = this._widget.inputEditor.getContentHeight();
|
||||
this._widget.inputEditor.layout(new dom.Dimension(width, inputEditorHeight));
|
||||
|
||||
this._widget.inputEditor.layout(new dom.Dimension(360, Math.min(maxHeight, inputEditorHeight)));
|
||||
|
||||
// const actualHeight = this._widget.inputPartHeight;
|
||||
// return new dom.Dimension(width, actualHeight);
|
||||
|
|
|
@ -15,6 +15,10 @@
|
|||
display: none;
|
||||
}
|
||||
|
||||
.monaco-workbench .inline-chat-content-widget.interactive-session .interactive-session {
|
||||
max-width: unset;
|
||||
}
|
||||
|
||||
.monaco-workbench .inline-chat-content-widget.interactive-session .interactive-input-part .interactive-execute-toolbar {
|
||||
margin-bottom: 1px;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue