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.

Show the task number and a description line on cards

emanuele-em959156f160bc
diff --git a/src/app.js b/src/app.js
index 7b52198..2b87720 100644
--- a/src/app.js
+++ b/src/app.js
@@ -67,8 +67,6 @@ const ICONS = {
more: '<circle cx="5" cy="12" r="1"/><circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/>',
plus: '<path d="M5 12h14M12 5v14"/>',
trash: '<path d="M3 6h18M8 6V4h8v2M19 6l-1 14H6L5 6M10 11v6M14 11v6"/>',
- text: '<path d="M17 6H3M21 12H3M15 18H3"/>',
- comment: '<path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/>',
check: '<path d="M20 6 9 17l-5-5"/>',
};
@@ -424,6 +422,17 @@ function renderColumns() {
}
}
+// A description as one line of plain text for a card: Markdown markers dropped, lines joined.
+function plainText(md) {
+ return md.split("\n")
+ .map((l) => l.replace(/^\s*(#{1,6}|>|[-*+]|\d+[.)])\s+/, "").replace(/^\[[ xX]\]\s+/, ""))
+ .filter((l) => l.trim() && !/^\s*```/.test(l))
+ .join(" ")
+ .replace(/\*\*|__|`/g, "")
+ .replace(/\s+/g, " ")
+ .trim();
+}
+
// Every word of the search must appear in the task's id, title, description or project.
function matches(t) {
const words = state.query.toLowerCase().split(/\s+/).filter(Boolean);
@@ -435,14 +444,12 @@ function matches(t) {
function card(t, showProject) {
const node = el("div", { class: "card" + (state.task === t.id ? " open" : ""), draggable: "true", "data-id": t.id,
onclick: () => openTask(t.id) },
- el("div", { class: "title" }, t.title),
- el("div", { class: "meta" },
- el("span", { class: "mono" }, key(t)),
- showProject ? el("span", { class: "tag" }, el("span", { class: "dot", style: `background:${projectColor(t.project)}` }), t.project) : null,
- el("span", { class: "spacer" }),
- t.description ? el("span", { class: "icon", title: "Has a description" }, icon("text")) : null,
- t.comments ? el("span", { class: "comments", title: `${t.comments} comments` }, icon("comment"), String(t.comments)) : null,
- ));
+ el("div", { class: "head" },
+ el("div", { class: "title" }, t.title),
+ // On "All projects" a dot in the project's colour tells the projects apart.
+ el("span", { class: "num", title: key(t) },
+ showProject ? el("span", { class: "dot", style: `background:${projectColor(t.project)}` }) : null, `#${t.id}`)),
+ t.description ? el("div", { class: "desc" }, plainText(t.description)) : null);
node.addEventListener("dragstart", (e) => {
state.dragging = t.id;
e.dataTransfer.effectAllowed = "move";
diff --git a/src/index.html b/src/index.html
index 98b8239..2142fbc 100644
--- a/src/index.html
+++ b/src/index.html
@@ -148,11 +148,17 @@ header .sub a:hover { color: var(--text); }
.card:hover { background: var(--card-hover); }
.card.open { background: var(--active); }
.card.dragging { opacity: .4; }
-.card .title { overflow-wrap: anywhere; }
-.card .meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; color: var(--faint); font-size: 12px; }
-.card .meta .spacer { flex: 1; }
-.card .meta .icon svg { width: 14px; height: 14px; }
-.card .meta .comments { display: inline-flex; align-items: center; gap: 4px; }
+.card .head { display: flex; align-items: flex-start; gap: 10px; }
+.card .title { overflow-wrap: anywhere; flex: 1; min-width: 0; }
+.card .num {
+ display: inline-flex; align-items: center; gap: 5px; flex: none; margin-top: 2px;
+ color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums;
+}
+.card .num .dot { width: 6px; height: 6px; }
+.card .desc {
+ margin-top: 2px; color: var(--muted); font-size: 13px;
+ white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
+}
.tag {
display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted);
background: var(--hover); border-radius: 99px; padding: 1px 9px 1px 8px;