Highlight the Inbox tab while the task has open inbox items
This commit is contained in:
Vendored
+4
-2
@@ -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();
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user