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

Manually set the automation name of the default color scheme for screen reader #14704

Merged
1 commit merged into from
Jan 19, 2023

Conversation

PankajBhojwani
Copy link
Contributor

@PankajBhojwani PankajBhojwani commented Jan 19, 2023

Summary of the Pull Request

When we navigate to the color schemes page, find the default color scheme (if present) and manually set the container's automation name to include the word 'default'.

Note that we don't want to change the actual ColorSchemeViewModel's name since that name is used internally to identify schemes. We only want to change the ListViewItem's name, i.e. the container in the SUI.

PR Checklist

Validation Steps Performed

Screen reader reads out the 'default' text now. It also correctly reads out the new default scheme if the default scheme is changed via SUI or json.

@ghost ghost added Area-Accessibility Issues related to accessibility Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal. labels Jan 19, 2023
@carlos-zamora
Copy link
Member

@msftbot merge this in 10 minutes

@ghost ghost added the AutoMerge Marked for automatic merge by the bot when requirements are met label Jan 19, 2023
@ghost
Copy link

ghost commented Jan 19, 2023

Hello @carlos-zamora!

Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:

  • I won't merge this pull request until after the UTC date Thu, 19 Jan 2023 19:38:47 GMT, which is in 10 minutes

If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you".

@ghost ghost merged commit 47f38e3 into main Jan 19, 2023
@ghost ghost deleted the dev/pabhoj/default_tag branch January 19, 2023 19:39
Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

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

I'm sorry, won't this only work for the default that is set when the page is first navigated to? Will it happen again when you navigate back to the page after changing the default?

Even if it does, it never fixes the name of the non-default color schemes when you navigate back to it... so two or more schemes will be named "xxx default" when you change them.

Is it even a guarantee that the list item container is the same in a virtualized list?

I don't think this should have merged...

@DHowett
Copy link
Member

DHowett commented Jan 19, 2023

Unless we're reconstructing the entire scheme list every time we navigate to, or back to, that page. I don't believe we are doing so...?

@DHowett
Copy link
Member

DHowett commented Jan 19, 2023

Also, in general, we should try to avoid doing things in "layout updated" handlers. That's a pattern that we used for a very specific reason back in TermControl when it didn't have another event to notify when its size was finalized. This should, at least, have a BODGY or WORKAROUND comment.

@PankajBhojwani
Copy link
Contributor Author

PankajBhojwani commented Jan 19, 2023

Unless we're reconstructing the entire scheme list every time we navigate to, or back to, that page. I don't believe we are doing so...?

That does seem to be what's happening! At first I thought we would need to 'un-name' the old default scheme's container when a new scheme gets selected as default, but it turns out that when we navigate back to the ColorSchemes page (or the UI refreshes itself because of a change in the json) the old containers don't exist. So we just need to set the new container's name.

Also, in general, we should try to avoid doing things in "layout updated" handlers.

Is there a different handler we should use? Because inside OnNavigatedTo the ListView reads as empty (which makes sense since that is exactly where we set the underlying ViewModel, so the View hasn't been populated yet).

@DHowett
Copy link
Member

DHowett commented Jan 20, 2023

I don't think this should have merged...

I was too hasty in saying this, and it was not very nice. I'm sorry about that 😻

DHowett added a commit that referenced this pull request Jan 24, 2023
DHowett added a commit that referenced this pull request Jan 24, 2023
@ghost
Copy link

ghost commented Jan 24, 2023

🎉Windows Terminal Preview v1.17.1023 has been released which incorporates this pull request.:tada:

Handy links:

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Accessibility Issues related to accessibility AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal.
Projects
None yet
4 participants