Skip to content

Commit 61eaa16

Browse files
committed
feat(devti): improve task step UI and add retry functionality closed #352
- Update task step appearance: - Remove failed status text - Add retry button for failed tasks - Refactor UI rendering logic for better code organization
1 parent 8e61cd0 commit 61eaa16

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

core/src/main/kotlin/cc/unitmesh/devti/sketch/ui/plan/TaskStepPanel.kt

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class TaskStepPanel(
7474
}
7575
rightPanel.add(statusLabel)
7676

77-
if (task.status == TaskStatus.TODO || task.status == TaskStatus.FAILED) {
77+
if (task.status == TaskStatus.TODO) {
7878
val executeButton = JButton(AutoDevIcons.RUN).apply {
7979
preferredSize = Dimension(20, 20)
8080
margin = JBUI.emptyInsets()
@@ -84,14 +84,16 @@ class TaskStepPanel(
8484
addActionListener { executeTask() }
8585
}
8686
rightPanel.add(executeButton)
87-
}
88-
89-
if (task.status == TaskStatus.FAILED) {
90-
val retryButton = JButton("Retry").apply {
91-
margin = JBUI.insets(0, 2) // Less margin
92-
font = font.deriveFont(Font.PLAIN, 9f) // Smaller font size
93-
addActionListener { executeTask() }
87+
} else if (task.status == TaskStatus.FAILED) {
88+
val retryButton = JButton(AutoDevIcons.RERUN).apply {
89+
preferredSize = Dimension(24, 24)
90+
margin = JBUI.emptyInsets()
91+
isBorderPainted = false
92+
isContentAreaFilled = false
93+
toolTipText = "Rerun"
94+
addActionListener { executeTask(isRerun = true) }
9495
}
96+
9597
rightPanel.add(retryButton)
9698
}
9799

0 commit comments

Comments
 (0)