Skip to content
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

feat(amazonq): Add description and github issue link to feedback form #5313

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type" : "feature",
"description" : "feat(amazonq): Added github issue link and description to the chat answer feedback form"
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@
}

// some weird issue preventing deserialization from working
"open-user-guide" -> {
BrowserUtil.browse(node.get("userGuideLink").asText())
"open-link" -> {
BrowserUtil.browse(node.get("link").asText())

Check warning on line 58 in plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/webview/BrowserConnector.kt

View check run for this annotation

Codecov / codecov/patch

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/webview/BrowserConnector.kt#L58

Added line #L58 was not covered by tests
}
"send-telemetry" -> {
val source = node.get("source")
Expand Down
8 changes: 4 additions & 4 deletions plugins/amazonq/mynah-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/amazonq/mynah-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"lintfix": "eslint -c .eslintrc.js --fix --ext .ts ."
},
"dependencies": {
"@aws/mynah-ui-chat": "npm:@aws/mynah-ui@4.21.6",
"@aws/mynah-ui-chat": "npm:@aws/mynah-ui@4.22.1",
"@types/node": "^14.18.5",
"fs-extra": "^10.0.1",
"sanitize-html": "^2.12.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
}
}
2 changes: 1 addition & 1 deletion plugins/amazonq/mynah-ui/src/mynah-ui/ui/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
7 changes: 7 additions & 0 deletions plugins/amazonq/mynah-ui/src/mynah-ui/ui/connector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
6 changes: 6 additions & 0 deletions plugins/amazonq/mynah-ui/src/mynah-ui/ui/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 2 additions & 0 deletions plugins/amazonq/mynah-ui/src/mynah-ui/ui/texts/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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!',
Expand Down
Loading