Skip to content

Commit 16240e0

Browse files
committed
feat(gui): add resetAgent() method to clear custom agent selection in chat coding panel and input section. #51
1 parent 4c76a29 commit 16240e0

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/main/kotlin/cc/unitmesh/devti/gui/chat/AutoDevInputSection.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ class AutoDevInputSection(private val project: Project, val disposable: Disposab
221221
return customRag.selectedItem as CustomAgentConfig
222222
}
223223

224+
fun resetAgent() {
225+
customRag.selectedItem = defaultRag
226+
}
227+
224228
private val maxHeight: Int
225229
get() {
226230
val decorator: InternalDecorator = UIUtil.getParentOfType(

src/main/kotlin/cc/unitmesh/devti/gui/chat/ChatCodingPanel.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,14 @@ class ChatCodingPanel(private val chatCodingService: ChatCodingService, val disp
233233
progressBar.isVisible = false
234234
myList.removeAll()
235235
this.hiddenProgressBar()
236+
this.resetAgent()
236237
updateUI()
237238
}
238239

240+
fun resetAgent() {
241+
inputSection.resetAgent()
242+
}
243+
239244
fun hasSelectedCustomAgent(): Boolean {
240245
return inputSection.hasSelectedAgent()
241246
}

0 commit comments

Comments
 (0)