Skip to content

Commit e0fc766

Browse files
CopilotMte90
andauthored
Fix plugin warnings, HTTP 400 error, and add project selection + message deletion (#27)
Co-authored-by: Mte90 <[email protected]> Co-authored-by: copilot-swe-agent[bot] <[email protected]>
1 parent 882b2e2 commit e0fc766

File tree

7 files changed

+529
-483
lines changed

7 files changed

+529
-483
lines changed

.github/workflows/build-plugin.yml

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

.github/workflows/kotlin-ci.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ on:
99
branches: [ "main" ]
1010
paths:
1111
- 'ide-plugins/**'
12+
release:
13+
types: [published]
1214

1315
jobs:
1416
build-kotlin-plugin:
1517
name: 'Build (Java 17)'
1618
runs-on: ubuntu-latest
1719
permissions:
18-
contents: read
20+
contents: write
1921

2022
steps:
2123
- name: Checkout repository
@@ -82,8 +84,10 @@ jobs:
8284
mkdir -p plugin-extracted
8385
# Extract the plugin zip
8486
unzip -q "$PLUGIN_FILE" -d plugin-extracted/
85-
# Remove the original zip
86-
rm "$PLUGIN_FILE"
87+
# For non-release builds, remove the original zip
88+
if [ "${{ github.event_name }}" != "release" ]; then
89+
rm "$PLUGIN_FILE"
90+
fi
8791
fi
8892
if: success()
8993

@@ -92,4 +96,12 @@ jobs:
9296
with:
9397
name: intellij-plugin-pr-${{ github.event.pull_request.number || github.run_number }}
9498
path: ide-plugins/build/distributions/plugin-extracted/
95-
if: success()
99+
if: success() && github.event_name != 'release'
100+
101+
- name: Upload to Release
102+
if: github.event_name == 'release'
103+
uses: softprops/action-gh-release@v1
104+
with:
105+
files: ide-plugins/build/distributions/plugin-extracted/
106+
env:
107+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

ide-plugins/src/main/kotlin/com/picocode/PicoCodeStatusBarWidget.kt

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import com.intellij.openapi.project.Project
55
import com.intellij.openapi.wm.StatusBar
66
import com.intellij.openapi.wm.StatusBarWidget
77
import com.intellij.openapi.wm.StatusBarWidgetFactory
8-
import com.intellij.openapi.wm.ToolWindowManager
9-
import com.intellij.openapi.ui.Messages
108
import com.intellij.util.Consumer
119
import com.google.gson.Gson
1210
import com.google.gson.JsonObject
@@ -93,20 +91,24 @@ class PicoCodeStatusBarWidget(private val project: Project) : StatusBarWidget,
9391

9492
override fun getClickConsumer(): Consumer<MouseEvent>? {
9593
return Consumer {
96-
// Open the PicoCode RAG tool window on click
94+
// Open the PicoCode chat dialog on click
9795
ApplicationManager.getApplication().invokeLater {
98-
val toolWindowManager = ToolWindowManager.getInstance(project)
99-
val toolWindow = toolWindowManager.getToolWindow("PicoCode RAG")
100-
101-
if (toolWindow != null) {
102-
toolWindow.show()
103-
} else {
104-
Messages.showInfoMessage(
105-
project,
106-
"PicoCode RAG tool window is not available. Please ensure the plugin is properly installed.",
107-
"PicoCode RAG"
108-
)
96+
val chatContent = PicoCodeToolWindowContent(project)
97+
val dialog = object : com.intellij.openapi.ui.DialogWrapper(project) {
98+
init {
99+
init()
100+
title = "PicoCode RAG Assistant"
101+
}
102+
103+
override fun createCenterPanel(): javax.swing.JComponent {
104+
return chatContent.getContent()
105+
}
106+
107+
override fun createActions(): Array<com.intellij.openapi.ui.DialogWrapper.DialogWrapperAction> {
108+
return emptyArray() // No default OK/Cancel buttons
109+
}
109110
}
111+
dialog.show()
110112
}
111113
}
112114
}

0 commit comments

Comments
 (0)