diff --git a/.changes/next-release/bugfix-7ceafecb-844d-46ce-a68d-b28360840ab6.json b/.changes/next-release/bugfix-7ceafecb-844d-46ce-a68d-b28360840ab6.json new file mode 100644 index 00000000000..480dce2947b --- /dev/null +++ b/.changes/next-release/bugfix-7ceafecb-844d-46ce-a68d-b28360840ab6.json @@ -0,0 +1,4 @@ +{ + "type" : "bugfix", + "description" : "change to use promptStickyCard to for image verification notification" +} \ No newline at end of file diff --git a/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/toolwindow/AmazonQPanel.kt b/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/toolwindow/AmazonQPanel.kt index 7fb75af2198..31fe1ec6dc0 100644 --- a/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/toolwindow/AmazonQPanel.kt +++ b/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/toolwindow/AmazonQPanel.kt @@ -173,12 +173,15 @@ class AmazonQPanel(val project: Project, private val scope: CoroutineScope) : Di 0 ) - val errorJson = OBJECT_MAPPER.writeValueAsString(errorMessages) - browserInstance.jcefBrowser.cefBrowser.executeJavaScript( - "window.handleNativeNotify('$errorJson')", - browserInstance.jcefBrowser.cefBrowser.url, - 0 - ) + if (errorMessages.isNotEmpty()) { + val errorJson = OBJECT_MAPPER.writeValueAsString(errorMessages) + browserInstance.jcefBrowser.cefBrowser.executeJavaScript( + "window.handleNativeNotify('$errorJson')", + browserInstance.jcefBrowser.cefBrowser.url, + 0 + ) + } + dtde.dropComplete(true) } else { dtde.dropComplete(false) diff --git a/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/webview/Browser.kt b/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/webview/Browser.kt index c092e1bf2f8..43cdc52f949 100644 --- a/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/webview/Browser.kt +++ b/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/webview/Browser.kt @@ -175,11 +175,19 @@ class Browser(parent: Disposable, private val webUri: URI, val project: Project) window.handleNativeNotify = function(errorMessages) { const messages = JSON.parse(errorMessages); - messages.forEach(msg => { - qChat.notify({ - content: msg - }) - }); + let message = messages.join('\n'); + qChat.updateStore(qChat.getSelectedTabId(), { + promptInputStickyCard: { + messageId: 'image-verification-banner', + header: { + icon: 'warning', + iconStatus: 'warning', + body: '### Invalid Image', + }, + body: message, + canBeDismissed: true, + }, + }) }; }