diff --git a/.changes/next-release/feature-b74cbfcd-8982-4019-a224-041f62236100.json b/.changes/next-release/feature-b74cbfcd-8982-4019-a224-041f62236100.json new file mode 100644 index 00000000000..98edcc67fc5 --- /dev/null +++ b/.changes/next-release/feature-b74cbfcd-8982-4019-a224-041f62236100.json @@ -0,0 +1,4 @@ +{ + "type" : "feature", + "description" : "feat(amazonq): Added github issue link and description to the chat answer feedback form" +} \ No newline at end of file diff --git a/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/webview/BrowserConnector.kt b/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/webview/BrowserConnector.kt index af9c4b5fce1..e0bfdce708c 100644 --- a/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/webview/BrowserConnector.kt +++ b/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/webview/BrowserConnector.kt @@ -54,8 +54,8 @@ class BrowserConnector( } // some weird issue preventing deserialization from working - "open-user-guide" -> { - BrowserUtil.browse(node.get("userGuideLink").asText()) + "open-link" -> { + BrowserUtil.browse(node.get("link").asText()) } "send-telemetry" -> { val source = node.get("source") diff --git a/plugins/amazonq/mynah-ui/src/mynah-ui/ui/apps/amazonqCommonsConnector.ts b/plugins/amazonq/mynah-ui/src/mynah-ui/ui/apps/amazonqCommonsConnector.ts index 9fb0d54c9a6..37c39253f56 100644 --- a/plugins/amazonq/mynah-ui/src/mynah-ui/ui/apps/amazonqCommonsConnector.ts +++ b/plugins/amazonq/mynah-ui/src/mynah-ui/ui/apps/amazonqCommonsConnector.ts @@ -107,8 +107,8 @@ export class Connector { this.sendMessageToExtension(createClickTelemetry(`amazonq-explore-${actionId}`)) this.sendMessageToExtension({ - command: 'open-user-guide', - userGuideLink, + command: 'open-link', + link: userGuideLink, }) } } diff --git a/plugins/amazonq/mynah-ui/src/mynah-ui/ui/commands.ts b/plugins/amazonq/mynah-ui/src/mynah-ui/ui/commands.ts index 5df19981b3f..f7818a83f48 100644 --- a/plugins/amazonq/mynah-ui/src/mynah-ui/ui/commands.ts +++ b/plugins/amazonq/mynah-ui/src/mynah-ui/ui/commands.ts @@ -60,7 +60,7 @@ type MessageCommand = | 'codescan_open_issues' | 'generate-test' | 'start-test-gen' - | 'open-user-guide' + | 'open-link' | 'send-telemetry' | 'doc_stop_generate' | 'updatePromptProgress' diff --git a/plugins/amazonq/mynah-ui/src/mynah-ui/ui/connector.ts b/plugins/amazonq/mynah-ui/src/mynah-ui/ui/connector.ts index 143b3f017af..847bf12e5da 100644 --- a/plugins/amazonq/mynah-ui/src/mynah-ui/ui/connector.ts +++ b/plugins/amazonq/mynah-ui/src/mynah-ui/ui/connector.ts @@ -136,6 +136,13 @@ export class Connector { } } + onLinkClick = (link: string): void => { + this.sendMessageToExtension({ + command: 'open-link', + link, + }) + } + onResponseBodyLinkClick = (tabID: string, messageId: string, link: string): void => { switch (this.tabsStorage.getTab(tabID)?.type) { case 'cwc': diff --git a/plugins/amazonq/mynah-ui/src/mynah-ui/ui/main.ts b/plugins/amazonq/mynah-ui/src/mynah-ui/ui/main.ts index 1be8f151a72..4865d5c1d32 100644 --- a/plugins/amazonq/mynah-ui/src/mynah-ui/ui/main.ts +++ b/plugins/amazonq/mynah-ui/src/mynah-ui/ui/main.ts @@ -688,6 +688,12 @@ export const createMynahUI = ( mouseEvent?.stopImmediatePropagation() connector.onResponseBodyLinkClick(tabId, messageId, link) }, + onFormLinkClick: (link, mouseEvent) => { + mouseEvent?.preventDefault() + mouseEvent?.stopPropagation() + mouseEvent?.stopImmediatePropagation() + connector.onLinkClick(link) + }, onInfoLinkClick: (tabId: string, link: string, mouseEvent?: MouseEvent) => { mouseEvent?.preventDefault() mouseEvent?.stopPropagation() diff --git a/plugins/amazonq/mynah-ui/src/mynah-ui/ui/texts/constants.ts b/plugins/amazonq/mynah-ui/src/mynah-ui/ui/texts/constants.ts index 9c6c6dbc9a9..6c01d87b382 100644 --- a/plugins/amazonq/mynah-ui/src/mynah-ui/ui/texts/constants.ts +++ b/plugins/amazonq/mynah-ui/src/mynah-ui/ui/texts/constants.ts @@ -8,6 +8,8 @@ export const uiComponentsTexts = { copy: 'Copy', insertAtCursorLabel: 'Insert at cursor', feedbackFormTitle: 'Report an issue', + feedbackFormDescription: + '_Feedback is anonymous. For issue updates, please contact us on [GitHub](https://github.com/aws/aws-toolkit-jetbrains/issues/new/choose)._', feedbackFormOptionsLabel: 'What type of issue would you like to report?', feedbackFormCommentLabel: 'Description of issue (optional):', feedbackThanks: 'Thanks for your feedback!',