Skip to content

Commit

Permalink
Enable model picker label to show ellipsis instead of overflowing (#2…
Browse files Browse the repository at this point in the history
  • Loading branch information
roblourens authored Oct 30, 2024
1 parent 342d1fd commit 072f7c3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/vs/workbench/contrib/chat/browser/chatInputPart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,7 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
return undefined;
}
}));
this.executeToolbar.getElement().classList.add('chat-execute-toolbar');
this.executeToolbar.context = { widget } satisfies IChatExecuteActionContext;
this._register(this.executeToolbar.onDidChangeMenuItems(() => {
if (this.cachedDimensions && typeof this.cachedExecuteToolbarWidth === 'number' && this.cachedExecuteToolbarWidth !== this.executeToolbar.getItemsWidth()) {
Expand Down Expand Up @@ -1260,8 +1261,7 @@ class ModelPickerActionViewItem extends MenuEntryActionViewItem {
if (this.label) {
const model = this._languageModelsService.lookupLanguageModel(this.currentLanguageModel);
if (model) {
this.label.textContent = model.name;
dom.reset(this.label, ...renderLabelWithIcons(`${model.name}$(chevron-down)`));
dom.reset(this.label, dom.$('span.chat-model-label', undefined, model.name), ...renderLabelWithIcons(`$(chevron-down)`));
}
}
}
Expand Down
18 changes: 18 additions & 0 deletions src/vs/workbench/contrib/chat/browser/media/chat.css
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,24 @@ have to be updated for changes to the rules above, or to support more deeply nes
margin-right: auto;
}

.interactive-session .chat-input-toolbars > .chat-execute-toolbar {
min-width: 0px;

.chat-modelPicker-item {
min-width: 0px;

.chat-model-label {
min-width: 0px;
overflow: hidden;
text-overflow: ellipsis;
}

.codicon {
flex-shrink: 0;
}
}
}

.interactive-session .chat-input-toolbars .chat-modelPicker-item .action-label {
height: 16px;
padding: 3px 0px 3px 6px;
Expand Down

0 comments on commit 072f7c3

Please sign in to comment.