Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screen reader announcement for chat response is too verbose #212788

Open
bpasero opened this issue May 15, 2024 · 13 comments · Fixed by #212916 or #213939
Open

Screen reader announcement for chat response is too verbose #212788

bpasero opened this issue May 15, 2024 · 13 comments · Fixed by #212916 or #213939
Assignees
Labels
accessibility Keyboard, mouse, ARIA, vision, screen readers (non-specific) issues bug Issue identified by VS Code Team member as probable bug chat under-discussion Issue is under discussion for relevance, priority, approach
Milestone

Comments

@bpasero
Copy link
Member

bpasero commented May 15, 2024

Have a response that contains references to code, e.g. :

image

Start screen reader and click on the response. Notice how the full URLs are being read out aloud which are very long.

Verbatim text:

The [`IPositionList`](command:_github.copilot.openSymbolFromReferences?%5B%7B%22%24mid%22%3A1%2C%22fsPath%22%3A%22%2FUsers%2Fbpasero%2FDocuments%2Fticino-playground%2FGame.ts%22%2C%22external%22%3A%22file%3A%2F%2F%2FUsers%2Fbpasero%2FDocuments%2Fticino-playground%2FGame.ts%22%2C%22path%22%3A%22%2FUsers%2Fbpasero%2FDocuments%2Fticino-playground%2FGame.ts%22%2C%22scheme%22%3A%22file%22%7D%2C%7B%22line%22%3A14%2C%22character%22%3A4%7D%5D "Game.ts") interface you've defined in TypeScript extends from a base interface [`Base.IList`](command:_github.copilot.openSymbolFromReferences?%5B%7B%22%24mid%22%3A1%2C%22path%22%3A%22%2FUsers%2Fbpasero%2FDocuments%2Fticino-playground%2Flib%2FBase.ts%22%2C%22scheme%22%3A%22file%22%7D%2C%7B%22line%22%3A0%2C%22character%22%3A0%7D%5D "lib/Base.ts"). This means that [`IPositionList`](command:_github.copilot.openSymbolFromReferences?%5B%7B%22%24mid%22%3A1%2C%22fsPath%22%3A%22%2FUsers%2Fbpasero%2FDocuments%2Fticino-playground%2FGame.ts%22%2C%22external%22%3A%22file%3A%2F%2F%2FUsers%2Fbpasero%2FDocuments%2Fticino-playground%2FGame.ts%22%2C%22path%22%3A%22%2FUsers%2Fbpasero%2FDocuments%2Fticino-playground%2FGame.ts%22%2C%22scheme%22%3A%22file%22%7D%2C%7B%22line%22%3A14%2C%22character%22%3A4%7D%5D "Game.ts") inherits all the properties and methods of [`Base.IList`](command:_github.copilot.openSymbolFromReferences?%5B%7B%22%24mid%22%3A1%2C%22path%22%3A%22%2FUsers%2Fbpasero%2FDocuments%2Fticino-playground%2Flib%2FBase.ts%22%2C%22scheme%22%3A%22file%22%7D%2C%7B%22line%22%3A0%2C%22character%22%3A0%7D%5D "lib/Base.ts") and adds some more specific ones. 

Here are the additional properties and methods in [`IPositionList`](command:_github.copilot.openSymbolFromReferences?%5B%7B%22%24mid%22%3A1%2C%22fsPath%22%3A%22%2FUsers%2Fbpasero%2FDocuments%2Fticino-playground%2FGame.ts%22%2C%22external%22%3A%22file%3A%2F%2F%2FUsers%2Fbpasero%2FDocuments%2Fticino-playground%2FGame.ts%22%2C%22path%22%3A%22%2FUsers%2Fbpasero%2FDocuments%2Fticino-playground%2FGame.ts%22%2C%22scheme%22%3A%22file%22%7D%2C%7B%22line%22%3A14%2C%22character%22%3A4%7D%5D "Game.ts"):

