accessibility-insights-windows icon indicating copy to clipboard operation
accessibility-insights-windows copied to clipboard

feat: Enable V2 color contrast algorithm (with guardrails)

Open DaveTryon opened this issue 2 years ago • 0 comments

Details

Axe.Windows enabled a V2 ColorContrastAnalyzer with https://github.com/microsoft/axe-windows/pull/668, but we haven't yet enabled it in AIWin out of concerns over performance of analyzing larger images. This PR does the following:

  • Adds a configurable option (file-only, no UI at this time) that specifies the threshold size for analyzer selection. The default value is 10000 pixels (the equivalent of a 100x100 image)
  • Adds code to select the analyzer based on the threshold. Images larger than the threshold size use the old (V1) analyzer
  • Adds telemetry to report the analyzer version, the image size, the confidence of the analysis, and the time spent analyzing
  • Updates the telemetry details documentation
Motivation

Hopefully improve automatic color detection and collect telemetry to help evaluate the results. See #996 for a discussion of this topic.

Context

Here is an excerpt from the local telemetry generated with this change in place:

--------------------------------------------------
Event was published at 2022-08-16T23:40:46.0813174Z
{
  "EventName": "ColorContrast_AutoDetect",
  "EventProperties": {
    "AnalyzerVersion": "V1",
    "BitmapSize": "34317",
    "Confidence": "Low",
    "DurationInTicks": "197436"
  },
  "ContextProperties": {
    "InstallationID": "a9817982-b217-4363-8d77-cc2536caf5da",
    "Version": "1.1.2053.1",
    "AppSessionID": "7d16c6da-2886-4eca-aca6-49739eeff1ce",
    "SessionType": "Desktop",
    "ReleaseChannel": "Canary",
    "ModeName": "Inspect",
    "ModeSessionId": "f51cfb82-374e-49fe-9d56-06b32b4ec692",
    "View": "Live"
  }
}
--------------------------------------------------
Event was published at 2022-08-16T23:40:49.2694825Z
{
  "EventName": "ColorContrast_AutoDetect",
  "EventProperties": {
    "AnalyzerVersion": "V2",
    "BitmapSize": "1827",
    "Confidence": "Mid",
    "DurationInTicks": "59455"
  },
  "ContextProperties": {
    "InstallationID": "a9817982-b217-4363-8d77-cc2536caf5da",
    "Version": "1.1.2053.1",
    "AppSessionID": "7d16c6da-2886-4eca-aca6-49739eeff1ce",
    "SessionType": "Desktop",
    "ReleaseChannel": "Canary",
    "ModeName": "Inspect",
    "ModeSessionId": "f51cfb82-374e-49fe-9d56-06b32b4ec692",
    "View": "Live"
  }
}

Pull request checklist

  • [ ] Run through of all test scenarios completed?
  • [x] Does this address an existing issue? If yes, Issue: Helps with #996
  • [n/a] Includes UI changes?
    • [ ] Run the production version of Accessibility Insights for Windows against a version with changes.
    • [ ] Attach any screenshots / GIF's that are applicable.

Note: After the PR has been created, certain checks will be kicked off. All of these checks must pass before a merge.

DaveTryon avatar Aug 17 '22 00:08 DaveTryon