Skip to content

Commit 75968ba

Browse files
CopilotMte90
andcommitted
Implement all required changes for PicoCode plugin and web UI
- Remove build-plugin.yml workflow - Update kotlin-ci.yml to upload artifacts on releases - Fix plugin.xml: add id attribute and remove tool window - Update plugin to use dialog instead of sidebar - Add project selector to plugin chat UI - Add message deletion to plugin and web chat UI - Add collapsible sections to web UI - Fix /code endpoint HTTP 400 error by including project_id Co-authored-by: Mte90 <[email protected]>
1 parent 7699bb4 commit 75968ba

File tree

6 files changed

+266
-197
lines changed

6 files changed

+266
-197
lines changed

.github/workflows/build-plugin.yml

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

.github/workflows/kotlin-ci.yml

Lines changed: 13 additions & 3 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: [created, 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
@@ -85,11 +87,19 @@ jobs:
8587
# Remove the original zip
8688
rm "$PLUGIN_FILE"
8789
fi
88-
if: success()
90+
if: success() && github.event_name != 'release'
8991

9092
- name: Upload plugin artifact
9193
uses: actions/upload-artifact@v4
9294
with:
9395
name: intellij-plugin-pr-${{ github.event.pull_request.number || github.run_number }}
9496
path: ide-plugins/build/distributions/plugin-extracted/
95-
if: success()
97+
if: success() && github.event_name != 'release'
98+
99+
- name: Upload to Release
100+
if: github.event_name == 'release'
101+
uses: softprops/action-gh-release@v1
102+
with:
103+
files: ide-plugins/build/distributions/*.zip
104+
env:
105+
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)