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

feat(logical-size): Implement the LogicalSize property in Axe.Windows #1020

Merged
merged 2 commits into from
May 18, 2024

Conversation

codeofdusk
Copy link
Contributor

@codeofdusk codeofdusk commented Apr 13, 2024

Details

This PR adds a "pseudo-property", LogicalSize, a normalized size based on an element's BoundingRectangle to aid in touch size calculations.

Motivation

Part of Feature 2152841 (internal access required to view).

Pull request checklist

  • [n/a] Addresses an existing issue: #0000

@codecov-commenter
Copy link

codecov-commenter commented Apr 13, 2024

Codecov Report

Attention: Patch coverage is 62.71186% with 22 lines in your changes are missing coverage. Please review.

Project coverage is 72.13%. Comparing base (4fc19c3) to head (af0df06).
Report is 384 commits behind head on main.

Current head af0df06 differs from pull request most recent head fa8be9f

Please upload reports for the commit fa8be9f to get more accurate results.

Files Patch % Lines
src/Win32/Win32Helper.cs 50.00% 10 Missing and 2 partials ⚠️
src/Core/Misc/ExtensionMethods.cs 0.00% 4 Missing ⚠️
src/Core/Bases/A11yElement.cs 0.00% 3 Missing ⚠️
...top/UIAutomation/DesktopElementExtensionMethods.cs 85.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1020      +/-   ##
==========================================
- Coverage   73.70%   72.13%   -1.57%     
==========================================
  Files         398      424      +26     
  Lines       12046    13216    +1170     
  Branches        0     1420    +1420     
==========================================
+ Hits         8878     9534     +656     
- Misses       3168     3265      +97     
- Partials        0      417     +417     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@codeofdusk codeofdusk marked this pull request as ready for review May 15, 2024 22:45
@codeofdusk codeofdusk requested a review from a team as a code owner May 15, 2024 22:46
@codeofdusk codeofdusk force-pushed the logical-size branch 3 times, most recently from 22b5ee0 to c7ce931 Compare May 15, 2024 23:07
Co-authored-by: Dave Tryon <45672944+DaveTryon@users.noreply.github.com>
Copy link

@brocktaylor7 brocktaylor7 left a comment

Choose a reason for hiding this comment

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

LGTM, but it might make sense to add some tests for this new logic. One obvious example would be the ToStringTest for the A11yProperty.

@codeofdusk
Copy link
Contributor Author

I've added a unit test for the ToString logic. At some point, it might be worth:

  • Adding a unit test for the AddLogicalSizePseudoProperty method in DesktopElementExtensionMethods, but that's a private method and test coverage in that file is virtually nonexistent.
  • A system test of some kind to verify the new logic in a running app, but that's complicated buy different DPI scaling settings on different machines.

@codeofdusk codeofdusk merged commit d2a5c65 into microsoft:main May 18, 2024
6 checks passed
codeofdusk added a commit that referenced this pull request May 20, 2024
…1024)

Axe.Windows follows semantic versioning, which states:

> Given a version number MAJOR.MINOR.PATCH, increment the... MINOR version when you add functionality in a backward compatible manner

I think 6d72b85 and d2a5c65 qualify as "new functionality" for these purposes, justifying a minor version bump.

Also includes a small fix-up of #1020 to prevent execution of `a11yProperty.ToSize` on properties other than `LogicalSize`.
private PropertyType() : base()
{
// Explicitly add pseudo-properties
Dic[Axe_LogicalSizePseudoPropertyId] = GetNameInProperFormat("Axe_LogicalSizePseudoPropertyId", Axe_LogicalSizePseudoPropertyId);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should PropertyTypesTests.cs be updated to check that the pseudo-property exists and that the contents make sense? Abstracting out the screen DPI could get interesting...

codeofdusk added a commit that referenced this pull request May 21, 2024
This commit addresses review actions that were marked pending but not sent in time for #1020.

Part of Feature 2152841 (internal access required to view).
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.

4 participants