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

use document role for chat responses on windows/linux #236636

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

meganrogge
Copy link
Contributor

@meganrogge meganrogge commented Dec 19, 2024

fix #228599

For mac, using document vs listitem would limit navigation flexibility, so we will stick with listitem.

Using document for windows/linux offers several advantages:

  • indicates to screen readers that the element is a primary content area, enabling document-based navigation (e.g., by headings, landmarks)
  • typically enhances the reading experience, especially for text-heavy content
  • reduces noise of "listitem" being announced

Some downsides:

  • removing listitem might reduce understanding of its context in the conversation hierarchy.
  • role=document may require users to switch out of reading mode to interact with buttons or links, adding friction.
  • for cross-platform users, the differing roles might be confusing due to inconsistent behavior

cc @jooyoungseo and @rperez030

@meganrogge meganrogge self-assigned this Dec 19, 2024
@meganrogge meganrogge added this to the January 2025 milestone Dec 19, 2024
@meganrogge
Copy link
Contributor Author

also cc @Tyriar in case you have any thoughts here

@@ -24,7 +25,7 @@ export class ChatAccessibilityProvider implements IListAccessibilityProvider<Cha
}

getRole(element: ChatTreeItem): AriaRole | undefined {
return 'listitem';
return isMacintosh ? 'listitem' : 'document';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For mac, using document vs listitem would limit navigation flexibility

What do you mean by that? voiceover handles it differently?

I'll yield to your judgement for this, but I thought that we generally don't use 'document' because of the downsides you mention. Do we use it in other places in VS Code?

Could you add a comment about this in the code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using document role is too restrictive with voiceover. It would make navigation within the element challenging.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I plan to talk through this with JooYoung tomorrow

@jooyoungseo
Copy link

@meganrogge I think we need to test this PR with NVDA and JAWS to see if they behave as expected. I was wondering if users would still be able to navigate between next and previous responses in the Chat thread. Users may want to use Up/DownArrows to navigate through response items and hit Enter to trigger the "document" view. ESC to go back to the list view. This concept aligns with Outlook's mail preview list (Up/DownArrows) -> displaying full content (with Enter) -> going back to the preview list (via ESC).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider how we might improve navigation to chat response content for screen reader users
3 participants