-
Notifications
You must be signed in to change notification settings - Fork 11
fix: align form accessibility suggestion creation with sites #1201
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
base: main
Are you sure you want to change the base?
Conversation
This PR will trigger a minor release when merged. |
- Introduced a new handler to update accessibility suggestions based on code changes from S3. - Added functionality to read code change reports and update suggestions accordingly. - Included comprehensive tests to ensure correct behavior of the new handler.
// Update suggestion data with diff content and availability flag | ||
const updatedData = { | ||
...suggestionData, | ||
diffContent: reportData.diff, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is suggestion stored ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Diff content is stored in suggestion object.
Currently, there is duplication as if there are 5 HTML elements with issue for color-contrast
then it store diff content on each suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My point was since it is being saved in Dynamo we can have a problem with the size of the diff. Let's keep a watch on the same going forward
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, for large diff content, there can be issue. For now followed the simplest approach, but yes i'll have watch
…into form-a11y-createsuggestion
a11yData | ||
.filter((formData) => formData.a11yIssues?.length > 0) | ||
.forEach((formData) => { | ||
const { form: pageUrl, formSource: source, a11yIssues } = formData; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets' update mystique to start returning source. @amit-mnnit
src/index.js
Outdated
'guidance:forms-a11y': formAccessibilityGuidance, | ||
'detect:forms-a11y': mystiqueDetectedFormAccessibilityOpportunity, | ||
'guidance:accessibility-remediation': accessibilityRemediationGuidance, | ||
'accessibility-code-change': accessibilityCodeChangeHandler, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
codefix:accessibility
const urlObject = { | ||
type: 'url', | ||
url: pageUrl, | ||
...(source && { source }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will there be a case where the source is empty ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Atleast for now No. if formSource not provided to M by default it will return issues of first form element without source.
Key Changes