accessibility-insights-web
accessibility-insights-web copied to clipboard
failure instance details: refactor the PathSnippet store to better distinguish between snippet-capturing outcomes
The state management in our failure instance detail panel requires some refactoring. For example, we use the string "No code snippet..." in our store / panel to indicate we should show an error message:
https://github.com/microsoft/accessibility-insights-web/blob/359c0d9f21d5abe7532e5c7db5d16bc2b2cebd56/src/DetailsView/components/failure-instance-panel-details.tsx#L23
https://github.com/microsoft/accessibility-insights-web/blob/eb49e849903a3cb9bc5de41d8cc3386f3cf6c60e/src/injected/path-snippet-controller.ts#L51
An initial PR to fix this (unreviewed) was submitted here: https://github.com/microsoft/accessibility-insights-web/pull/1079:
Previously, we had been storing a hardcoded string ("No code snippet found for path: _______") in the snippet field of the PathSnippet store data. We then checked if we had this string to see if we should display an error message. This PR aims to refactor the PathSnippet store and its data to hold enough relevant information to discern which of three messages we should show: a) "Code snippet will auto-populate based on the CSS selector input" b) The code snippet for an HTML element c) "No code snippet is mapped to: ____"
This issue requires picking up the old PR, making any changes, and resubmitting for review.
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!
Reviewed with Peter, code is still there
We have other things to work on and will skip this