Switch to Transcript after answering a task's last inbox item

This commit is contained in:
Ian Gulliver
2026-10-15 13:31:14 -07:00
parent 696385fced
commit cd0664e1e0
4 changed files with 12 additions and 4 deletions
+5 -1
View File
@@ -3,7 +3,7 @@ import { mountChanges } from "./changes.js";
import { ago, errorText, h, replace, showAlert } from "./dom.js";
import { image, inlineMarkdown, markdown } from "./markdown.js";
import { diagram } from "./mermaid.js";
import { onEach, state } from "./state.js";
import { focusTab, onEach, state } from "./state.js";
import { taskStyle } from "./taskcolor.js";
const checked = new Map<string, string[]>();
@@ -123,6 +123,10 @@ function card(item: InboxItem): HTMLElement {
await post("/api/inbox/responses", { body: { responses: [response] } });
checked.delete(item.id);
texts.delete(item.id);
const others = state.inbox.some((i) => i.task_id === item.task_id && i.id !== item.id);
if (!others && state.focus.tab === "inbox" && state.selectedTaskId === item.task_id) {
focusTab("transcript");
}
} catch (err) {
void showAlert(errorText(err));
lock(false);