Skip to content

Commit c60fe51

Browse files
authored
Minor chat input refinements (#298462)
* Chat input refinements: increase height and update placeholder text * Extract shared constants for input editor line height and padding
1 parent aa70284 commit c60fe51

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ export class AgentTitleBarStatusWidget extends BaseActionViewItem {
432432
label.classList.add('has-progress');
433433
}
434434

435-
const hoverLabel = localize('askAnythingPlaceholder', "Ask anything or describe what to build next");
435+
const hoverLabel = localize('askAnythingPlaceholder', "Ask anything or describe what to build");
436436

437437
label.textContent = defaultLabel;
438438
pill.appendChild(label);

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ import { EnhancedModelPickerActionItem } from './modelPickerActionItem2.js';
131131
const $ = dom.$;
132132

133133
const INPUT_EDITOR_MAX_HEIGHT = 250;
134+
const INPUT_EDITOR_LINE_HEIGHT = 20;
135+
const INPUT_EDITOR_PADDING = { compact: { top: 2, bottom: 2 }, default: { top: 12, bottom: 12 } };
134136
const CachedLanguageModelsKey = 'chat.cachedLanguageModels.v2';
135137

136138
export interface IChatInputStyles {
@@ -562,7 +564,8 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
562564
this.dnd = this._register(this.instantiationService.createInstance(ChatDragAndDrop, () => this._widget, this._attachmentModel, styles));
563565

564566
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
567+
const padding = this.options.renderStyle === 'compact' ? INPUT_EDITOR_PADDING.compact : INPUT_EDITOR_PADDING.default;
568+
this.inputEditorMinHeight = this.options.inputEditorMinLines ? this.options.inputEditorMinLines * INPUT_EDITOR_LINE_HEIGHT + padding.top + padding.bottom : undefined;
566569

567570
this.inputEditorHasText = ChatContextKeys.inputHasText.bindTo(contextKeyService);
568571
this.chatCursorAtTop = ChatContextKeys.inputCursorAtTop.bindTo(contextKeyService);
@@ -2053,8 +2056,8 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
20532056
options.ariaLabel = this._getAriaLabel();
20542057
options.fontFamily = DEFAULT_FONT_FAMILY;
20552058
options.fontSize = 13;
2056-
options.lineHeight = 20;
2057-
options.padding = this.options.renderStyle === 'compact' ? { top: 2, bottom: 2 } : { top: 8, bottom: 8 };
2059+
options.lineHeight = INPUT_EDITOR_LINE_HEIGHT;
2060+
options.padding = this.options.renderStyle === 'compact' ? INPUT_EDITOR_PADDING.compact : INPUT_EDITOR_PADDING.default;
20582061
options.cursorWidth = 1;
20592062
options.wrappingStrategy = 'advanced';
20602063
options.bracketPairColorization = { enabled: false };

src/vs/workbench/contrib/chat/common/chatModes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ export class BuiltinChatMode implements IChatMode {
538538
export namespace ChatMode {
539539
export const Ask = new BuiltinChatMode(ChatModeKind.Ask, 'Ask', localize('chatDescription', "Explore and understand your code"), Codicon.question);
540540
export const Edit = new BuiltinChatMode(ChatModeKind.Edit, 'Edit', localize('editsDescription', "Edit or refactor selected code"), Codicon.edit);
541-
export const Agent = new BuiltinChatMode(ChatModeKind.Agent, 'Agent', localize('agentDescription', "Describe what to build next"), Codicon.agent);
541+
export const Agent = new BuiltinChatMode(ChatModeKind.Agent, 'Agent', localize('agentDescription', "Describe what to build"), Codicon.agent);
542542
}
543543

544544
export function isBuiltinChatMode(mode: IChatMode): boolean {

src/vs/workbench/contrib/chat/test/browser/promptSyntax/languageProviders/promptHovers.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ suite('PromptHoverProvider', () => {
405405
'The agent to use when running this prompt.',
406406
'',
407407
'**Built-in agents:**',
408-
'- `agent`: Describe what to build next',
408+
'- `agent`: Describe what to build',
409409
'- `ask`: Explore and understand your code',
410410
'- `edit`: Edit or refactor selected code',
411411
'',

0 commit comments

Comments
 (0)