Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
Expand Up @@ -25,6 +25,7 @@
import software.aws.toolkits.jetbrains.services.amazonq.apps.AmazonQAppInitContext
import software.aws.toolkits.jetbrains.services.amazonq.apps.AppConnection
import software.aws.toolkits.jetbrains.services.amazonq.commands.MessageTypeRegistry
import software.aws.toolkits.jetbrains.services.amazonq.isQSupportedInThisVersion
import software.aws.toolkits.jetbrains.services.amazonq.lsp.AmazonQLspService
import software.aws.toolkits.jetbrains.services.amazonq.lsp.artifacts.ArtifactManager
import software.aws.toolkits.jetbrains.services.amazonq.lsp.flareChat.AsyncChatUiListener
Expand All @@ -42,6 +43,7 @@
import software.aws.toolkits.jetbrains.services.amazonqDoc.auth.isDocAvailable
import software.aws.toolkits.jetbrains.services.amazonqFeatureDev.auth.isFeatureDevAvailable
import software.aws.toolkits.jetbrains.services.codemodernizer.utils.isCodeTransformAvailable
import software.aws.toolkits.resources.message
import java.util.concurrent.CompletableFuture
import javax.swing.JButton

Expand Down Expand Up @@ -102,6 +104,9 @@
webviewContainer.add(JBTextArea("JCEF not supported"))
}
browser.complete(null)
} else if (!isQSupportedInThisVersion()) {
webviewContainer.add(JBTextArea("${message("q.unavailable")}\n ${message("q.unavailable.node")}"))
browser.complete(null)

Check warning on line 109 in plugins/amazonq/chat/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/toolwindow/AmazonQPanel.kt

View check run for this annotation

Codecov / codecov/patch

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

Added lines #L108 - L109 were not covered by tests
} else {
val loadingPanel = JBLoadingPanel(null, this)
val wrapper = Wrapper()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import software.aws.toolkits.jetbrains.core.webview.BrowserState
import software.aws.toolkits.jetbrains.services.amazonq.QWebviewPanel
import software.aws.toolkits.jetbrains.services.amazonq.RefreshQChatPanelButtonPressedListener
import software.aws.toolkits.jetbrains.services.amazonq.gettingstarted.openMeetQPage
import software.aws.toolkits.jetbrains.services.amazonq.isQSupportedInThisVersion
import software.aws.toolkits.jetbrains.services.amazonq.profile.QRegionProfile
import software.aws.toolkits.jetbrains.services.amazonq.profile.QRegionProfileManager
import software.aws.toolkits.jetbrains.services.amazonq.profile.QRegionProfileSelectedListener
Expand Down Expand Up @@ -149,7 +150,7 @@ class AmazonQToolWindowFactory : ToolWindowFactory, DumbAware {
)
}

override fun shouldBeAvailable(project: Project): Boolean = isQWebviewsAvailable()
override fun shouldBeAvailable(project: Project): Boolean = isQWebviewsAvailable() && isQSupportedInThisVersion()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesnt this prevent the panel from being available at all?

Copy link
Contributor Author

@samgst-amazon samgst-amazon Jun 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only added this because I saw it here: https://github.com/aws/aws-toolkit-jetbrains-staging/pull/1769/files

but you're right when its true it removes the Q chat panel completely. Too confusing for cxs.


companion object {
private val LOG = getLogger<AmazonQToolWindowFactory>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

package software.aws.toolkits.jetbrains.services.amazonq

import com.intellij.openapi.application.ApplicationInfo
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.SystemInfo
import software.amazon.awssdk.services.codewhispererruntime.model.IdeCategory
Expand Down Expand Up @@ -52,3 +53,7 @@
.ideVersion(it.awsVersion)
.build()
}

fun isQSupportedInThisVersion(): Boolean = ApplicationInfo.getInstance().build.asStringWithoutProductCode() !in unSupportedIdeVersionInQ

val unSupportedIdeVersionInQ = listOf("242.21829.142")

Check warning on line 59 in plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/QUtils.kt

View check run for this annotation

Codecov / codecov/patch

plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/QUtils.kt#L59

Added line #L59 was not covered by tests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we do startswith 242.1, as in do we know for sure it's only this specific version?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mv == "242" && version < 242.22855.74?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

242.21829.142 maps to 242.1
242.22855.74 is 242.2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed to check for earlier 242 versions.

Original file line number Diff line number Diff line change
Expand Up @@ -1656,7 +1656,7 @@ q.session_configuration=Extend your IDE sessions
q.session_configuration.description=Your maximum session length for Amazon Q can be extended to 90 days by your administrator. For more information, refer to How to extend the session duration for Amazon Q in the IDE in the IAM Identity Center User Guide.
q.sign.in=Get Started
q.ui.prompt.transform=/transform
q.unavailable=\ Not supported in v2023.2.0
q.unavailable=\ Q Chat not supported in v2024.2.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
q.unavailable=\ Q Chat not supported in v2024.2.1
q.unavailable=\ Amazon Q Chat not supported in v2024.2.1

q.unavailable.node=Please update to the latest IDE version
q.window.title=Amazon Q Chat
rds.aurora=Aurora
Expand Down
Loading