Skip to content

Commit ec280c8

Browse files
committed
fix(runner): replace with AutoDevNotifications for warnings
feat(sketch): improve UI layout with Box and horizontal glue - Replaced logger warning with AutoDevNotifications in `RunServiceTask` for better visibility. - Enhanced UI layout in `DiffLangSketch` using `Box` and `createHorizontalGlue` for better alignment.
1 parent 39d1e71 commit ec280c8

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

core/src/main/kotlin/cc/unitmesh/devti/runner/RunServiceTask.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ open class RunServiceTask(
6767
val settings: RunnerAndConfigurationSettings? =
6868
fileRunService.createRunSettings(project, virtualFile, testElement)
6969
if (settings == null) {
70-
logger<RunServiceTask>().warn("No run configuration found for file: ${virtualFile.path}")
70+
AutoDevNotifications.warn(project, "No run configuration found for file: ${virtualFile.path}")
7171
return null
7272
}
7373

core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/patch/DiffLangSketch.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import com.intellij.ui.components.panels.VerticalLayout
2929
import com.intellij.util.containers.MultiMap
3030
import com.intellij.util.ui.JBUI
3131
import java.awt.BorderLayout
32+
import javax.swing.Box
3233
import javax.swing.BoxLayout
3334
import javax.swing.JButton
3435
import javax.swing.JComponent
@@ -60,6 +61,7 @@ class DiffLangSketch(private val myProject: Project, private var patchContent: S
6061
if (filePatches.isEmpty()) {
6162
val msg = "PatchProcessor: no valid patches found, please check the patch content"
6263
AutoDevNotifications.error(myProject, msg)
64+
6365
val repairButton = JButton("Repair").apply {
6466
icon = AllIcons.Actions.IntentionBulb
6567
toolTipText = "Try to repair the patch content"
@@ -75,13 +77,12 @@ class DiffLangSketch(private val myProject: Project, private var patchContent: S
7577
}
7678
}
7779

78-
val actionPanel = JPanel(HorizontalLayout(4))
79-
actionPanel.add(repairButton)
80+
val actionPanel = Box.createHorizontalBox()
81+
actionPanel.add(Box.createHorizontalGlue())
8082

8183
mainPanel.add(actionPanel)
8284

83-
return@invokeLater
84-
}
85+
return@invokeLater }
8586

8687
filePatches.forEachIndexed { _, patch ->
8788
val diffPanel = when {

0 commit comments

Comments
 (0)