Files
personal-hub/90-dashboards/Open-Tasks.md
T
Marcel Arndt a2ad5f5c6d import vault
2026-07-16 14:04:45 +02:00

1.0 KiB

Open Tasks

Tasks (signature: has status, no container) with status = "open", grouped by their immediate parent. Null-parent tasks appear under "Inbox (unassigned)".

const ALL = dv.pages('""').where(p =>
  p.status === "open" &&
  !p.container &&
  !p.file.path.startsWith("_templates/")
);

const groups = {};
for (const p of ALL) {
  const key = p.parent ? p.parent.path : "__inbox__";
  (groups[key] = groups[key] || []).push(p);
}

const renderGroup = (header, items) => {
  dv.header(2, header);
  dv.table(
    ["Task", "Captured"],
    items
      .sort((a, b) => (a.file.name > b.file.name ? 1 : -1))
      .map(p => [p.file.link, p.created])
  );
};

// Assigned groups, alphabetical by parent basename
for (const key of Object.keys(groups).filter(k => k !== "__inbox__").sort()) {
  const header = key.split("/").pop().replace(/\.md$/, "");
  renderGroup(header, groups[key]);
}

// Inbox bucket last
if (groups["__inbox__"]) {
  renderGroup("Inbox (unassigned)", groups["__inbox__"]);
}