Highlight the Inbox tab while the task has open inbox items

This commit is contained in:
Ian Gulliver
2026-10-15 12:29:15 -07:00
parent 606cf4b5c0
commit a855933dee
5 changed files with 29 additions and 6 deletions
+4 -2
View File
@@ -38,8 +38,10 @@ export function taskPane() {
const first = state.focus.tabs.filter((t, i, all) => tabs.includes(t) && all.indexOf(t) === i);
const order = [...first, ...tabs.filter((t) => !first.includes(t))];
const tab = state.focus.tab;
const waiting = state.inbox.filter((item) => item.task_id === state.selectedTaskId).length;
replace(strip, ...order.map((t) => {
const b = h("button", { class: t === tab ? "active" : "" }, views[t].label);
const attention = t === "inbox" && waiting > 0;
const b = h("button", { class: [t === tab ? "active" : "", attention ? "attention" : ""].join(" ").trim() }, views[t].label, attention && h("span", { class: "badge", title: "inbox items" }, waiting));
b.onclick = () => focusTab(t);
return b;
}), h("span", { class: "spacer" }), picker);
@@ -52,7 +54,7 @@ export function taskPane() {
replace(body, root);
dispose = views[tab].mount(root);
};
on("focus", render);
onEach(["focus", "inbox", "selection"], render);
onEach(["projects", "tasks", "selection", "focus"], renderPicker);
render();
renderPicker();