Skip to content

Commit 04c6127

Browse files
authored
Include model info in chat input aria label (microsoft#273160)
1 parent b7d8cdd commit 04c6127

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,7 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
520520
if (this._currentLanguageModel?.metadata.name) {
521521
this.accessibilityService.alert(this._currentLanguageModel.metadata.name);
522522
}
523+
this._inputEditor?.updateOptions({ ariaLabel: this._getAriaLabel() });
523524
}));
524525
this._register(this.chatModeService.onDidChangeChatModes(() => this.validateCurrentChatMode()));
525526
this._register(autorun(r => {
@@ -797,6 +798,11 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
797798
if (verbose) {
798799
kbLabel = this.keybindingService.lookupKeybinding(AccessibilityCommandId.OpenAccessibilityHelp)?.getLabel();
799800
}
801+
802+
// Include model information if available
803+
const modelName = this._currentLanguageModel?.metadata.name;
804+
const modelInfo = modelName ? localize('chatInput.model', ", {0}. ", modelName) : '';
805+
800806
let modeLabel = '';
801807
switch (this.currentModeKind) {
802808
case ChatModeKind.Agent:
@@ -812,10 +818,10 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
812818
}
813819
if (verbose) {
814820
return kbLabel
815-
? localize('actions.chat.accessibiltyHelp', "Chat Input {0} Press Enter to send out the request. Use {1} for Chat Accessibility Help.", modeLabel, kbLabel)
816-
: localize('chatInput.accessibilityHelpNoKb', "Chat Input {0} Press Enter to send out the request. Use the Chat Accessibility Help command for more information.", modeLabel);
821+
? localize('actions.chat.accessibiltyHelp', "Chat Input {0}{1} Press Enter to send out the request. Use {2} for Chat Accessibility Help.", modelInfo, modeLabel, kbLabel)
822+
: localize('chatInput.accessibilityHelpNoKb', "Chat Input {0}{1} Press Enter to send out the request. Use the Chat Accessibility Help command for more information.", modelInfo, modeLabel);
817823
} else {
818-
return localize('chatInput.accessibilityHelp', "Chat Input {0}.", modeLabel);
824+
return localize('chatInput.accessibilityHelp', "Chat Input {0}{1}.", modelInfo, modeLabel);
819825
}
820826
}
821827

0 commit comments

Comments
 (0)