From bf8f353ec5debafa168f96f9b04118350bd3f136 Mon Sep 17 00:00:00 2001 From: Zoe Lin Date: Thu, 31 Oct 2024 13:19:40 -0700 Subject: [PATCH 1/3] hide inline chat shortcut hint on remote/gateway --- .../cwc/inline/listeners/InlineChatSelectionListener.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/cwc/inline/listeners/InlineChatSelectionListener.kt b/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/cwc/inline/listeners/InlineChatSelectionListener.kt index 106e672486d..a4fc74f8c87 100644 --- a/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/cwc/inline/listeners/InlineChatSelectionListener.kt +++ b/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/cwc/inline/listeners/InlineChatSelectionListener.kt @@ -3,6 +3,7 @@ package software.aws.toolkits.jetbrains.services.cwc.inline.listeners +import com.intellij.idea.AppMode import com.intellij.openapi.Disposable import com.intellij.openapi.editor.event.SelectionEvent import com.intellij.openapi.editor.event.SelectionListener @@ -14,7 +15,7 @@ class InlineChatSelectionListener : SelectionListener, Disposable { val editor = e.editor val selectionModel = editor.selectionModel - if (selectionModel.hasSelection()) { + if (selectionModel.hasSelection() && !AppMode.isRemoteDevHost()) { inlineChatEditorHint.show(editor) } else { inlineChatEditorHint.hide() From 226f20c428809eeee96b90fff8210244305be8e4 Mon Sep 17 00:00:00 2001 From: Zoe Lin Date: Thu, 31 Oct 2024 13:26:01 -0700 Subject: [PATCH 2/3] add change log --- .../bugfix-bc45640b-9877-43e5-b6cd-8b7dc35c570b.json | 4 ++++ .../cwc/inline/listeners/InlineChatSelectionListener.kt | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changes/next-release/bugfix-bc45640b-9877-43e5-b6cd-8b7dc35c570b.json diff --git a/.changes/next-release/bugfix-bc45640b-9877-43e5-b6cd-8b7dc35c570b.json b/.changes/next-release/bugfix-bc45640b-9877-43e5-b6cd-8b7dc35c570b.json new file mode 100644 index 00000000000..216a307a497 --- /dev/null +++ b/.changes/next-release/bugfix-bc45640b-9877-43e5-b6cd-8b7dc35c570b.json @@ -0,0 +1,4 @@ +{ + "type" : "bugfix", + "description" : "Fix inline chat shortcut hint breaks selection on gateway" +} \ No newline at end of file diff --git a/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/cwc/inline/listeners/InlineChatSelectionListener.kt b/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/cwc/inline/listeners/InlineChatSelectionListener.kt index a4fc74f8c87..270ac2820b7 100644 --- a/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/cwc/inline/listeners/InlineChatSelectionListener.kt +++ b/plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/cwc/inline/listeners/InlineChatSelectionListener.kt @@ -12,10 +12,11 @@ import software.aws.toolkits.jetbrains.services.cwc.inline.InlineChatEditorHint class InlineChatSelectionListener : SelectionListener, Disposable { private val inlineChatEditorHint = InlineChatEditorHint() override fun selectionChanged(e: SelectionEvent) { + if (AppMode.isRemoteDevHost()) return val editor = e.editor val selectionModel = editor.selectionModel - if (selectionModel.hasSelection() && !AppMode.isRemoteDevHost()) { + if (selectionModel.hasSelection()) { inlineChatEditorHint.show(editor) } else { inlineChatEditorHint.hide() From 48715dac060ac4e6bfe0e102a5dab46d1ad6ceaa Mon Sep 17 00:00:00 2001 From: Zoe Lin <60411978+zixlin7@users.noreply.github.com> Date: Thu, 31 Oct 2024 13:35:06 -0700 Subject: [PATCH 3/3] Update .changes/next-release/bugfix-bc45640b-9877-43e5-b6cd-8b7dc35c570b.json Co-authored-by: Richard Li <742829+rli@users.noreply.github.com> --- .../bugfix-bc45640b-9877-43e5-b6cd-8b7dc35c570b.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changes/next-release/bugfix-bc45640b-9877-43e5-b6cd-8b7dc35c570b.json b/.changes/next-release/bugfix-bc45640b-9877-43e5-b6cd-8b7dc35c570b.json index 216a307a497..3bbf444a946 100644 --- a/.changes/next-release/bugfix-bc45640b-9877-43e5-b6cd-8b7dc35c570b.json +++ b/.changes/next-release/bugfix-bc45640b-9877-43e5-b6cd-8b7dc35c570b.json @@ -1,4 +1,4 @@ { "type" : "bugfix", - "description" : "Fix inline chat shortcut hint breaks selection on gateway" + "description" : "Fix inline chat shortcut hint breaking text selection on remote editors" } \ No newline at end of file