Skip to content

Conversation

@SergeySmirnov-Akvelon
Copy link
Contributor

@SergeySmirnov-Akvelon SergeySmirnov-Akvelon commented May 19, 2021

Fixes #4914

Proposed changes

  • Updated SupportsUiaProviders flag.
  • Added and implemented TrackBarAccessibleObject, TrackBarFirstButtonAccessibleObject,
    TrackBarLastButtonAccessibleObject and TrackBarThumbAccessibleObject classes for working with the TrackBar and its elements.
  • Added calls to RaiseAutomationPropertyChangedEvent and RaiseAutomationEvent methods for the correct announcing of the Narrator

Customer Impact

Before fix:
image
ProviderDescription: "[pid:9884,providerId:0x280FE0 Main:Nested [pid:28360,providerId:0x280FE0 Main(parent link):Microsoft: MSAA Proxy (unmanaged:UIAutomationCore.dll)]; Nonclient:Microsoft: Non-Client Proxy (unmanaged:uiautomationcore.dll); Hwnd(parent link):Microsoft: HWND Proxy (unmanaged:uiautomationcore.dll)]"

After fix:
image
ProviderDescription: "[pid:25616,providerId:0x90BDA Main:Nested [pid:25228,providerId:0x90BDA Main(parent link):Unidentified Provider (unmanaged:coreclr.dll)]; Hwnd(parent link):Microsoft: HWND Proxy (unmanaged:uiautomationcore.dll)]"

Regression?

  • No

Risk

  • Minimcal

Test methodology

  • Unit tests
  • CTI team

Accessibility testing

  • Inspect
  • Narrator
  • Accessibility Insights

Test environment(s)

  • Microsoft Windows [Version 10.0.19041.388]
  • .NET Core SDK: 6.0.100-preview.3.21202.5
Microsoft Reviewers: Open in CodeFlow

@SergeySmirnov-Akvelon SergeySmirnov-Akvelon requested a review from a team as a code owner May 19, 2021 12:12
@SergeySmirnov-Akvelon SergeySmirnov-Akvelon force-pushed the Issue-4914_Add_UIA_support_TrackBar branch 2 times, most recently from fad0c3b to 0eeb489 Compare May 21, 2021 07:00
@SergeySmirnov-Akvelon SergeySmirnov-Akvelon marked this pull request as draft May 21, 2021 11:18
@SergeySmirnov-Akvelon SergeySmirnov-Akvelon force-pushed the Issue-4914_Add_UIA_support_TrackBar branch 4 times, most recently from 24c2518 to d605848 Compare May 26, 2021 09:37
@SergeySmirnov-Akvelon SergeySmirnov-Akvelon marked this pull request as ready for review May 26, 2021 09:37
@SergeySmirnov-Akvelon SergeySmirnov-Akvelon marked this pull request as draft May 26, 2021 16:08
@SergeySmirnov-Akvelon SergeySmirnov-Akvelon force-pushed the Issue-4914_Add_UIA_support_TrackBar branch from d605848 to 5561a94 Compare May 27, 2021 07:56
@SergeySmirnov-Akvelon SergeySmirnov-Akvelon marked this pull request as ready for review May 27, 2021 08:04
Copy link
Contributor

@vladimir-krestov vladimir-krestov left a comment

Choose a reason for hiding this comment

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

Nice! Good work!
Main points:

  • Check Handle using
  • Naming and indentation
  • Methods and properties ordering in files
  • Where are unit tests for TrackBar child base class?

@SergeySmirnov-Akvelon SergeySmirnov-Akvelon force-pushed the Issue-4914_Add_UIA_support_TrackBar branch 3 times, most recently from 0aede10 to 5c22848 Compare May 28, 2021 13:11
@dreddy-work dreddy-work added the waiting-review This item is waiting on review by one or more members of team label Jun 1, 2021
Copy link
Contributor

@RussKie RussKie left a comment

Choose a reason for hiding this comment

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

Concerned with the tests implementations. Tests should have cyclomatic complexity (CC) of 1, i.e. not if...else....
In some instances (like if (createControl) ...) we decided to break this rule, but some tests seem to be really pushing it and have CC > 2. Please consider how the tests can be changed to reduce CC.

@ghost ghost added the waiting-author-feedback The team requires more information from the author label Jun 7, 2021
@RussKie RussKie removed the waiting-review This item is waiting on review by one or more members of team label Jun 7, 2021
Copy link
Contributor

@vladimir-krestov vladimir-krestov left a comment

Choose a reason for hiding this comment

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

Looks better

@ghost ghost removed the waiting-author-feedback The team requires more information from the author label Jun 15, 2021
@SergeySmirnov-Akvelon SergeySmirnov-Akvelon force-pushed the Issue-4914_Add_UIA_support_TrackBar branch 2 times, most recently from 11cf2c1 to dff3736 Compare June 15, 2021 14:30
@RussKie RussKie added the waiting-author-feedback The team requires more information from the author label Jun 16, 2021
@SergeySmirnov-Akvelon SergeySmirnov-Akvelon force-pushed the Issue-4914_Add_UIA_support_TrackBar branch from dff3736 to 1e68e15 Compare June 17, 2021 13:35
@ghost ghost removed the waiting-author-feedback The team requires more information from the author label Jun 17, 2021
@SergeySmirnov-Akvelon SergeySmirnov-Akvelon force-pushed the Issue-4914_Add_UIA_support_TrackBar branch from e06da86 to 914be23 Compare June 23, 2021 06:51
RussKie
RussKie previously approved these changes Jun 23, 2021
@SergeySmirnov-Akvelon
Copy link
Contributor Author