- `data: Position;` This is a property of type [`Position`](command:_github.copilot.openSymbolFromReferences?%5B%7B%22%24mid%22%3A1%2C%22fsPath%22%3A%22%2FUsers%2Fbpasero%2FDocuments%2Fticino-playground%2FPosition.ts%22%2C%22external%22%3A%22file%3A%2F%2F%2FUsers%2Fbpasero%2FDocuments%2Fticino-playground%2FPosition.ts%22%2C%22path%22%3A%22%2FUsers%2Fbpasero%2FDocuments%2Fticino-playground%2FPosition.ts%22%2C%22scheme%22%3A%22file%22%7D%2C%7B%22line%22%3A46%2C%22character%22%3A4%7D%5D "Position.ts"). It's not clear from the provided code what [`Position`](command:_github.copilot.openSymbolFromReferences?%5B%7B%22%24mid%22%3A1%2C%22fsPath%22%3A%22%2FUsers%2Fbpasero%2FDocuments%2Fticino-playground%2FPosition.ts%22%2C%22external%22%3A%22file%3A%2F%2F%2FUsers%2Fbpasero%2FDocuments%2Fticino-playground%2FPosition.ts%22%2C%22path%22%3A%22%2FUsers%2Fbpasero%2FDocuments%2Fticino-playground%2FPosition.ts%22%2C%22scheme%22%3A%22file%22%7D%2C%7B%22line%22%3A46%2C%22character%22%3A4%7D%5D "Position.ts") is, but it's likely a custom type or interface defined elsewhere in your code.
- `push(pos: Position);` This is a method that takes a [`Position`](command:_github.copilot.openSymbolFromReferences?%5B%7B%22%24mid%22%3A1%2C%22fsPath%22%3A%22%2FUsers%2Fbpasero%2FDocuments%2Fticino-playground%2FPosition.ts%22%2C%22external%22%3A%22file%3A%2F%2F%2FUsers%2Fbpasero%2FDocuments%2Fticino-playground%2FPosition.ts%22%2C%22path%22%3A%22%2FUsers%2Fbpasero%2FDocuments%2Fticino-playground%2FPosition.ts%22%2C%22scheme%22%3A%22file%22%7D%2C%7B%22line%22%3A46%2C%22character%22%3A4%7D%5D "Position.ts") object as an argument. The implementation of this method is not provided in the interface, it's expected to be provided in any class that implements this interface.
- `pop(): Position;` This is a method that doesn't take any arguments and returns a [`Position`](command:_github.copilot.openSymbolFromReferences?%5B%7B%22%24mid%22%3A1%2C%22fsPath%22%3A%22%2FUsers%2Fbpasero%2FDocuments%2Fticino-playground%2FPosition.ts%22%2C%22external%22%3A%22file%3A%2F%2F%2FUsers%2Fbpasero%2FDocuments%2Fticino-playground%2FPosition.ts%22%2C%22path%22%3A%22%2FUsers%2Fbpasero%2FDocuments%2Fticino-playground%2FPosition.ts%22%2C%22scheme%22%3A%22file%22%7D%2C%7B%22line%22%3A46%2C%22character%22%3A4%7D%5D "Position.ts") 

I think this stems from the fact that we just take the response as string here:

const responseContent = typeof response === 'string' ? response : response?.response.asString();

@bpasero bpasero added accessibility Keyboard, mouse, ARIA, vision, screen readers (non-specific) issues chat labels May 15, 2024
@bpasero
Copy link
Member Author

bpasero commented May 15, 2024

Btw I have a similar challenge for the text-to-speech integration where I am thinking about converting the markdown string to a plain text string using renderStringAsPlaintext:

