project task view movement
This commit is contained in:
+11
-2
@@ -121,6 +121,15 @@ function nested(active: Task[]): { task: Task; depth: number }[] {
|
||||
return out;
|
||||
}
|
||||
|
||||
const busyStates = new Set(["running", "reviewing", "merging", "discarding"]);
|
||||
|
||||
function stateMark(s: string | undefined): HTMLElement {
|
||||
if (s !== undefined && busyStates.has(s)) {
|
||||
return h("span", { class: "spinner", title: s });
|
||||
}
|
||||
return h("span", { class: `dot ${s ?? "none"}`, title: s ?? "no session" });
|
||||
}
|
||||
|
||||
function tasksBlock(active: Task[]): HTMLElement {
|
||||
if (active.length === 0) {
|
||||
return h("p", { class: "empty-row" }, "No active tasks.");
|
||||
@@ -145,7 +154,7 @@ function tasksBlock(active: Task[]): HTMLElement {
|
||||
},
|
||||
},
|
||||
task.parent_task_id !== undefined && h("span", { class: "subtask-mark", title: `Subtask of ${findTask(task.parent_task_id)?.title ?? task.parent_task_id}` }, "↳"),
|
||||
h("span", { class: `dot ${ts ?? "none"}`, title: ts ?? "no session" }),
|
||||
stateMark(ts),
|
||||
h("span", { class: "task-title task-name" }, task.title),
|
||||
count > 0 && h("span", { class: "badge", title: "inbox items" }, count),
|
||||
task.merge_queued_at !== undefined && h("span", { class: "task-state warn", title: "Waiting for the merge in progress in this project to finish" }, "merge held"),
|
||||
@@ -198,7 +207,7 @@ function todoBlock(project: Project, todo: Todo | string | undefined, active: Ta
|
||||
focusTask(task.id);
|
||||
},
|
||||
},
|
||||
h("span", { class: `dot ${sess?.state ?? "none"}`, title: sess?.state ?? "no session" }),
|
||||
stateMark(sess?.state),
|
||||
sess?.state ?? "no agent",
|
||||
);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user