From 3007984c602a12de75e413caf85c2c8b99f2a866 Mon Sep 17 00:00:00 2001 From: amitjoshi438 <54068463+amitjoshi438@users.noreply.github.com> Date: Thu, 19 Dec 2024 12:42:37 +0530 Subject: [PATCH 1/2] Enhance feedback interaction by adding keyboard accessibility for thumbs up/down buttons (#1082) Co-authored-by: amitjoshi --- src/common/copilot/assets/scripts/copilot.js | 43 +++++++++++++------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/src/common/copilot/assets/scripts/copilot.js b/src/common/copilot/assets/scripts/copilot.js index 813e39c7..328119ef 100644 --- a/src/common/copilot/assets/scripts/copilot.js +++ b/src/common/copilot/assets/scripts/copilot.js @@ -220,20 +220,20 @@ return feedback; } feedback.innerHTML = `

${copilotStrings.AI_CONTENT_MISTAKES_MESSAGE}

-
- - ${copilotStrings.THUMBS_UP_MESSAGE} - - - - - - ${copilotStrings.THUMBS_DOWN_MESSAGE} - - - -
-`; +
+ + ${copilotStrings.THUMBS_UP_MESSAGE} + + + + + + ${copilotStrings.THUMBS_DOWN_MESSAGE} + + + +
+ `; feedback.classList.add("feedback-div"); @@ -593,6 +593,7 @@ }); chatMessages.addEventListener("click", handleFeedbackClick); + chatMessages.addEventListener("keydown", handleFeedbackKeydown); function handleFeedbackClick(event) { const target = event.target; @@ -606,6 +607,20 @@ } } + function handleFeedbackKeydown(event) { + const target = event.target; + + if ((event.key === "Enter" || event.key === " ") && target.classList.contains("thumbsup")) { + event.preventDefault(); + handleThumbsUpClick(target); + } + + if ((event.key === "Enter" || event.key === " ") && target.classList.contains("thumbsdown")) { + event.preventDefault(); + handleThumbsDownClick(target); + } + } + function handleThumbsUpClick(element) { if (element.classList.contains("thumbsup-clicked")) { From 3c2bdf2e5de279840d92a98f6c7edfdcd30598c0 Mon Sep 17 00:00:00 2001 From: amitjoshi438 <54068463+amitjoshi438@users.noreply.github.com> Date: Fri, 20 Dec 2024 11:31:42 +0530 Subject: [PATCH 2/2] Add conditional visibility for Current Active Users command in web virtual workspace and remove alt cmds (#1083) Co-authored-by: amitjoshi --- package.json | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 85b0b689..d975488a 100644 --- a/package.json +++ b/package.json @@ -368,7 +368,8 @@ { "command": "powerPlatform.previewCurrentActiveUsers", "title": "Current Active Users", - "icon": "$(person)" + "icon": "$(person)", + "when": "isWeb && virtualWorkspace" }, { "command": "microsoft.powerplatform.pages.preview-site", @@ -661,12 +662,10 @@ { "when": "resourceLangId == html && !virtualWorkspace", "command": "microsoft-powerapps-portals.preview-show", - "alt": "microsoft-powerapps-portals.preview-show", "group": "navigation" }, { "command": "powerPlatform.previewCurrentActiveUsers", - "alt": "current active users", "group": "navigation", "when": "isWeb && virtualWorkspace" } @@ -819,6 +818,10 @@ { "command": "microsoft.powerplatform.pages.preview-site", "when": "microsoft.powerplatform.pages.siteRuntimePreviewEnabled" + }, + { + "command": "powerPlatform.previewCurrentActiveUsers", + "when": "isWeb && virtualWorkspace" } ], "view/title": [