Skip to content

Commit e63cd28

Browse files
authored
feat(ai-scan-support): Feedback mechanism and Copy Failure Details button (only for HTML reports) (#7576)
This PR follows: #7570 #### Details <!-- Usually a sentence or two describing what the PR changes --> - Feedback mechanism is enabled when `feedbackURL` is provided AND the issue's guidance matches `AI_SCAN` - Copy failure details button is implemented for HTML reports https://github.com/user-attachments/assets/c2f74853-67d8-4869-ac25-20887a1616a8 ##### Motivation <!-- This can be as simple as "addresses issue #123" --> ##### 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 --> - [ ] Addresses an existing issue: #0000 - [ ] Ran `yarn fastpass` - [ ] Added/updated relevant unit test(s) (and ran `yarn test`) - [ ] Verified code coverage for the changes made. Check coverage report at: `<rootDir>/test-results/unit/coverage` - [ ] PR title *AND* final merge commit title both start with a semantic tag (`fix:`, `chore:`, `feat(feature-name):`, `refactor:`). See `CONTRIBUTING.md`. - [ ] (UI changes only) Added screenshots/GIFs to description above - [ ] (UI changes only) Verified usability with NVDA/JAWS
1 parent 23212c9 commit e63cd28

File tree

65 files changed

+39452
-29
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+39452
-29
lines changed

packages/report-e2e-tests/src/examples/axe-results-with-ai-issues-and-feedback-url.input.ts

Lines changed: 6188 additions & 0 deletions
Large diffs are not rendered by default.

packages/report-e2e-tests/src/examples/axe-results-with-ai-issues-and-feedback-url.snap.html

Lines changed: 2073 additions & 0 deletions
Large diffs are not rendered by default.

packages/report-e2e-tests/src/examples/axe-results-with-ai-issues.input.ts

Lines changed: 6179 additions & 0 deletions
Large diffs are not rendered by default.

packages/report-e2e-tests/src/examples/axe-results-with-ai-issues.snap.html

Lines changed: 2073 additions & 0 deletions
Large diffs are not rendered by default.

packages/report-e2e-tests/src/examples/axe-results-with-feedback-url.input.ts

Lines changed: 6180 additions & 0 deletions
Large diffs are not rendered by default.

packages/report-e2e-tests/src/examples/axe-results-with-feedback-url.snap.html

Lines changed: 2073 additions & 0 deletions
Large diffs are not rendered by default.

packages/report-e2e-tests/src/examples/axe-results-with-issues.snap.html

Lines changed: 540 additions & 1 deletion
Large diffs are not rendered by default.

packages/report-e2e-tests/src/examples/axe-results-with-undefined-feedback-url.input.ts

Lines changed: 6180 additions & 0 deletions
Large diffs are not rendered by default.

packages/report-e2e-tests/src/examples/axe-results-with-undefined-feedback-url.snap.html

Lines changed: 2073 additions & 0 deletions
Large diffs are not rendered by default.

packages/report-e2e-tests/src/examples/axe-results-without-issues.snap.html

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,127 @@
924924
display: flex;
925925
}
926926

