Skip to content

Commit 072f7c3

Browse files
authored
Enable model picker label to show ellipsis instead of overflowing (#232640)
Fix #231369
1 parent 342d1fd commit 072f7c3

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,7 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
645645
return undefined;
646646
}
647647
}));
648+
this.executeToolbar.getElement().classList.add('chat-execute-toolbar');
648649
this.executeToolbar.context = { widget } satisfies IChatExecuteActionContext;
649650
this._register(this.executeToolbar.onDidChangeMenuItems(() => {
650651
if (this.cachedDimensions && typeof this.cachedExecuteToolbarWidth === 'number' && this.cachedExecuteToolbarWidth !== this.executeToolbar.getItemsWidth()) {
@@ -1260,8 +1261,7 @@ class ModelPickerActionViewItem extends MenuEntryActionViewItem {
12601261
if (this.label) {
12611262
const model = this._languageModelsService.lookupLanguageModel(this.currentLanguageModel);
12621263
if (model) {
1263-
this.label.textContent = model.name;
1264-
dom.reset(this.label, ...renderLabelWithIcons(`${model.name}$(chevron-down)`));
1264+
dom.reset(this.label, dom.$('span.chat-model-label', undefined, model.name), ...renderLabelWithIcons(`$(chevron-down)`));
12651265
}
12661266
}
12671267
}

src/vs/workbench/contrib/chat/browser/media/chat.css

+18
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,24 @@ have to be updated for changes to the rules above, or to support more deeply nes
694694
margin-right: auto;
695695
}
696696

697+
.interactive-session .chat-input-toolbars > .chat-execute-toolbar {
698+
min-width: 0px;
699+
700+
.chat-modelPicker-item {
701+
min-width: 0px;
702+
703+
.chat-model-label {
704+
min-width: 0px;
705+
overflow: hidden;
706+
text-overflow: ellipsis;
707+
}
708+
709+
.codicon {
710+
flex-shrink: 0;
711+
}
712+
}
713+
}
714+
697715
.interactive-session .chat-input-toolbars .chat-modelPicker-item .action-label {
698716
height: 16px;
699717
padding: 3px 0px 3px 6px;

0 commit comments

Comments
 (0)