hide tags that only have completed tasks unless show completed is selected
This commit is contained in:
@@ -127,6 +127,7 @@ class OrgTodoListView extends ItemView {
|
|||||||
cb.addEventListener("change", () => {
|
cb.addEventListener("change", () => {
|
||||||
this.showDone = cb.checked;
|
this.showDone = cb.checked;
|
||||||
this.renderList();
|
this.renderList();
|
||||||
|
this.renderTagBar();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.tagBarEl = root.createDiv({ cls: "org-todo-tagbar" });
|
this.tagBarEl = root.createDiv({ cls: "org-todo-tagbar" });
|
||||||
@@ -224,7 +225,10 @@ class OrgTodoListView extends ItemView {
|
|||||||
|
|
||||||
// Every tag in the vault — the chip bar is a stable, complete palette.
|
// Every tag in the vault — the chip bar is a stable, complete palette.
|
||||||
const all = new Set();
|
const all = new Set();
|
||||||
for (const t of this.tasks) t.tags.forEach((x) => all.add(x));
|
for (const t of this.tasks) {
|
||||||
|
if (!this.showDone && t.done) continue;
|
||||||
|
t.tags.forEach((x) => all.add(x));
|
||||||
|
}
|
||||||
|
|
||||||
// Prune active filters whose tag no longer exists (the ghost-filter fix).
|
// Prune active filters whose tag no longer exists (the ghost-filter fix).
|
||||||
for (const tag of [...this.activeTags]) {
|
for (const tag of [...this.activeTags]) {
|
||||||
|
|||||||
Reference in New Issue
Block a user