927+
/* css-modules:src/common/components/cards/failed-instances-markup-footer */
928+
.markup-footer--HEVHv {
929+
display: flex;
930+
justify-content: space-between;
931+
align-items: center;
932+
background-color: var(--neutral-2, #f8f8f8);
933+
min-height: 48px;
934+
padding-top: 0;
935+
padding-right: 20px;
936+
padding-bottom: 0;
937+
padding-left: 20px;
938+
border-top: 0.5px solid var(--card-footer-border, #dedede);
939+
border-bottom-left-radius: inherit;
940+
border-bottom-right-radius: inherit;
941+
margin-top: 0;
942+
}
943+
.feedback-text--yBb6Z {
944+
font-size: 14px;
945+
color: var(--secondary-text, rgba(0, 0, 0, 0.7));
946+
margin-right: 12px;
947+
}
948+
.feedback-buttons--rDHVY {
949+
display: flex;
950+
gap: 8px;
951+
}
952+
.buttons-group-left--JSoCT {
953+
display: flex;
954+
align-items: center;
955+
gap: 8px;
956+
}
957+
.buttons-group-right--SKsSu {
958+
display: flex;
959+
align-items: center;
960+
gap: 8px;
961+
font-size: 12px;
962+
position: relative;
963+
margin-left: auto;
964+
}
965+
.feedback-button--Vn-lA {
966+
background: none;
967+
border: none;
968+
cursor: pointer;
969+
padding: 6px;
970+
border-radius: 4px;
971+
display: flex;
972+
align-items: center;
973+
justify-content: center;
974+
color: var(--neutral-60, #666);
975+
text-decoration: none;
976+
font-size: 14px;
977+
gap: 6px;
978+
}
979+
.feedback-button--Vn-lA:hover {
980+
background-color: var(--neutral-alpha-4, rgba(0, 0, 0, 0.04));
981+
}
982+
.feedback-button--Vn-lA span {
983+
margin-left: 6px;
984+
font-size: 14px;
985+
}
986+
.ai-content-label--1cidK {
987+
background-color: var(--neutral-10, #e6e6e6);
988+
color: var(--neutral-60, #666);
989+
font-size: 12px;
990+
padding-top: 4px;
991+
padding-right: 10px;
992+
padding-bottom: 4px;
993+
padding-left: 10px;
994+
border-radius: 12px;
995+
display: flex;
996+
align-items: center;
997+
white-space: nowrap;
998+
}
999+
.notification-container--axJpL {
1000+
position: relative;
1001+
height: 0;
1002+
width: 0;
1003+
}
1004+
.copy-notification--MlMTG {
1005+
position: absolute;
1006+
top: 10px;
1007+
right: 0;
1008+
background-color: var(--neutral-80, #333);
1009+
color: white;
1010+
padding-top: 6px;
1011+
padding-right: 12px;
1012+
padding-bottom: 6px;
1013+
padding-left: 12px;
1014+
border-radius: 4px;
1015+
font-size: 12px;
1016+
font-weight: 500;
1017+
animation: fade-in-out--AuVTM 2s ease-in-out;
1018+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
1019+
white-space: nowrap;
1020+
z-index: 100;
1021+
display: none;
1022+
}
1023+
.copy-notification--MlMTG.visible--GCwEf {
1024+
display: inline-block;
1025+
}
1026+
.hidden-content--9JuU6 {
1027+
display: none;
1028+
}
1029+
@keyframes fade-in-out--AuVTM {
1030+
0% {
1031+
opacity: 0;
1032+
transform: translateY(10px);
1033+
}
1034+
20% {
1035+
opacity: 1;
1036+
transform: translateY(0);
1037+
}
1038+
80% {
1039+
opacity: 1;
1040+
transform: translateY(0);
1041+
}
1042+
100% {
1043+
opacity: 0;
1044+
transform: translateY(-10px);
1045+
}
1046+
}
1047+
9271048
/* css-modules:src/common/components/toast */
9281049
.toast-container--L-5HM {
9291050
display: inline-block;
@@ -1531,4 +1652,33 @@
15311652
}
15321653
});
15331654
}
1655+
})(document)</script><script>(function(doc) {
1656+
const copyToClipboard = async function(instanceId) {
1657+
const contentId = `copy-content-${instanceId}`;
1658+
const contentElement = doc.getElementById(contentId);
1659+
const textToCopy = contentElement ? contentElement.textContent || "" : instanceId;
1660+
try {
1661+
await navigator.clipboard.writeText(textToCopy);
1662+
} catch (err) {
1663+
console.error("Failed to copy text: ", err);
1664+
return;
1665+
}
1666+
const notificationId = `copy-notification-${instanceId}`;
1667+
const notificationElement = doc.getElementById(notificationId);
1668+
if (notificationElement) {
1669+
notificationElement.style.display = "inline";
1670+
setTimeout(function() {
1671+
notificationElement.style.display = "none";
1672+
}, 2e3);
1673+
}
1674+
};
1675+
const copyButtons = doc.querySelectorAll('button[id^="copy-button-"]');
1676+
for(let i = 0; i < copyButtons.length; i++){
1677+
const button = copyButtons[i];
1678+
const buttonId = button.id;
1679+
const instanceId = buttonId.replace("copy-button-", "");
1680+
button.addEventListener("click", function() {
1681+
void copyToClipboard(instanceId);
1682+
});
1683+
}
15341684
})(document)</script></div></main><div class="report-footer-container"><div class="report-footer" role="contentinfo">This automated checks result was generated using the Service Name for Axe Results Without Issues that helps find some of the most common accessibility issues. The scan was performed in a clean browser environment, using axe-core 3.3.2 and Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/78.0.3904.108 Safari/537.36 with a display resolution of 800x600. For a complete WCAG 2.1 compliance assessment please visit <a target="_blank" href="http://aka.ms/AccessibilityInsights" class="ms-Link insights-link tool-name-link root-109" title="Get more information and download Accessibility Insights for Web">http://aka.ms/AccessibilityInsights</a>.</div></div></body></html>

0 commit comments

Comments
 (0)