Skip to content

Commit 8f908e8

Browse files
committed
refactor(AutoDevInputSection): replace JComboBox with ComboBox for model selection
1 parent e3f8932 commit 8f908e8

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class AutoDevInputSection(
8080
private val stopButtonPresentation: Presentation
8181
private val enhanceButtonPresentation: Presentation
8282
private val sendButton: ActionButton
83-
private val modelSelector: JComboBox<ModelItem>
83+
private val modelSelector: ComboBox<ModelItem>
8484
private val stopButton: ActionButton
8585
private val enhanceButton: ActionButton
8686
private var buttonPanel: JPanel = JPanel(CardLayout())
@@ -126,9 +126,8 @@ class AutoDevInputSection(
126126
input = AutoDevInput(project, listOf(), disposable, this)
127127
workspaceFilePanel = WorkspaceFilePanel(project)
128128

129-
// Create model selector
130129
val modelItems = LLMModelManager.getInstance().getAllAvailableModels()
131-
modelSelector = JComboBox(modelItems.toTypedArray())
130+
modelSelector = ComboBox(modelItems.toTypedArray())
132131

133132
val currentModel = AutoDevSettingsState.getInstance().defaultModelId.ifEmpty { "Default" }
134133
for (i in 0 until modelSelector.itemCount) {
@@ -212,8 +211,6 @@ class AutoDevInputSection(
212211
}
213212
}
214213
customAgent.selectedItem = defaultRag
215-
216-
// Add action listener to refresh agent list when dropdown is clicked
217214
customAgent.addActionListener {
218215
if (customAgent.isPopupVisible) {
219216
refreshAgentList()
@@ -229,7 +226,6 @@ class AutoDevInputSection(
229226
layoutPanel.addToLeft(modelSelector)
230227
}
231228

232-
// Set style for model selector
233229
modelSelector.border = JBUI.Borders.empty(0, 4)
234230
modelSelector.preferredSize = Dimension(200, modelSelector.preferredSize.height)
235231

0 commit comments

Comments
 (0)