Skip to content

Commit e3e8fcd

Browse files
authored
feat(amazonq): Add description and github issue link to feedback form (aws#6475)
## Problem Users are not able to track their feedback/request through the feedback form. There should be a description for it and a link for Github issue links. ## Solution - Added description field to the feedback form which accepts markdown strings (through MynahUI [v4.22.0](https://github.com/aws/mynah-ui/releases/tag/v4.22.0)) <img width="532" alt="image" src="https://github.com/user-attachments/assets/0f3fce7c-9efa-423b-9801-89743cfea42e" /> --- _**Notes:** Feel free to change the link, or update the text. Also, if you want to add telemetry records for these link clicks, feel free to add that._ --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent ef9abfc commit e3e8fcd

File tree

7 files changed

+25
-6
lines changed

7 files changed

+25
-6
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "Feature",
3+
"description": "Added github issue link and description to the chat answer feedback form"
4+
}

packages/core/src/amazonq/webview/messages/messageDispatcher.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ export function dispatchWebViewMessagesToApps(
4848
AmazonQChatMessageDuration.stopChatMessageTelemetry(msg)
4949
return
5050
}
51-
case 'open-user-guide': {
52-
const { userGuideLink } = msg
53-
void openUrl(Uri.parse(userGuideLink))
51+
case 'open-link': {
52+
const { link } = msg
53+
void openUrl(Uri.parse(link))
5454
return
5555
}
5656
case 'send-telemetry': {

packages/core/src/amazonq/webview/ui/apps/amazonqCommonsConnector.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ export class Connector {
130130
this.sendMessageToExtension(createClickTelemetry(`amazonq-explore-${actionId}`))
131131

132132
this.sendMessageToExtension({
133-
command: 'open-user-guide',
134-
userGuideLink,
133+
command: 'open-link',
134+
link: userGuideLink,
135135
})
136136
}
137137

packages/core/src/amazonq/webview/ui/commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ type MessageCommand =
3939
| 'store-code-result-message-id'
4040
| 'start-test-gen'
4141
| 'review'
42-
| 'open-user-guide'
42+
| 'open-link'
4343
| 'send-telemetry'
4444
| 'update-welcome-count'
4545

packages/core/src/amazonq/webview/ui/connector.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,13 @@ export class Connector {
131131
}
132132
}
133133

134+
onLinkClick = (link: string): void => {
135+
this.sendMessageToExtension({
136+
command: 'open-link',
137+
link,
138+
})
139+
}
140+
134141
onResponseBodyLinkClick = (tabID: string, messageId: string, link: string): void => {
135142
switch (this.tabsStorage.getTab(tabID)?.type) {
136143
case 'cwc':

packages/core/src/amazonq/webview/ui/main.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,12 @@ export const createMynahUI = (
834834
mouseEvent?.stopImmediatePropagation()
835835
connector.onResponseBodyLinkClick(tabId, messageId, link)
836836
},
837+
onFormLinkClick: (link, mouseEvent) => {
838+
mouseEvent?.preventDefault()
839+
mouseEvent?.stopPropagation()
840+
mouseEvent?.stopImmediatePropagation()
841+
connector.onLinkClick(link)
842+
},
837843
onInfoLinkClick: (tabId: string, link: string, mouseEvent?: MouseEvent) => {
838844
mouseEvent?.preventDefault()
839845
mouseEvent?.stopPropagation()

packages/core/src/amazonq/webview/ui/texts/constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ export const uiComponentsTexts = {
88
copy: 'Copy',
99
insertAtCursorLabel: 'Insert at cursor',
1010
feedbackFormTitle: 'Report an issue',
11+
feedbackFormDescription:
12+
'_Feedback is anonymous. For issue updates, please contact us on [GitHub](https://github.com/aws/aws-toolkit-vscode/issues/new/choose)._',
1113
feedbackFormOptionsLabel: 'What type of issue would you like to report?',
1214
feedbackFormCommentLabel: 'Description of issue (optional):',
1315
feedbackThanks: 'Thanks for your feedback!',

0 commit comments

Comments
 (0)