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.

Collapse the done column

emanuele-embd7532ed565d
diff --git a/src/app.js b/src/app.js
index b48a4f7..adc66cc 100644
--- a/src/app.js
+++ b/src/app.js
@@ -66,6 +66,8 @@ const ICONS = {
plus: '<path d="M5 12h14M12 5v14"/>',
trash: '<path d="M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6M10 11v6M14 11v6"/>',
check: '<path d="M20 6 9 17l-5-5"/>',
+ collapse: '<path d="m13 17 5-5-5-5M6 17l5-5-5-5"/>',
+ expand: '<path d="m11 17-5-5 5-5M18 17l-5-5 5-5"/>',
rename: '<path d="M12 20h9"/><path d="M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"/>',
update: '<circle cx="12" cy="12" r="9"/><path d="M12 7v9M8 12l4 4 4-4"/>',
send: '<path d="M12 19V5M5 12l7-7 7 7"/>',
@@ -476,16 +478,20 @@ function renderColumns() {
if (state.layout !== layout) {
state.layout = layout;
columns.replaceChildren(...statuses.map((status, i) => {
+ const last = i === statuses.length - 1;
const col = el("section", { class: "column", "data-status": status },
el("h2", {}, el("span", { class: "dot", style: `background:${statusColor(status)}` }), status,
el("span", { class: "count" }),
// At the top, so a long column never hides it.
- i === 0 ? el("button", { class: "add", title: "Add task (n)", "aria-label": "Add task", onclick: newTask }, icon("plus")) : null),
+ i === 0 ? el("button", { class: "add", title: "Add task (n)", "aria-label": "Add task", onclick: newTask }, icon("plus")) : null,
+ last ? el("button", { class: "collapse", onclick: (e) => { e.stopPropagation(); setDoneCollapsed(!doneCollapsed()); } }) : null),
el("div", { class: "cards" }),
);
wireDrop(col, col.querySelector(".cards"), status);
+ if (last) col.addEventListener("click", () => { if (doneCollapsed()) setDoneCollapsed(false); });
return col;
}));
+ showDoneCollapsed();
}
// During a drag the DOM is being moved by hand; refresh once it ends.
@@ -506,6 +512,31 @@ function renderColumns() {
}
}
+// The done column only grows; it starts collapsed to a thin strip, as in Trello or Linear,
+// and each browser remembers the choice. Cards can still be dropped on the strip.
+function doneCollapsed() {
+ return localStorageGet("kanzo.doneCollapsed") !== "0";
+}
+
+function setDoneCollapsed(collapsed) {
+ try { localStorage.setItem("kanzo.doneCollapsed", collapsed ? "1" : "0"); } catch {}
+ showDoneCollapsed();
+}
+
+function showDoneCollapsed() {
+ const columns = $("#columns");
+ const cols = [...columns.querySelectorAll(".column")];
+ if (!cols.length) return;
+ const collapsed = doneCollapsed();
+ const done = cols[cols.length - 1];
+ done.classList.toggle("collapsed", collapsed);
+ const button = done.querySelector(".collapse");
+ button.replaceChildren(icon(collapsed ? "expand" : "collapse"));
+ button.title = collapsed ? `Show ${done.dataset.status}` : `Collapse ${done.dataset.status}`;
+ button.setAttribute("aria-label", button.title);
+ columns.style.gridTemplateColumns = cols.map((c) => (c === done && collapsed ? "48px" : "minmax(260px, 1fr)")).join(" ");
+}
+
// A description as one line of plain text for a card: Markdown markers dropped, lines joined.
function plainText(md) {
return md.split("\n")
diff --git a/src/index.html b/src/index.html
index 8803230..3db8f31 100644
--- a/src/index.html
+++ b/src/index.html
@@ -145,6 +145,17 @@ header .sub a:hover { color: var(--text); }
margin: 0; padding: 14px 16px 10px; display: flex; align-items: center; gap: 8px;
}
.column h2 .count { color: var(--faint); font-weight: 400; }
+.column h2 .collapse {
+ margin: -6px -6px -6px auto; width: 30px; height: 30px; padding: 6px; border: 0; border-radius: 8px;
+ background: none; color: var(--faint);
+}
+.column h2 .collapse:hover, .column h2 .collapse:focus-visible { background: var(--hover); color: var(--text); }
+/* A collapsed done column: a thin strip, name written downwards, that expands on a click. */
+.column.collapsed { cursor: pointer; }
+.column.collapsed:hover { background: var(--hover); }
+.column.collapsed h2 { writing-mode: vertical-rl; padding: 12px 0; align-items: center; gap: 10px; }
+.column.collapsed h2 .collapse { margin: 0 0 4px; order: -1; }
+.column.collapsed .cards { display: none; }
.cards { flex: 0 1 auto; overflow-y: auto; padding: 2px 8px 8px; display: flex; flex-direction: column; gap: 6px; min-height: 8px; }
.card {
background: var(--card); border: 1px solid var(--card-border); border-radius: 14px; padding: 10px 12px;