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

Can't toggle off from the ad-hoc panel if you've toggled on in DetailsView

Open JGibson2019 opened this issue 2 years ago • 4 comments

Describe the bug

When visualizations are still considered "on" in the DetailsView panel, you cannot toggle them off from the Ad-hoc panel.

To Reproduce Steps to reproduce the behavior:

  1. Go to any site (used a local file URL for this one)
  2. Click on the Accessibility Insights extension and select "Ad hoc tools" from the pop up
  3. Toggle on "Needs review"
  4. Click "List view and filtering"
  5. Try to Toggle off "Needs review". See it is stuck in the On state

CodePen repro example

Expected behavior

Clicking the toggle should turn the visualization off and update the DetailsView to show the visual helper is off.

Screenshots

Context (please complete the following information)

  • OS Name & Version: Windows 11 Enterprise Version 10.0.22621 Build 22621
  • AI-Web Version & Environment: Production 2.35.0
  • Browser Version: Google Chrome Version 108.0.5359.95
  • Target Page: /accessibility-insights-web/src/tests/end-to-end/test-resources/all.html (from the Web repo)

Are you willing to submit a PR?

Did you search for similar existing issues?

Yes

Additional context

JGibson2019 avatar Dec 07 '22 18:12 JGibson2019

This issue has been marked as ready for team triage; we will triage it in our weekly review and update the issue. Thank you for contributing to Accessibility Insights!

ghost avatar Dec 07 '22 21:12 ghost

this is an edge case. Let's timebox to 4 hours and close otherwise

ferBonnin avatar Dec 13 '22 00:12 ferBonnin

I did some preliminary investigation on this and it looks like the root cause is:

  • When the user disables the toggle in ad hoc tests, the test gets disabled as expected
  • When the details view re-renders with these changes, it triggers this check: https://github.com/microsoft/accessibility-insights-web/blob/main/src/DetailsView/components/issues-table.tsx#L108, which causes us to send a enableFastPassVisualHelperWithoutScan message, which results in us re-enabling the test
  • Since the test has been reenabled, the ad hoc view toggle re-toggles to reflect this change.
  • In some cases this can happen so quickly that it appears that the toggle never turned off at all.

There seem to be a few possible fixes, I'm interested in other people's thoughts:

  • In order to get the behavior described in the original issue (Clicking the toggle should turn the visualization off and update the DetailsView to show the visual helper is off.), I think we would have to change how we store ad hoc test data significantly, which seems like more trouble than it's really worth.
  • When we disable the test in ad hoc panel, also show the "no content available" page in any associated details views
  • When we disable the test in ad hoc panel, close any associated details views

sfoslund avatar Jan 04 '23 23:01 sfoslund

Seeing something similar with the following repro steps:

  1. Turn on Automated checks from Ad hoc tools
  2. Go to Settings and toggle "Enable high contrast" (either off or on)
  3. Try to turn off Automated checks from Ad hoc tools
  4. The Automated checks toggle does toggle off but it immediately toggles back on

lisli1 avatar Feb 03 '23 20:02 lisli1