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: hide ai fix panel and add more styling overrides [IDE-272] #541

Merged
merged 2 commits into from
Jun 10, 2024

Conversation

teodora-sandu
Copy link
Contributor

Description

Adds some simple JavaScript to hide the AI fixes panel in IntelliJ for now since we're missing styling and interactions and instead to show the dataflow panel and example commit fixes. There are many ways we could do this, and probably better, but we will make this panel functional soon so I went for the quickest solution.

It needs snyk/snyk-ls#527 for testing.

Checklist

  • Tests added and all succeed
  • Linted
  • CHANGELOG.md updated
  • README.md updated, if user-facing

Screenshots / GIFs

The backend isn't working at the moment so for testing I used an org that doesn't have the feature flag enabled and had to change a small part of the code so it's loading the HTML panel:

diff --git a/src/main/kotlin/io/snyk/plugin/ui/toolwindow/panels/JCEFDescriptionPanel.kt b/src/main/kotlin/io/snyk/plugin/ui/toolwindow/panels/JCEFDescriptionPanel.kt
index 5a11c26b..d6c486ad 100644
--- a/src/main/kotlin/io/snyk/plugin/ui/toolwindow/panels/JCEFDescriptionPanel.kt
+++ b/src/main/kotlin/io/snyk/plugin/ui/toolwindow/panels/JCEFDescriptionPanel.kt
@@ -3,7 +3,6 @@ package io.snyk.plugin.ui.toolwindow.panels
 import com.intellij.uiDesigner.core.GridLayoutManager
 import com.intellij.util.ui.JBUI
 import io.snyk.plugin.SnykFile
-import io.snyk.plugin.pluginSettings
 import io.snyk.plugin.ui.DescriptionHeaderPanel
 import io.snyk.plugin.ui.SnykBalloonNotificationHelper
 import io.snyk.plugin.ui.baseGridConstraintsAnchorWest
@@ -33,9 +32,9 @@ class SuggestionDescriptionPanelFromLS(
         "Snyk encountered an issue while rendering the vulnerability description. Please try again, or contact support if the problem persists. We apologize for any inconvenience caused."

     init {
+        val isIgnoresEnabled = true
         if (
-            pluginSettings().isGlobalIgnoresFeatureEnabled &&
-            issue.canLoadSuggestionPanelFromHTML()
+            isIgnoresEnabled
         ) {
             val openFileLoadHandlerGenerator = OpenFileLoadHandlerGenerator(snykFile)
             val html = this.getStyledHTML()
Screenshot 2024-06-07 at 16 14 28 Screenshot 2024-06-07 at 16 14 52

@teodora-sandu teodora-sandu requested a review from a team as a code owner June 7, 2024 15:16
Copy link
Contributor

@cat2608 cat2608 left a comment

Choose a reason for hiding this comment

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

🚀 Tested it locally.
💯 Thank you!

@teodora-sandu teodora-sandu merged commit bfcce11 into master Jun 10, 2024
9 checks passed
@teodora-sandu teodora-sandu deleted the feat/ai-fix-html branch June 10, 2024 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants