@@ -5,7 +5,7 @@ import cc.unitmesh.devti.inline.fullWidth
5
5
import cc.unitmesh.devti.observer.plan.AgentTaskEntry
6
6
import cc.unitmesh.devti.observer.plan.MarkdownPlanParser
7
7
import cc.unitmesh.devti.observer.plan.PlanUpdateListener
8
- import cc.unitmesh.devti.shadow.IssueInputPanel
8
+ import cc.unitmesh.devti.shadow.IssueInputViewPanel
9
9
import cc.unitmesh.devti.sketch.ui.plan.PlanLangSketch
10
10
import com.intellij.openapi.Disposable
11
11
import com.intellij.openapi.actionSystem.ActionGroup
@@ -52,12 +52,12 @@ class AutoDevPlannerToolWindow(val project: Project) : SimpleToolWindowPanel(tru
52
52
if (content.isBlank()) {
53
53
switchToView(IssueInputView ())
54
54
} else {
55
- switchToView(PlanView ())
55
+ switchToView(PlanSketchView ())
56
56
}
57
57
58
58
connection.subscribe(PlanUpdateListener .Companion .TOPIC , object : PlanUpdateListener {
59
59
override fun onPlanUpdate (items : MutableList <AgentTaskEntry >) {
60
- if (currentView is PlanView ) {
60
+ if (currentView is PlanSketchView ) {
61
61
runInEdt {
62
62
planLangSketch.updatePlan(items)
63
63
contentPanel.components.find { it is LoadingPanel }?.let {
@@ -72,7 +72,7 @@ class AutoDevPlannerToolWindow(val project: Project) : SimpleToolWindowPanel(tru
72
72
override fun onUpdateChange (changes : MutableList <Change >) {
73
73
runInEdt {
74
74
plannerResultSummary.updateChanges(changes)
75
- if (currentView is PlanView ) {
75
+ if (currentView is PlanSketchView ) {
76
76
if (contentPanel.components.none { it == plannerResultSummary }) {
77
77
contentPanel.add(plannerResultSummary, BorderLayout .SOUTH )
78
78
}
@@ -103,7 +103,7 @@ class AutoDevPlannerToolWindow(val project: Project) : SimpleToolWindowPanel(tru
103
103
planLangSketch.updatePlan(parsedItems)
104
104
}
105
105
106
- switchToView(PlanView ())
106
+ switchToView(PlanSketchView ())
107
107
}
108
108
109
109
fun showLoadingState (issueText : String ) {
@@ -127,7 +127,7 @@ class AutoDevPlannerToolWindow(val project: Project) : SimpleToolWindowPanel(tru
127
127
PLAN , EDITOR , ISSUE_INPUT , LOADING
128
128
}
129
129
130
- inner class PlanView : PlannerView {
130
+ inner class PlanSketchView : PlannerView {
131
131
override val viewType = PlannerViewType .PLAN
132
132
override fun initialize (window : AutoDevPlannerToolWindow ) {
133
133
val planPanel = panel {
@@ -143,15 +143,15 @@ class AutoDevPlannerToolWindow(val project: Project) : SimpleToolWindowPanel(tru
143
143
}
144
144
}
145
145
146
- inner class EditorView : PlannerView {
146
+ inner class EditPlanView : PlannerView {
147
147
override val viewType = PlannerViewType .EDITOR
148
148
override fun initialize (window : AutoDevPlannerToolWindow ) {
149
- val editPlanPanel = EditPlanPanel (
149
+ val editPlanViewPanel = EditPlanViewPanel (
150
150
project = project,
151
151
content = content,
152
152
onSave = { newContent ->
153
153
if (newContent == content) {
154
- return @EditPlanPanel
154
+ return @EditPlanViewPanel
155
155
}
156
156
switchToPlanView(newContent)
157
157
currentCallback?.invoke(newContent)
@@ -161,16 +161,16 @@ class AutoDevPlannerToolWindow(val project: Project) : SimpleToolWindowPanel(tru
161
161
}
162
162
)
163
163
164
- contentPanel.add(editPlanPanel , BorderLayout .CENTER )
164
+ contentPanel.add(editPlanViewPanel , BorderLayout .CENTER )
165
165
}
166
166
}
167
167
168
168
inner class IssueInputView : PlannerView {
169
169
override val viewType = PlannerViewType .ISSUE_INPUT
170
- private lateinit var issueInputPanel : IssueInputPanel
170
+ private lateinit var viewPanel : IssueInputViewPanel
171
171
172
172
override fun initialize (window : AutoDevPlannerToolWindow ) {
173
- issueInputPanel = IssueInputPanel (
173
+ viewPanel = IssueInputViewPanel (
174
174
project,
175
175
onSubmit = { issueText ->
176
176
if (issueText.isNotBlank()) {
@@ -182,15 +182,14 @@ class AutoDevPlannerToolWindow(val project: Project) : SimpleToolWindowPanel(tru
182
182
}
183
183
)
184
184
185
- contentPanel.add(issueInputPanel , BorderLayout .CENTER )
186
- issueInputPanel .setText(" " )
187
- issueInputPanel .requestTextAreaFocus()
185
+ contentPanel.add(viewPanel , BorderLayout .CENTER )
186
+ viewPanel .setText(" " )
187
+ viewPanel .requestTextAreaFocus()
188
188
}
189
189
}
190
190
191
191
inner class LoadingView : PlannerView {
192
192
override val viewType = PlannerViewType .LOADING
193
-
194
193
override fun initialize (window : AutoDevPlannerToolWindow ) {
195
194
val planPanel = panel {
196
195
row {
@@ -226,7 +225,7 @@ class AutoDevPlannerToolWindow(val project: Project) : SimpleToolWindowPanel(tru
226
225
if (planText.isNotEmpty() && planText != plannerWindow.content) {
227
226
plannerWindow.content = planText
228
227
}
229
- plannerWindow.switchToView(plannerWindow.EditorView ())
228
+ plannerWindow.switchToView(plannerWindow.EditPlanView ())
230
229
}
231
230
}
232
231
0 commit comments