-
Notifications
You must be signed in to change notification settings - Fork 152
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
Can't toggle off from the ad-hoc panel if you've toggled on in DetailsView #6253
Comments
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! |
this is an edge case. Let's timebox to 4 hours and close otherwise |
I did some preliminary investigation on this and it looks like the root cause is:
There seem to be a few possible fixes, I'm interested in other people's thoughts:
|
Seeing something similar with the following repro steps:
|
… in DetailsView (#7431) #### Details Two ad-hoc tools (Automated Checks and Needs Review) have the ability to view issues in DetailsView. Unfortunately, if you try to toggle either of them off in ad-hoc tools while their corresponding DetailsView list of issues is open, the DetailsView toggle will overwrite the "off" state and force it to be "on". Additionally, toggling off in DetailsView does not turn the toggle off in ad-hoc tools. This PR keeps these toggles in sync by: * moving the code that determines if a scan needs to be run based on state to `componentDidMount` instead of on render. * triggering `VisualizationActions.enableVisualization`/`VisualizationActions.disabledVisualization` when `CardSelectionActions.toggleVisualHelper` is triggered, which involves: * making sure `VisualizationActions` are accessible from `CardSelectionActionCreator`s * sending a `VisualizationTogglePayload` instead of `BasePayload` with the enabled state (passed in from the `VisualHelperToggle`'s `onClick`) * triggering `CardSelectionActions.toggleVisualHelper` when `VisualizationActions.enableVisualization`/`VisualizationActions.disabledVisualization` are triggered, which involves: * checking the value of `payload.test` and triggering `needsReviewSelectionActions.toggleVisualHelper` or `cardSelectionActions.toggleVisualHelper` if the `VisualizationType` matches. ##### Motivation Addresses issue #6253 ##### Context <!-- Are there any parts that you've intentionally left out-of-scope for a later PR to handle? --> <!-- Were there any alternative approaches you considered? What tradeoffs did you consider? --> #### Pull request checklist <!-- If a checklist item is not applicable to this change, write "n/a" in the checkbox --> - [x] Addresses an existing issue: #6253 - [x] Added/updated relevant unit test(s) (and ran `yarn test`) - [x] Verified code coverage for the changes made. Check coverage report at: `<rootDir>/test-results/unit/coverage` - [x] PR title *AND* final merge commit title both start with a semantic tag (`fix:`, `chore:`, `feat(feature-name):`, `refactor:`). See `CONTRIBUTING.md`. --------- Co-authored-by: Madalyn Parker <[email protected]>
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:
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)
Are you willing to submit a PR?
Did you search for similar existing issues?
Yes
Additional context
The text was updated successfully, but these errors were encountered: