Skip to content

Commit a022140

Browse files
committed
fix(task-status): update task status logic for TODO and COMPLETED #331
- Remove IN_PROGRESS condition for execute button in ThoughtPlanSketchProvider. - Update default task status to TODO in MarkdownPlanParser for unmarked tasks.
1 parent b1cbc71 commit a022140

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

core/src/main/kotlin/cc/unitmesh/devti/observer/plan/MarkdownPlanParser.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ object MarkdownPlanParser {
230230
checkState in GITHUB_TODO_COMPLETED -> PlanTask(todoText, true, TaskStatus.COMPLETED)
231231
checkState in GITHUB_TODO_FAILED -> PlanTask(todoText, false, TaskStatus.FAILED)
232232
checkState in GITHUB_TODO_IN_PROGRESS -> PlanTask(todoText, false, TaskStatus.IN_PROGRESS)
233-
else -> PlanTask(todoText, false, TaskStatus.COMPLETED)
233+
else -> PlanTask(todoText, false, TaskStatus.TODO)
234234
}
235235

236236
itemsList.add(task)
@@ -246,7 +246,7 @@ object MarkdownPlanParser {
246246
} else {
247247
val cleanTaskText = taskFirstLine.replace(Regex("^[\\-\\*]\\s+"), "").trim()
248248
if (cleanTaskText.isNotEmpty()) {
249-
itemsList.add(PlanTask(cleanTaskText, false, TaskStatus.COMPLETED))
249+
itemsList.add(PlanTask(cleanTaskText, false, TaskStatus.TODO))
250250
// Process nested tasks if any
251251
taskItemNode.children.forEach { childNode ->
252252
if (childNode.type == MarkdownElementTypes.UNORDERED_LIST) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class PlanSketch(
167167
taskPanel.add(statusIcon)
168168

169169
// Add execute button for incomplete tasks
170-
if (task.status == TaskStatus.TODO || task.status == TaskStatus.IN_PROGRESS) {
170+
if (task.status == TaskStatus.TODO) {
171171
val executeButton = JButton(AllIcons.Actions.Execute).apply {
172172
border = BorderFactory.createEmptyBorder()
173173
preferredSize = Dimension(24, 24)

0 commit comments

Comments
 (0)