review status

This commit is contained in:
Ian Gulliver
2026-10-16 08:37:24 -07:00
parent 3274bf0498
commit 5320a63358
15 changed files with 219 additions and 197 deletions
+3 -3
View File
@@ -2,7 +2,7 @@ import { get, post } from "./api.js";
import { errorText, h, replace, showAlert } from "./dom.js";
import { markdown } from "./markdown.js";
import { models } from "./task.js";
import { currentSession, focusedProject, focusTask, on, onEach, state } from "./state.js";
import { currentSession, focusedProject, focusTask, on, onEach, state, taskState } from "./state.js";
import { taskStyle } from "./taskcolor.js";
const refreshKinds = new Set(["task.merged", "project.created"]);
export function mountProject(root) {
@@ -91,7 +91,7 @@ function tasksBlock(active) {
return h("p", { class: "empty-row" }, "No active tasks.");
}
return h("ul", { class: "task-list" }, ...active.map((task) => {
const sess = currentSession(task.id);
const ts = taskState(task);
const count = state.inbox.filter((item) => item.task_id === task.id).length;
return h("li", { class: task.id === state.selectedTaskId ? "selected" : "", style: taskStyle(task.id) }, h("a", {
href: `#/task/${task.id}`,
@@ -99,7 +99,7 @@ function tasksBlock(active) {
e.preventDefault();
focusTask(task.id);
},
}, h("span", { class: `dot ${sess?.state ?? "none"}`, title: sess?.state ?? "no session" }), 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"), h("span", { class: "task-state" }, sess?.state ?? "no agent")));
}, h("span", { class: `dot ${ts ?? "none"}`, title: ts ?? "no session" }), 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"), h("span", { class: "task-state" }, ts ?? "no agent")));
}));
}
function todoBlock(project, todo, active, starting, start) {
+1 -1
View File
File diff suppressed because one or more lines are too long
+7
View File
@@ -54,6 +54,10 @@ export function findTask(id) {
export function currentSession(taskId) {
return state.sessions.get(taskId)?.findLast((s) => s.state !== "completed") ?? state.sessions.get(taskId)?.at(-1);
}
export function taskState(task) {
const s = currentSession(task.id)?.state;
return s === "idle" && task.reviewing ? "reviewing" : s;
}
export function currentLead() {
return state.leadSessions.findLast((s) => s.state !== "completed") ?? state.leadSessions.at(-1);
}
@@ -270,6 +274,9 @@ export function handleEvent(ev) {
break;
case "review.started":
case "review.finished":
if (ev.project_id) {
void loadTasks(ev.project_id);
}
if (state.inbox.some((i) => i.task_id === ev.task_id && i.kind === "question")) {
void loadInbox();
}
+1 -1
View File
File diff suppressed because one or more lines are too long
+3 -3
View File
@@ -1,7 +1,7 @@
import { post } from "./api.js";
import { errorText, h, replace, showAlert } from "./dom.js";
import { focusLead } from "./panes.js";
import { activeTasks, currentSession, focusedProject, focusProject, focusTab, focusTask, lastVisits, onEach, state } from "./state.js";
import { activeTasks, focusedProject, focusProject, focusTab, focusTask, lastVisits, onEach, state, taskState } from "./state.js";
import { confirmMerge } from "./task.js";
import { taskStyle } from "./taskcolor.js";
export function bindShortcuts() {
@@ -79,8 +79,8 @@ export function openSwitcher() {
.map((m) => ({ ...m, count: inbox(m.task.id), visited: visits[m.task.id] ?? 0 }))
.sort((a, b) => Number(b.count > 0) - Number(a.count > 0) || a.visited - b.visited);
rows = matches.map(({ project, task, count }) => {
const sess = currentSession(task.id);
const el = h("li", { style: taskStyle(task.id) }, h("span", { class: `dot ${sess?.state ?? "none"}`, title: sess?.state ?? "no session" }), h("span", { class: "task-title" }, h("span", { class: "project-name" }, project.name), " ", h("span", { class: "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"), h("span", { class: "task-state" }, sess?.state ?? "no agent"));
const ts = taskState(task);
const el = h("li", { style: taskStyle(task.id) }, h("span", { class: `dot ${ts ?? "none"}`, title: ts ?? "no session" }), h("span", { class: "task-title" }, h("span", { class: "project-name" }, project.name), " ", h("span", { class: "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"), h("span", { class: "task-state" }, ts ?? "no agent"));
return { el, pick: () => go(task.id) };
});
for (const p of state.projects.filter((p) => `${p.name} project`.toLowerCase().includes(q))) {
+1 -1
View File
File diff suppressed because one or more lines are too long