Skip to content

Commit 7866713

Browse files
Merge branch 'main' into samgst/bump-252
2 parents cb7a17b + aaea8e9 commit 7866713

File tree

13 files changed

+121
-30
lines changed

13 files changed

+121
-30
lines changed

.changes/3.87.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"date" : "2025-07-30",
3+
"version" : "3.87",
4+
"entries" : [ {
5+
"type" : "bugfix",
6+
"description" : "change to use promptStickyCard to for image verification notification"
7+
}, {
8+
"type" : "bugfix",
9+
"description" : "Suppress IDE error when current editor context is not valid for Amazon Q"
10+
} ]
11+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "bugfix",
3+
"description" : "Fix unsupported files being shown in file picker when selecting images for adding image context in Windows"
4+
}

.changes/next-release/bugfix-7ceafecb-844d-46ce-a68d-b28360840ab6.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

.changes/next-release/bugfix-846e7004-5426-4f6b-970f-2b9437314b98.json

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "bugfix",
3+
"description" : "Fix the issue that sometime images added via drag & drop are incorrectly routed to pinned context"
4+
}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# _3.87_ (2025-07-30)
2+
- **(Bug Fix)** change to use promptStickyCard to for image verification notification
3+
- **(Bug Fix)** Suppress IDE error when current editor context is not valid for Amazon Q
4+
15
# _3.86_ (2025-07-16)
26
- **(Bug Fix)** - Fixed "Insert to Cursor" button to correctly insert code blocks at the current cursor position in the active file
37

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: Apache-2.0
33

44
# Toolkit Version
5-
toolkitVersion=3.87-SNAPSHOT
5+
toolkitVersion=3.88-SNAPSHOT
66

77
# Publish Settings
88
publishToken=

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/toolwindow/AmazonQPanel.kt

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ import software.aws.toolkits.jetbrains.services.codemodernizer.utils.isCodeTrans
4949
import software.aws.toolkits.resources.message
5050
import java.awt.datatransfer.DataFlavor
5151
import java.awt.dnd.DropTarget
52+
import java.awt.dnd.DropTargetDragEvent
5253
import java.awt.dnd.DropTargetDropEvent
54+
import java.awt.dnd.DropTargetEvent
5355
import java.io.File
5456
import java.util.concurrent.CompletableFuture
5557
import javax.imageio.ImageIO.read
@@ -138,6 +140,15 @@ class AmazonQPanel(val project: Project, private val scope: CoroutineScope) : Di
138140
// As an alternative, enabling the native drag in JCEF,
139141
// and let the native handling the drop event, and update the UI through JS bridge.
140142
val dropTarget = object : DropTarget() {
143+
override fun dragEnter(dtde: DropTargetDragEvent) {
144+
setDragAndDropOverlayVisible(browserInstance, true)
145+
}
146+
override fun dragOver(dtde: DropTargetDragEvent) {
147+
setDragAndDropOverlayVisible(browserInstance, true)
148+
}
149+
override fun dragExit(dte: DropTargetEvent) {
150+
setDragAndDropOverlayVisible(browserInstance, false)
151+
}
141152
override fun drop(dtde: DropTargetDropEvent) {
142153
try {
143154
dtde.acceptDrop(dtde.dropAction)
@@ -166,20 +177,16 @@ class AmazonQPanel(val project: Project, private val scope: CoroutineScope) : Di
166177
validImages.subList(20, validImages.size).clear()
167178
}
168179

180+
executeJavaScript(browserInstance, "window.resetTopBarClicked()")
181+
182+
setDragAndDropOverlayVisible(browserInstance, false)
183+
169184
val json = OBJECT_MAPPER.writeValueAsString(validImages)
170-
browserInstance.jcefBrowser.cefBrowser.executeJavaScript(
171-
"window.handleNativeDrop('$json')",
172-
browserInstance.jcefBrowser.cefBrowser.url,
173-
0
174-
)
185+
executeJavaScript(browserInstance, "window.handleNativeDrop('$json')")
175186

176187
if (errorMessages.isNotEmpty()) {
177188
val errorJson = OBJECT_MAPPER.writeValueAsString(errorMessages)
178-
browserInstance.jcefBrowser.cefBrowser.executeJavaScript(
179-
"window.handleNativeNotify('$errorJson')",
180-
browserInstance.jcefBrowser.cefBrowser.url,
181-
0
182-
)
189+
executeJavaScript(browserInstance, "window.handleNativeNotify('$errorJson')")
183190
}
184191

185192
dtde.dropComplete(true)
@@ -286,6 +293,22 @@ class AmazonQPanel(val project: Project, private val scope: CoroutineScope) : Di
286293
}
287294
}
288295

296+
private fun executeJavaScript(browserInstance: Browser, jsCommand: String) {
297+
try {
298+
browserInstance.jcefBrowser.cefBrowser.executeJavaScript(
299+
jsCommand,
300+
browserInstance.jcefBrowser.cefBrowser.url,
301+
0
302+
)
303+
} catch (e: Exception) {
304+
LOG.error { "Failed to execute JavaScript: $jsCommand - ${e.message}" }
305+
}
306+
}
307+
308+
private fun setDragAndDropOverlayVisible(browserInstance: Browser, visible: Boolean) {
309+
executeJavaScript(browserInstance, "window.setDragAndDropVisible('$visible')")
310+
}
311+
289312
private fun validateImageFile(file: File, allowedTypes: Set<String>, maxFileSize: Double, maxDimension: Int): String? {
290313
val fileName = file.name
291314
val ext = fileName.substringAfterLast('.', "").lowercase()

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/webview/Browser.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,15 @@ class Browser(parent: Disposable, private val webUri: URI, val project: Project)
189189
},
190190
})
191191
};
192+
193+
window.setDragAndDropVisible = function(visibility) {
194+
const parsedVisibility = JSON.parse(visibility);
195+
qChat.setDragOverlayVisible(qChat.getSelectedTabId(), parsedVisibility)
196+
};
197+
198+
window.resetTopBarClicked = function() {
199+
qChat.resetTopBarClicked(qChat.getSelectedTabId())
200+
};
192201
}
193202
</script>
194203
""".trimIndent()

plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/webview/theme/ThemeBrowserAdapter.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ class ThemeBrowserAdapter {
4444
append(CssVariable.TextColorLight, theme.emptyText)
4545
append(CssVariable.TextColorDisabled, theme.inactiveText)
4646

47-
append(CssVariable.Background, bg)
47+
append(CssVariable.Background, theme.background)
4848
append(CssVariable.BackgroundAlt, altBg)
4949
append(CssVariable.CardBackground, bg)
50-
append(CssVariable.CardBackgroundAlt, altBg)
50+
append(CssVariable.CardBackgroundAlt, theme.editorBackground)
5151
append(CssVariable.BorderDefault, theme.border)
5252
append(CssVariable.BorderFocused, theme.inputBorderFocused)
5353
append(CssVariable.BorderUnfocused, theme.inputBorderUnfocused)

0 commit comments

Comments
 (0)