Skip to content

armgit / kanzo

Public Imported from GitHub
0

Self-hosted, sharable kanban for humans and agents. One 4.7 MB binary, 5 MB of RAM, 10 to 60 tokens per agent reply, starts in 3 ms, zero setup.

Add a Human only switch to the board header

Edward Niewold521dbea001f9
diff --git a/src/app.js b/src/app.js
index df44a47..d5be1cd 100644
--- a/src/app.js
+++ b/src/app.js
@@ -473,6 +473,8 @@ function renderHeader() {
const { projects, tasks } = state.board;
const header = $("#header");
$("#new-task").hidden = !projects.length;
+ $("#human-filter").hidden = !projects.length;
+ $("#human-only").checked = isHumanOnly();
if (!projects.length) { header.replaceChildren(); return; }
// Plain words for what each piece is: how much is open, and the repos on GitHub.
const open = (n) => `${n} open task${n === 1 ? "" : "s"}`;
@@ -537,21 +539,34 @@ function renderColumns() {
// During a drag the DOM is being moved by hand; refresh once it ends.
if (state.dragging) return;
const all = state.project === "all";
+ const humanOnly = isHumanOnly();
for (const status of statuses) {
const col = columns.querySelector(`[data-status="${CSS.escape(status)}"]`);
- const mine = tasks.filter((t) => t.status === status);
+ const mine = tasks.filter((t) => t.status === status && (!humanOnly || t.human));
// Older done tasks the server left out (see loadBoard).
const last = status === statuses[statuses.length - 1];
const hidden = last && !state.allDone ? state.board.done_hidden || 0 : 0;
- const count = mine.length + hidden;
+ // Filtered, the server's count of older done tasks says nothing about human ones.
+ const count = mine.length + (humanOnly ? 0 : hidden);
col.querySelector("h2 .count").textContent = count ? String(count) : "";
const more = hidden
- ? el("button", { class: "ghost more", onclick: () => { state.allDone = true; loadBoard(); } }, `Show ${hidden} older`)
+ ? el("button", { class: "ghost more", onclick: () => { state.allDone = true; loadBoard(); } },
+ humanOnly ? "Show older" : `Show ${hidden} older`)
: null;
col.querySelector(".cards").replaceChildren(...[more].filter(Boolean), ...mine.map((t) => card(t, all)));
}
}
+// The board can show only human tasks; off at first, and each browser remembers the choice.
+function isHumanOnly() {
+ return localStorageGet("kanzo.humanOnly") === "1";
+}
+
+function setHumanOnly(humanOnly) {
+ try { localStorage.setItem("kanzo.humanOnly", humanOnly ? "1" : "0"); } catch {}
+ render();
+}
+
// Backlog and done, which only grows, start collapsed to a thin strip, as in Trello or
// Linear, and each browser remembers the choice. Cards can still be dropped on a strip.
function isCollapsed(status) {
@@ -711,6 +726,7 @@ function hideNewProject() {
}
$("#new-task").addEventListener("click", newTask);
+$("#human-only").addEventListener("change", (e) => setHumanOnly(e.target.checked));
$("#new-project-toggle").addEventListener("click", showNewProject);
$("#new-project-cancel").addEventListener("click", hideNewProject);
$("#project-dialog").addEventListener("mousedown", (e) => { if (e.target.id === "project-dialog") hideNewProject(); });
diff --git a/src/index.html b/src/index.html
index 18dd793..7cdc271 100644
--- a/src/index.html
+++ b/src/index.html
@@ -143,6 +143,9 @@ header .repo-link:hover, header .repo-link:focus-visible { background: var(--act
header .repo-link .icon svg { width: 14px; height: 14px; }
#new-task { display: inline-flex; align-items: center; gap: 6px; padding-left: 12px; }
#new-task .icon svg { width: 16px; height: 16px; }
+/* Show only human tasks: a switch, as in Settings. */
+#human-filter { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); cursor: pointer; }
+#human-filter .icon svg { width: 16px; height: 16px; }
.columns {
flex: 1; min-height: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr);
gap: 12px; padding: 0 24px 24px; overflow-x: auto;
@@ -409,6 +412,10 @@ label.setting { cursor: pointer; }
<main>
<header>
<div class="info" id="header"></div>
+ <label id="human-filter" title="Show only human tasks" hidden>
+ <span class="icon" data-icon="human"></span>Human only
+ <span class="switch"><input type="checkbox" id="human-only" aria-label="Show only human tasks"><span></span></span>
+ </label>
<button class="btn primary" id="new-task" title="New task (n)" hidden><span class="icon" data-icon="plus"></span>New task</button>
</header>
<div class="columns" id="columns"></div>