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.

Keep filters with Enter, as chips beside the box

emanuele-emd2b74540b91a
diff --git a/README.md b/README.md
index 7fd3700..51523d8 100644
--- a/README.md
+++ b/README.md
@@ -58,7 +58,7 @@ kanzo
The board opens at http://localhost:4242. That's all the setup there is: the first run creates `~/kanzo`, and the whole board lives in it.
-`n` adds a task, `/` or `⌘K` searches every project, `f` filters the board, `Tab` moves to the description, `⌘↵` saves and closes, `Esc` cancels. Mark a task Human and agents leave it to you; the person icon shows only those. Paste or drop an image into a task or a comment to attach it. When a new version is out, the sidebar offers it: one click installs it.
+`n` adds a task, `/` or `⌘K` searches every project, `f` filters the board and `↵` keeps the filter, `Tab` moves to the description, `⌘↵` saves and closes, `Esc` cancels. Mark a task Human and agents leave it to you; the person icon shows only those. Paste or drop an image into a task or a comment to attach it. When a new version is out, the sidebar offers it: one click installs it.
## Connect your agents
diff --git a/src/app.js b/src/app.js
index b3b36e6..371f29b 100644
--- a/src/app.js
+++ b/src/app.js
@@ -286,7 +286,7 @@ async function loadBoard() {
// The server leaves out older done tasks unless asked: the board does not show
// them, and the done column only grows. Search needs them all.
const done = state.allDone ? "&done=all" : "";
- const q = $("#filter").value.trim();
+ const q = filterQuery();
const board = await api("GET", "/board?project=" + encodeURIComponent(state.project) + done
+ (q ? "&q=" + encodeURIComponent(q) : ""));
if (request !== boardRequest) return;
@@ -485,6 +485,10 @@ function renderHeader() {
$("#new-task").hidden = !projects.length;
$("#human-only").hidden = !projects.length;
$("#filter").hidden = !projects.length;
+ $("#filters").replaceChildren(...(projects.length ? savedFilters() : []).map((f, i) =>
+ el("span", { class: "chip" }, f,
+ el("button", { type: "button", title: `Remove "${f}"`, "aria-label": `Remove the filter ${f}`,
+ onclick: () => setFilters(savedFilters().filter((_, j) => j !== i)) }, icon("close")))));
$("#human-only").setAttribute("aria-pressed", String(isHumanOnly()));
if (!projects.length) { header.replaceChildren(); return; }
// Plain words for what each piece is: how much is open, and the repos on GitHub.
@@ -551,7 +555,7 @@ function renderColumns() {
if (state.dragging) return;
const all = state.project === "all";
const humanOnly = isHumanOnly();
- const words = wordsOf($("#filter").value);
+ const words = wordsOf(filterQuery());
$("#filter").classList.toggle("on", words.length > 0);
for (const status of statuses) {
const col = columns.querySelector(`[data-status="${CSS.escape(status)}"]`);
@@ -573,6 +577,21 @@ function renderColumns() {
// The filter box keeps on the board only the tasks search finds (see loadBoard): search
// shows one to open, the filter all of them in their columns.
+// Enter keeps what's typed as a chip beside the box, and each browser remembers them;
+// a task must match every chip and the text still in the box.
+function savedFilters() {
+ try { return JSON.parse(localStorageGet("kanzo.filters")) || []; } catch { return []; }
+}
+
+function setFilters(filters) {
+ try { localStorage.setItem("kanzo.filters", JSON.stringify(filters)); } catch {}
+ loadBoard();
+}
+
+function filterQuery() {
+ return [...savedFilters(), $("#filter").value].join(" ").trim();
+}
+
function wordsOf(query) {
return query.toLowerCase().split(/\s+/).filter(Boolean);
}
@@ -765,7 +784,10 @@ $("#human-only").addEventListener("click", () => setHumanOnly(!isHumanOnly()));
let filterTimer;
$("#filter").addEventListener("input", () => { clearTimeout(filterTimer); filterTimer = setTimeout(loadBoard, 120); });
$("#filter").addEventListener("keydown", (e) => {
- if (e.key === "Escape") { e.stopPropagation(); $("#filter").value = ""; loadBoard(); $("#filter").blur(); }
+ const box = e.target, text = box.value.trim();
+ if (e.key === "Escape") { e.stopPropagation(); box.value = ""; loadBoard(); box.blur(); }
+ else if (e.key === "Enter" && text) { box.value = ""; setFilters([...savedFilters(), text]); }
+ else if (e.key === "Backspace" && !box.value && savedFilters().length) setFilters(savedFilters().slice(0, -1));
});
$("#new-project-toggle").addEventListener("click", showNewProject);
$("#new-project-cancel").addEventListener("click", hideNewProject);
diff --git a/src/index.html b/src/index.html
index dafdd46..8908137 100644
--- a/src/index.html
+++ b/src/index.html
@@ -161,6 +161,15 @@ header .repo-link .icon svg { width: 14px; height: 14px; }
}
#filter:focus { border-color: var(--link); }
#filter.on { border-color: var(--link); background: color-mix(in srgb, var(--link) 8%, transparent); }
+/* Filters kept with Enter: light blue chips, each with its × to remove it. */
+#filters { display: flex; flex-wrap: wrap; gap: 6px; }
+.chip {
+ display: inline-flex; align-items: center; gap: 2px; height: 28px; padding: 0 4px 0 12px; border-radius: 99px;
+ background: color-mix(in srgb, var(--link) 15%, transparent); color: var(--link); font-size: 13px;
+}
+.chip button { display: inline-flex; padding: 4px; border: 0; border-radius: 99px; background: none; color: inherit; }
+.chip button:hover { background: color-mix(in srgb, var(--link) 20%, transparent); }
+.chip .icon svg { width: 13px; height: 13px; }
/* The words search or the filter found. */
mark { background: color-mix(in srgb, var(--link) 25%, transparent); color: inherit; border-radius: 3px; }
/* Show only human tasks: a small icon, coloured while the filter is on. */
@@ -457,6 +466,7 @@ label.setting { cursor: pointer; }
#settings-nav { flex-direction: row; border-right: 0; border-bottom: 1px solid var(--border); }
header { padding: 12px; }
/* On a phone the filter takes its own line, below the title and buttons. */
+ #filters { order: 1; }
#filter { order: 1; flex: 1 0 100%; width: auto; }
}
</style>
@@ -477,6 +487,7 @@ label.setting { cursor: pointer; }
<main>
<header>
<div class="info" id="header"></div>
+ <div id="filters"></div>
<input type="search" id="filter" placeholder="Filter board" title="Show only the tasks that match (f)" aria-label="Filter the board" autocomplete="off" spellcheck="false" hidden>
<button class="ghost" id="human-only" title="Show only human tasks (h)" aria-label="Show only human tasks" aria-pressed="false" hidden><span class="icon" data-icon="human"></span></button>
<button class="ghost" id="network" aria-haspopup="dialog" aria-controls="network-menu"></button>