Skip to content

Commit 6d9a8ec

Browse files
rwollCopilot
andcommitted
Model picker: use 'Models' in hover and aria-labels for consistency
Address PR review: the visible picker label is now 'Models', but the hover tooltip and aria-labels still read 'Pick Model'. Name the control 'Models' in both (reusing the shared label key) so screen-reader and hover copy match the visible UI. Reword the Restricted Mode suffixes to avoid a 'Models • Models' / 'Models, models' stutter. Retire the now-unused 'Pick Model' string and refresh stale comments referencing it. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent fbdc62f commit 6d9a8ec

5 files changed

Lines changed: 15 additions & 10 deletions

File tree

src/vs/sessions/contrib/chat/browser/modelPicker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ export class ModelPicker extends Disposable {
160160
// Re-evaluate when workspace trust changes (or finishes initializing): an
161161
// untrusted workspace disables the model providers, and the shared widget
162162
// then renders its Restricted Mode state. Visibility is recomputed so the
163-
// picker stays visible to surface "Pick Model" + the Trust action instead
164-
// of hiding as an empty picker.
163+
// picker stays visible to surface the "Models" placeholder + the Trust
164+
// action instead of hiding as an empty picker.
165165
this._register(this._workspaceTrustManagementService.onDidChangeTrust(() => this._initModel()));
166166
this._workspaceTrustManagementService.workspaceTrustInitialized.then(() => {
167167
if (!this._store.isDisposed) {

src/vs/sessions/contrib/providers/agentHost/browser/agentHostSessionConfigPicker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,7 @@ registerAction2(class extends Action2 {
975975
group: 'navigation',
976976
// `OpenModelPickerAction` (the "Auto" model picker) is at order 3
977977
// in the same menu — sit just before it so the mode pill renders
978-
// to the left of "Pick Model".
978+
// to the left of the model picker.
979979
order: 2,
980980
// Hide the agent mode picker while a delegation (continue in) target is pending.
981981
when: ContextKeyExpr.and(ChatContextKeyExprs.isAgentHostSession, ChatContextKeys.hasPendingDelegationTarget.negate()),

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,12 +1555,13 @@ export class ModelPickerWidget extends Disposable {
15551555
}
15561556
}
15571557

1558-
// Aria
1558+
// Aria — name the control "Models" to match the visible label; the comma
1559+
// separates the control name from its current value / state.
15591560
this._domNode.ariaLabel = restrictedMode
1560-
? localize('chat.modelPicker.ariaLabelRestricted', "Pick Model, models unavailable while in Restricted mode")
1561+
? localize('chat.modelPicker.ariaLabelRestricted', "Models, unavailable while in Restricted mode")
15611562
: setupRequired
1562-
? localize('chat.modelPicker.ariaLabelSetupRequired', "Pick Model, sign in to use Copilot")
1563-
: localize('chat.modelPicker.ariaLabel', "Pick Model, {0}", fullLabel);
1563+
? localize('chat.modelPicker.ariaLabelSetupRequired', "Models, sign in to use Copilot")
1564+
: localize('chat.modelPicker.ariaLabel', "Models, {0}", fullLabel);
15641565
}
15651566

15661567
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ export function resolveConfiguredModel(
397397

398398
/**
399399
* Why a model picker has no model to offer, when that is the case. Drives a
400-
* "Pick Model" placeholder plus a contextual action instead of a misleading
400+
* "Models" placeholder plus a contextual action instead of a misleading
401401
* lone "Auto".
402402
*/
403403
export const enum ModelPickerUnavailableReason {

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,17 @@ export class ModelPickerActionItem extends BaseActionViewItem {
163163
}
164164

165165
private _getHoverContents(): IManagedHoverContent {
166-
let label = localize('chat.modelPicker.label', "Pick Model");
166+
// Keep the hover prefix in sync with the picker's visible "Models" label
167+
// (the same localization key) so the hover doesn't read "Pick Model • …".
168+
let label = localize('chat.modelPicker.modelsLabel', "Models");
167169
const keybindingLabel = this.keybindingService.lookupKeybinding(this._action.id, this._contextKeyService)?.getLabel();
168170
if (keybindingLabel) {
169171
label += ` (${keybindingLabel})`;
170172
}
171173
if (this._pickerWidget.isRestrictedMode()) {
172-
return localize('chat.modelPicker.restrictedHover', "{0} • Models unavailable while in Restricted mode. Trust Workspace to enable models.", label);
174+
// Suffix avoids a leading "Models" so the hover doesn't stutter as
175+
// "Models • Models unavailable…" once the prefix is "Models".
176+
return localize('chat.modelPicker.restrictedHover', "{0} • Unavailable while in Restricted mode. Trust Workspace to enable models.", label);
173177
}
174178
if (this._pickerWidget.isSetupRequired()) {
175179
return localize('chat.modelPicker.setupRequiredHover', "{0} • Sign in to GitHub Copilot to choose a model.", label);

0 commit comments

Comments
 (0)