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 tasks with one New task button in the header

Edward Niewold0cf01e87728e
diff --git a/src/app.js b/src/app.js
index 11168e6..c56378d 100644
--- a/src/app.js
+++ b/src/app.js
@@ -471,6 +471,8 @@ function renderHeader() {
const p = currentProject();
const { projects, tasks } = state.board;
const header = $("#header");
+ // New tasks go in the inbox column; the task's Status field moves them elsewhere.
+ $("#new-task").hidden = !projects.length;
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"}`;
@@ -523,8 +525,6 @@ function renderColumns() {
el("h2", {},
statusIcon(status), status,
el("span", { class: "count" }),
- // At the top, so a long column never hides it.
- status === inbox ? el("button", { class: "add", title: "Add task (n)", "aria-label": "Add task", onclick: newTask }, icon("plus")) : null,
collapsible ? el("button", { class: "collapse", onclick: (e) => { e.stopPropagation(); setCollapsed(status, !isCollapsed(status)); } }) : null),
el("div", { class: "cards" }),
);
@@ -714,6 +714,7 @@ function hideNewProject() {
$("#new-project-toggle").hidden = false;
}
+$("#new-task").addEventListener("click", () => newTask());
$("#new-project-toggle").addEventListener("click", showNewProject);
$("#new-project-cancel").addEventListener("click", hideNewProject);
$("#new-project").addEventListener("submit", async (e) => {
@@ -1082,7 +1083,7 @@ document.addEventListener("keydown", (e) => {
openSearch();
}
if (e.key === "n" && !typing && !e.metaKey && !e.ctrlKey) {
- if ($("#columns .add")) { e.preventDefault(); newTask(); }
+ if (!$("#new-task").hidden) { e.preventDefault(); newTask(); }
}
});
diff --git a/src/index.html b/src/index.html
index bd75302..a4f9f1d 100644
--- a/src/index.html
+++ b/src/index.html
@@ -148,6 +148,9 @@ header .repo-link {
}
header .repo-link:hover, header .repo-link:focus-visible { background: var(--active); color: var(--text); }
header .repo-link .icon svg { width: 14px; height: 14px; }
+header .new-task { display: inline-flex; align-items: center; gap: 6px; padding-left: 12px; flex: none; }
+header .new-task[hidden] { display: none; }
+header .new-task .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;
@@ -216,11 +219,6 @@ header .repo-link .icon svg { width: 14px; height: 14px; }
}
.tag .dot { width: 6px; height: 6px; }
.drop-line { height: 2px; background: var(--text); border-radius: 2px; margin: -4px 4px; }
-.column h2 .add {
- margin: -6px -6px -6px auto; width: 30px; height: 30px; padding: 6px; border: 0; border-radius: 8px;
- background: none; color: var(--muted);
-}
-.column h2 .add:hover, .column h2 .add:focus-visible { background: var(--hover); color: var(--text); }
.empty {
margin: auto; text-align: center; color: var(--muted); max-width: 380px; padding: 40px 20px;
}
@@ -408,6 +406,7 @@ header .repo-link .icon svg { width: 14px; height: 14px; }
<main>
<header>
<div class="info" id="header"></div>
+ <button class="btn primary new-task" 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>
</main>