Open the Inbox tab when the watched task asks a question

This commit is contained in:
Ian Gulliver
2026-10-15 18:24:49 -07:00
parent 33352cb16c
commit 4f94d73b58
4 changed files with 25 additions and 2 deletions
+12
View File
@@ -154,6 +154,18 @@ export function taskPane(): HTMLElement {
dispose = views[tab].mount(root);
};
const seen = new Set(state.inbox.map((item) => item.id));
const openAsked = () => {
const fresh = state.inbox.filter((item) => !seen.has(item.id));
for (const item of fresh) {
seen.add(item.id);
}
if (state.focus.tab === "transcript" && fresh.some((item) => item.kind === "question" && item.task_id === state.selectedTaskId)) {
focusTab("inbox");
}
};
on("inbox", openAsked);
onEach(["focus", "inbox", "selection", "transcript"], render);
onEach(["projects", "tasks", "selection", "focus"], () => {
renderPicker();