Open the Inbox tab when the watched task asks a question
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user