Skip to content

Commit 1e2f0c3

Browse files
authored
Merge pull request microsoft#187739 from microsoft/merogge/fix-status
announce ghost text to screen reader users in inline chat
2 parents 22bb4b9 + 588b36f commit 1e2f0c3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ export class InlineChatWidget {
180180
private _isLayouting: boolean = false;
181181
private _preferredExpansionState: ExpansionState | undefined;
182182
private _expansionState: ExpansionState = ExpansionState.NOT_CROPPED;
183+
private _slashCommandDetails: { command: string; detail: string }[] = [];
183184

184185
private _slashCommandContentWidget: SlashCommandContentWidget;
185186

@@ -426,9 +427,12 @@ export class InlineChatWidget {
426427
}
427428

428429
readPlaceholder(): void {
430+
const slashCommand = this._slashCommandDetails.find(c => `${c.command} ` === this._inputModel.getValue().substring(1));
429431
const hasText = this._inputModel.getValueLength() > 0;
430432
if (!hasText) {
431433
aria.status(this._elements.placeholder.innerText);
434+
} else if (slashCommand) {
435+
aria.status(slashCommand.detail);
432436
}
433437
}
434438

@@ -629,6 +633,7 @@ export class InlineChatWidget {
629633
if (commands.length === 0) {
630634
return;
631635
}
636+
this._slashCommandDetails = commands.filter(c => c.command && c.detail).map(c => { return { command: c.command!, detail: c.detail! }; });
632637

633638
const selector: LanguageSelector = { scheme: this._inputModel.uri.scheme, pattern: this._inputModel.uri.path, language: this._inputModel.getLanguageId() };
634639
this._slashCommands.add(this._languageFeaturesService.completionProvider.register(selector, new class implements CompletionItemProvider {

0 commit comments

Comments
 (0)