export function renderStringAsPlaintext(string: IMarkdownString | string) {

But I did notice that this would remove some text, such as ordered list.

@bpasero
Copy link
Member Author

bpasero commented May 15, 2024

@alexdima made a good point in our standup today: why are we not leveraging the HTML screen reader support for chat items but use aria.alert?

status(responseContent + errorDetails);

@meganrogge
Copy link
Contributor

The HTML screen reader support requires users to enter different modes to navigate - browse/focus mode. Feedback from screen reader users suggested this is not user friendly.

Users will examine content in detail in the chat accessible view, not here. Providing an overview of the response with aria alert is desired. This is similar to how sighted users see the response streaming in. Screen reader users press escape if they don't wish to hear the content.

@meganrogge meganrogge added the under-discussion Issue is under discussion for relevance, priority, approach label May 15, 2024
@meganrogge
Copy link
Contributor

I agree it's not good that it's reading the full URLs. A similar problem is here #210665 and my solution to that will be to remove those links and provide an alternate way of setting any keybindings which are undefined.

@meganrogge meganrogge added the bug Issue identified by VS Code Team member as probable bug label May 16, 2024
@meganrogge meganrogge added this to the May 2024 milestone May 16, 2024
meganrogge added a commit that referenced this issue May 16, 2024
@VSCodeTriageBot VSCodeTriageBot added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels May 16, 2024
@rzhao271 rzhao271 added the verified Verification succeeded label May 29, 2024
@rzhao271
Copy link
Contributor

Potential verification found: I asked for the location of some code, and after Copilot finished typing out the response, it announced the entire response, including all the link text and full command IDs.

@rzhao271 rzhao271 added verification-steps-needed Steps to verify are needed for verification and removed verified Verification succeeded labels May 29, 2024
@rzhao271
Copy link
Contributor

LGTM now. I might've forgotten to update something.

@meganrogge
Copy link
Contributor

A screenshot of the text that was announced would help to know if this was fixed or not @rzhao271

@rzhao271 rzhao271 added verified Verification succeeded and removed verification-steps-needed Steps to verify are needed for verification labels May 30, 2024
@rzhao271
Copy link
Contributor

nvm. The symbols are good but the URLs still expand

Screenshot showing URLs expanding in the speech visualizer in NVDA

@meganrogge meganrogge removed the verified Verification succeeded label May 30, 2024
@meganrogge meganrogge modified the milestones: May 2024, June 2024 May 30, 2024
@meganrogge meganrogge reopened this May 30, 2024
@VSCodeTriageBot VSCodeTriageBot removed the insiders-released Patch has been released in VS Code Insiders label May 30, 2024
@meganrogge
Copy link
Contributor

unclear how this could be happening as I'm using renderStringAsPlaintext

status(renderStringAsPlaintext(responseContent) + errorDetails);

@meganrogge meganrogge modified the milestones: June 2024, May 2024 May 30, 2024
@meganrogge
Copy link
Contributor

figured it out

meganrogge added a commit that referenced this issue May 30, 2024
@VSCodeTriageBot VSCodeTriageBot added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels May 30, 2024
@sandy081
Copy link
Member

@meganrogge It is still reading the complete path for me.

@rzhao271 rzhao271 added the verification-found Issue verification failed label May 31, 2024
@rzhao271 rzhao271 reopened this May 31, 2024
@VSCodeTriageBot VSCodeTriageBot removed the insiders-released Patch has been released in VS Code Insiders label May 31, 2024
@meganrogge meganrogge removed the verification-found Issue verification failed label Jun 3, 2024
@meganrogge meganrogge modified the milestones: May 2024, June 2024 Jun 3, 2024
@meganrogge
Copy link
Contributor

@rzhao271 and @sandy081 the complete path is expected. what's not expected is these chars 5B%7B%22%24m

@meganrogge meganrogge modified the milestones: June 2024, May 2024 Jun 3, 2024
@meganrogge meganrogge reopened this Jun 3, 2024
@meganrogge
Copy link
Contributor

going to see if I can repro on windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility Keyboard, mouse, ARIA, vision, screen readers (non-specific) issues bug Issue identified by VS Code Team member as probable bug chat under-discussion Issue is under discussion for relevance, priority, approach
Projects
None yet
6 participants