Switch to Transcript after answering a task's last inbox item
This commit is contained in:
Vendored
+5
-1
@@ -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();
|
||||
const texts = new Map();
|
||||
@@ -100,6 +100,10 @@ function card(item) {
|
||||
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));
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+5
-1
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user