CTI approved

@RussKie
Copy link
Contributor

RussKie commented Jun 29, 2021

MC

@RussKie RussKie added the waiting-author-feedback The team requires more information from the author label Jun 29, 2021
@SergeySmirnov-Akvelon SergeySmirnov-Akvelon force-pushed the Issue-4914_Add_UIA_support_TrackBar branch from 914be23 to f6dddeb Compare June 29, 2021 07:37
@ghost ghost removed the waiting-author-feedback The team requires more information from the author label Jun 29, 2021
@SergeySmirnov-Akvelon
Copy link
Contributor Author

@RussKie, thank you. Fixed MC

Copy link
Contributor

@Tanya-Solyanik Tanya-Solyanik left a comment

Choose a reason for hiding this comment

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

Looks good, my main question is if names match those in WPF or other framework.
If you open and close a form with a trackbar under inspect, is the trackbar still rooted?
Other comments are nits.

Copy link
Contributor

Choose a reason for hiding this comment

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

Would /// <inheritdoc/> work?

Copy link
Contributor Author

@SergeySmirnov-Akvelon SergeySmirnov-Akvelon Jun 30, 2021

Choose a reason for hiding this comment

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

Yes. It works. But I checked, even if we delete /// <summary> and /// <inheritdoc/>, then the description from the based "AccessibleObject" class is used.
Removed unneeded <summary> from this PR

Copy link
Contributor

Choose a reason for hiding this comment

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

But I checked, even if we delete ///

and /// , then the description from the based "AccessibleObject" class is used.

Interesting. Maybe inheritdocs is used by the tools that generate docs?

Copy link
Contributor

Choose a reason for hiding this comment

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

But I checked, even if we delete /// <summary> and /// <inheritdoc/>, then the description from the based "AccessibleObject" class is used.

Are you sure? If you don't have a /// comment then you don't get intellisense nor docs for the given member.

https://docs.microsoft.com/dotnet/csharp/programming-guide/xmldoc/inheritdoc

@RussKie RussKie added the waiting-author-feedback The team requires more information from the author label Jun 30, 2021
@ghost ghost removed the waiting-author-feedback The team requires more information from the author label Jun 30, 2021
@SergeySmirnov-Akvelon SergeySmirnov-Akvelon force-pushed the Issue-4914_Add_UIA_support_TrackBar branch from f6dddeb to 144d622 Compare June 30, 2021 08:01
@SergeySmirnov-Akvelon
Copy link
Contributor Author

SergeySmirnov-Akvelon commented Jun 30, 2021

If you open and close a form with a trackbar under inspect, is the trackbar still rooted?

Hi, @Tanya-Solyanik. I have checked this case for Inspect and Narrator. TrackBar accessibility objects are removed from memory even if these accessibility tools are active

@SergeySmirnov-Akvelon SergeySmirnov-Akvelon added the waiting-review This item is waiting on review by one or more members of team label Jun 30, 2021
Comment on lines 14 to 18
Copy link
Contributor

Choose a reason for hiding this comment

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

Why can't we use this?

Suggested change
public static IEnumerable<object[]> TrackBarAccessibleObject_FirstButtonIsDisplayed_TestData()
=> TrackBarTestHelper.TrackBarAccessibleObject_FirstButtonIsDisplayed_TestData();
[WinFormsTheory]
[MemberData(nameof(TrackBarAccessibleObject_FirstButtonIsDisplayed_TestData))]
[WinFormsTheory]
[CommonMemberData(typeof(TrackBarTestHelper), nameof(TrackBarTestHelper.TrackBarAccessibleObject_FirstButtonIsDisplayed_TestData))]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you so much!!! Your approach makes it much easier to use the "TrackBarTestHelper" class.

@RussKie RussKie added waiting-author-feedback The team requires more information from the author and removed waiting-review This item is waiting on review by one or more members of team labels Jul 1, 2021
@ghost ghost removed the waiting-author-feedback The team requires more information from the author label Jul 1, 2021
@SergeySmirnov-Akvelon SergeySmirnov-Akvelon force-pushed the Issue-4914_Add_UIA_support_TrackBar branch 2 times, most recently from 20b698d to fd63914 Compare July 5, 2021 09:43
Updated "SupportsUiaProviders" flag.

Added and implemented "TrackBarAccessibleObject", "TrackBarFirstButtonAccessibleObject",
"TrackBarLastButtonAccessibleObject" and "TrackBarThumbAccessibleObject" classes for working with the TrackBar and its elements.

Added calls to "RaiseAutomationPropertyChangedEvent" and "RaiseAutomationEvent" methods for the correct announcing of the Narrator

Added unit tests
@SergeySmirnov-Akvelon SergeySmirnov-Akvelon force-pushed the Issue-4914_Add_UIA_support_TrackBar branch from fd63914 to e840b5d Compare July 5, 2021 14:27
Copy link
Contributor

@Tanya-Solyanik Tanya-Solyanik left a comment

Choose a reason for hiding this comment

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

Please see a comment about opening a bug to test if accessible object is created across the whole codebase.

@RussKie RussKie merged commit 575687a into dotnet:main Jul 9, 2021
@RussKie RussKie deleted the Issue-4914_Add_UIA_support_TrackBar branch July 9, 2021 03:46
@ghost ghost added this to the 6.0 Preview7 milestone Jul 9, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TrackBar control does not support UIA accessibility

5 participants