kaizen-agent 1.78.0 → 1.78.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/install.ts +10 -7
- package/cli/sources.ts +3 -3
- package/package.json +1 -1
- package/skills/kaizen/SKILL.md +1 -1
- package/skills/kaizen/discover.md +1 -1
- package/skills/kaizen-explore/SKILL.md +2 -2
- package/skills/kaizen-help/SKILL.md +2 -2
- package/web/board/icebox.ts +52 -28
- package/web/board.html +2 -0
- package/web/board.js +72 -72
- package/web/notebook.js +85 -85
- package/web/term.js +1 -1
- package/web/video.js +94 -94
package/cli/install.ts
CHANGED
|
@@ -349,6 +349,9 @@ if (Bun.argv[2] === "sources" || Bun.argv[2] === "gather" || Bun.argv[2] === "ic
|
|
|
349
349
|
const state = locate() ?? join(home, ".kaizen");
|
|
350
350
|
// A source belongs to the project the command is run in; every answer names it.
|
|
351
351
|
const where = c.dim(`project ${label(state)}`);
|
|
352
|
+
// An icebox "collection" was first called a board: both words work, and `board` is what is stored.
|
|
353
|
+
if (Bun.argv[2] === "icebox" && (Bun.argv[3] === "collection" || Bun.argv[3] === "collections")) Bun.argv[3] = Bun.argv[3].replace("collection", "board");
|
|
354
|
+
for (let i = 4; Bun.argv[2] === "icebox" && i < Bun.argv.length; i++) if (Bun.argv[i] === "--collection") Bun.argv[i] = "--board";
|
|
352
355
|
const [, , cmd, op, url = "", ...rest] = Bun.argv;
|
|
353
356
|
const line = (r: { url: string; ok: boolean; note: string }) => ` ${r.ok ? c.green("ok ") : "fail"} ${r.url} ${c.dim(r.note)}`;
|
|
354
357
|
const waiting = c.dim(" new requests wait in the icebox — kaizen icebox");
|
|
@@ -376,10 +379,10 @@ if (Bun.argv[2] === "sources" || Bun.argv[2] === "gather" || Bun.argv[2] === "ic
|
|
|
376
379
|
const one = (f: string) => flags.get(f)?.at(-1);
|
|
377
380
|
const id = op === "edit" ? words.shift() : undefined;
|
|
378
381
|
if (op === "edit" && (!id || words.length)) { console.log("\n kaizen icebox edit <id> --file <path> (or the new text on stdin)\n"); process.exit(1); }
|
|
379
|
-
if (one("board") && one("client")) { console.log("\n --
|
|
382
|
+
if (one("board") && one("client")) { console.log("\n --collection or --client, not both\n"); process.exit(1); }
|
|
380
383
|
const raw = words.length ? words.join(" ") : one("file") ? readFileSync(one("file")!, "utf8") : process.stdin.isTTY ? "" : await Bun.stdin.text();
|
|
381
384
|
const [first = "", ...more] = raw.replace(/\r\n/g, "\n").trim().split("\n");
|
|
382
|
-
if (!first.trim()) { console.log("\n kaizen icebox add [text] [--file <path>] [--kind client|finding|people] [--
|
|
385
|
+
if (!first.trim()) { console.log("\n kaizen icebox add [text] [--file <path>] [--kind client|finding|people] [--collection <name> | --client <name>] [--tag <tag>]...\n the text as words, from --file, or on stdin\n"); process.exit(1); }
|
|
383
386
|
if (op === "edit") {
|
|
384
387
|
const why = src.editItem(state, id!, first, more.join("\n"));
|
|
385
388
|
if (why) { console.log(`\n ${why}\n`); process.exit(1); }
|
|
@@ -401,21 +404,21 @@ if (Bun.argv[2] === "sources" || Bun.argv[2] === "gather" || Bun.argv[2] === "ic
|
|
|
401
404
|
: op === "board" ? src.setBoard(state, ids, val.trim() === "-" ? "" : val)
|
|
402
405
|
: op === "snooze" ? src.snooze(state, ids, val)
|
|
403
406
|
: src.unsnooze(state, ids);
|
|
404
|
-
if (why) { console.log(`\n ${why}\n kaizen icebox kind <ids> client|finding|people · tag <ids> <tags> ·
|
|
405
|
-
console.log(`\n ${op}: ${ids.join(", ")}\n ${where}\n`);
|
|
407
|
+
if (why) { console.log(`\n ${why}\n kaizen icebox kind <ids> client|finding|people · tag <ids> <tags> · collection <ids> <name | -> · snooze <ids> <1d|1w|1m|YYYY-MM-DD> · unsnooze <ids>\n`); process.exit(1); }
|
|
408
|
+
console.log(`\n ${op === "board" ? "collection" : op}: ${ids.join(", ")}\n ${where}\n`);
|
|
406
409
|
} else if (cmd === "icebox" && op === "boards") {
|
|
407
|
-
// kaizen icebox
|
|
410
|
+
// kaizen icebox collections [add <name> [--client] | rm <name>] (also: boards)
|
|
408
411
|
const [verb, ...nm] = Bun.argv.slice(4);
|
|
409
412
|
if (verb === "add" || verb === "rm") {
|
|
410
413
|
const client = nm.includes("--client"), name = nm.filter((w) => w !== "--client").join(" ");
|
|
411
414
|
const why = verb === "add" ? src.saveBoard(state, name, client) : src.removeBoard(state, name);
|
|
412
415
|
if (why) { console.log(`\n ${why}\n`); process.exit(1); }
|
|
413
|
-
} else if (verb) { console.log("\n kaizen icebox
|
|
416
|
+
} else if (verb) { console.log("\n kaizen icebox collections [add <name> [--client] | rm <name>]\n"); process.exit(1); }
|
|
414
417
|
const all = src.readIcebox(state), boards = src.readBoards(state);
|
|
415
418
|
console.log(`\n ${where}`);
|
|
416
419
|
console.log(boards.length
|
|
417
420
|
? "\n" + boards.map((b) => ` ${b.name}${b.client ? c.dim(" client") : ""} ${c.dim(`${all.filter((s) => s.status === "new" && s.board === b.name).length} waiting`)}`).join("\n") + "\n"
|
|
418
|
-
: `\n no
|
|
421
|
+
: `\n no collections yet ${c.dim("— kaizen icebox collections add <name> [--client]")}\n`);
|
|
419
422
|
} else if (cmd === "icebox") {
|
|
420
423
|
const all = src.readIcebox(state), boards = src.readBoards(state), now = Date.now();
|
|
421
424
|
const fresh = all.filter((s) => s.status === "new" && !src.isSnoozed(s, now));
|
package/cli/sources.ts
CHANGED
|
@@ -306,7 +306,7 @@ const writeBoards = (state: string, list: Board[]) => { mkdirSync(state, { recur
|
|
|
306
306
|
// A board name as stored, or why not.
|
|
307
307
|
function boardName(raw: string): { name: string } | { why: string } {
|
|
308
308
|
const name = oneLine(raw);
|
|
309
|
-
return name && name.length <= 40 ? { name } : { why: "a
|
|
309
|
+
return name && name.length <= 40 ? { name } : { why: "a collection name is 1 to 40 characters" };
|
|
310
310
|
}
|
|
311
311
|
// Makes the board when it is new; `client` marks it a client's (never unmarks). The name
|
|
312
312
|
// as the board already spells it.
|
|
@@ -328,8 +328,8 @@ export function saveBoard(state: string, raw: string, client = false): string |
|
|
|
328
328
|
export function removeBoard(state: string, raw: string): string | null {
|
|
329
329
|
const list = readBoards(state);
|
|
330
330
|
const b = list.find((x) => same(x.name, oneLine(raw)));
|
|
331
|
-
if (!b) return "no such
|
|
332
|
-
if (readIcebox(state).some((s) => s.board && same(s.board, b.name))) return "the
|
|
331
|
+
if (!b) return "no such collection";
|
|
332
|
+
if (readIcebox(state).some((s) => s.board && same(s.board, b.name))) return "the collection still has items";
|
|
333
333
|
writeBoards(state, list.filter((x) => x !== b));
|
|
334
334
|
return null;
|
|
335
335
|
}
|
package/package.json
CHANGED
package/skills/kaizen/SKILL.md
CHANGED
|
@@ -52,7 +52,7 @@ Porting the workflow to Codex or Antigravity is covered in [`adapters.md`](adapt
|
|
|
52
52
|
| `/kaizen backlog` | Print the open backlog items across all runs, grouped by source run, with rescued items last under `Orphaned` |
|
|
53
53
|
| `/kaizen gather` | Read the request sources kaizen cannot read by itself and hand their requests over to the icebox |
|
|
54
54
|
| `/kaizen discover` | Read the icebox, group what was gathered, propose tasks, and promote the ones the user picks |
|
|
55
|
-
| "put this in the icebox" (any words) | Not a run: write the text to a temporary file with your file tool (first line the item, the rest notes), then `kaizen icebox add --file <path>`, adding `--kind client\|finding\|people` and `--
|
|
55
|
+
| "put this in the icebox" (any words) | Not a run: write the text to a temporary file with your file tool (first line the item, the rest notes), then `kaizen icebox add --file <path>`, adding `--kind client\|finding\|people` and `--collection <name>` or `--client <name>` when the user made them clear. Never put the text on the command line |
|
|
56
56
|
| `/kaizen docs` | Write this project's documentation into the notebook as a vault agents read first, or bring it up to date |
|
|
57
57
|
| `/kaizen docs lint` | Run the read-only `kaizen docs lint` CLI command; report broken links, missing sources and stale notes |
|
|
58
58
|
| `/kaizen concept [number] <brief>` | Make product concepts as clickable prototypes and get one approved before any build |
|
|
@@ -9,7 +9,7 @@ the need actually is, and which are worth a task. The user decides; you propose.
|
|
|
9
9
|
|
|
10
10
|
1. Run `kaizen icebox`. It prints one item per line: an id; in brackets the kind
|
|
11
11
|
(Client, Finding or People say; a `?` after it means no one sorted it yet), the
|
|
12
|
-
|
|
12
|
+
collection and `#tags`; the category in brackets; the text; the source (`manual` is the
|
|
13
13
|
user's own capture); and the item's link title and other cells beneath. Snoozed items
|
|
14
14
|
are listed apart and are not proposed. If it says the icebox is empty, say so and stop.
|
|
15
15
|
2. **Sort what is unsorted.** For each item whose kind has a `?`, pick its kind from
|
|
@@ -114,8 +114,8 @@ Maintain `00-explore.md` with:
|
|
|
114
114
|
findings (one line each, with its link) as a multi-select question: "Add any of these
|
|
115
115
|
to the icebox?". Add only the ones the user ticks: for each, write its line and link
|
|
116
116
|
to a new temporary file outside the project with the file tool, then run
|
|
117
|
-
`kaizen icebox add --file <path> --kind finding` (add `--
|
|
118
|
-
names
|
|
117
|
+
`kaizen icebox add --file <path> --kind finding` (add `--collection <name>` when the run
|
|
118
|
+
names one). Nothing ticked, nothing added; never add without the question, and
|
|
119
119
|
never put the finding's text on the command line.
|
|
120
120
|
|
|
121
121
|
When the material questions are resolved or explicitly deferred, show the short
|
|
@@ -38,8 +38,8 @@ anything.
|
|
|
38
38
|
| `/kaizen backlog` | Print open backlog items across all runs, grouped by source run, rescued items last under `Orphaned` |
|
|
39
39
|
| `/kaizen gather` | Read request sources kaizen cannot read by itself; their requests land in the icebox, nothing starts |
|
|
40
40
|
| `/kaizen discover` | Group what is in the icebox and promote the tasks you pick; nothing starts |
|
|
41
|
-
| `kaizen icebox add [--file <f>] [--kind client\|finding\|people] [--
|
|
42
|
-
| `kaizen icebox edit\|kind\|tag\|
|
|
41
|
+
| `kaizen icebox add [--file <f>] [--kind client\|finding\|people] [--collection <c> \| --client <name>] [--tag <t>]` | "Put this in the icebox": a note, link or file, text from the file or stdin (never a shell word); a link's title is read |
|
|
42
|
+
| `kaizen icebox edit\|kind\|tag\|collection\|snooze\|unsnooze <ids> ...`, `kaizen icebox collections` | Reword an item, set its kind, tags or collection, hide it until `1d`/`1w`/`1m`/a date; list or add boards |
|
|
43
43
|
| `/kaizen docs [lint]` | Write or refresh the project's docs vault in the notebook, which agents read first; `lint` only reports what is stale, broken or uncovered |
|
|
44
44
|
| `kaizen automation list\|add\|run <id>\|pause <id>\|resume <id>\|rm <id>\|runs <id>` | Schedules that start an unattended auto-mode run in this project (hourly, daily, weekdays, weekly or cron; optional precheck). Fires only while a board runs |
|
|
45
45
|
| `kaizen worker init\|start <wid>\|status\|config\|merge\|set <run> on\|off` | Orchestration (off by default): split a run into workers, each in its own board terminal and folder. `kaizen worker report` is for the workers themselves |
|
package/web/board/icebox.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { termStop } from "./agent-term.ts";
|
|
|
3
3
|
import { load, post } from "./api.ts";
|
|
4
4
|
import { via } from "./cards.ts";
|
|
5
5
|
import { mic, stopDictation } from "./dictation.ts";
|
|
6
|
-
import { $, dataUrls, html, ico, motion, pageOf, pager, pagerHtml, raw, SKEL, wirePager } from "./dom.ts";
|
|
6
|
+
import { $, dataUrls, html, ico, modal, motion, pageOf, pager, pagerHtml, raw, SKEL, wirePager } from "./dom.ts";
|
|
7
7
|
import { plogo, setShown, short, showable } from "./projects.ts";
|
|
8
8
|
import { playSound, soundPick, toast } from "./toast.ts";
|
|
9
9
|
import { go, view } from "./views.ts";
|
|
@@ -88,7 +88,26 @@ function wireOnce() {
|
|
|
88
88
|
if (view === "sources" && srcOpen()) openSources();
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
|
-
// A
|
|
91
|
+
// A new collection: its name and whether it is a client's, asked in the board's own dialog
|
|
92
|
+
// (the desktop app has no window.prompt). Resolves null when cancelled.
|
|
93
|
+
function askCollection(where = ""): Promise<{ name: string; client: boolean } | null> {
|
|
94
|
+
return new Promise((done) => {
|
|
95
|
+
const dl = modal(html`<label class="hint" for="ice-cn" style="margin:0">New collection${where ? ` in ${where}` : ""}: a client or a topic</label><input class="sel" id="ice-cn" maxlength="40" placeholder="e.g. Arupadatu, Pricing" autocomplete="off" spellcheck="false"><label class="ice-cn-cl"><input type="checkbox" id="ice-cn-c"> A client — its items count as Client</label><div class="row"><button type="button" class="btn ghost" value="">Cancel</button><button class="btn pri">Create</button></div>`);
|
|
96
|
+
const f = dl.querySelector("form"), inp = dl.querySelector("#ice-cn") as HTMLInputElement;
|
|
97
|
+
let answer = null;
|
|
98
|
+
dl.querySelector(".btn.ghost").onclick = () => dl.close();
|
|
99
|
+
f.onsubmit = (e) => {
|
|
100
|
+
e.preventDefault();
|
|
101
|
+
const name = inp.value.trim();
|
|
102
|
+
if (!name) return inp.focus();
|
|
103
|
+
answer = { name, client: (dl.querySelector("#ice-cn-c") as HTMLInputElement).checked };
|
|
104
|
+
dl.close();
|
|
105
|
+
};
|
|
106
|
+
dl.addEventListener("close", () => done(answer));
|
|
107
|
+
inp.focus();
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
// A person mark for a client's collection.
|
|
92
111
|
const PERSON = raw(
|
|
93
112
|
'<svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="5.2" r="2.6" fill="none" stroke="currentColor" stroke-width="1.5"/><path d="M3 13.6c.7-2.5 2.6-3.8 5-3.8s4.3 1.3 5 3.8" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/></svg>',
|
|
94
113
|
);
|
|
@@ -264,7 +283,7 @@ export async function openSources() {
|
|
|
264
283
|
// left out of the list, the count and Swipe until its date (the server says `asleep`).
|
|
265
284
|
awake = ((d && d.icebox) || []).filter((it) => !it.asleep),
|
|
266
285
|
ice = [...awake, ...((d && d.dismissed) || [])],
|
|
267
|
-
waiting = awake.length,
|
|
286
|
+
waiting = awake.filter((it) => it.status === "new").length,
|
|
268
287
|
G = (d && d.gatherer) || {},
|
|
269
288
|
chatOn = G.use === "chatgpt" && G.connected;
|
|
270
289
|
// A source belongs to one project, named on its row. Picking another only arms Move: a select
|
|
@@ -314,7 +333,9 @@ export async function openSources() {
|
|
|
314
333
|
? "Dismissed"
|
|
315
334
|
: it.status === "done"
|
|
316
335
|
? "Done"
|
|
317
|
-
: it.
|
|
336
|
+
: it.status === "promoted"
|
|
337
|
+
? "Promoted"
|
|
338
|
+
: it.category || srcOf(it)?.category || platOf(srcOf(it) || { url: it.source }),
|
|
318
339
|
count = (xs, f) => {
|
|
319
340
|
const m = new Map();
|
|
320
341
|
xs.forEach((it) => {
|
|
@@ -352,7 +373,7 @@ export async function openSources() {
|
|
|
352
373
|
.map((_, i) => i)
|
|
353
374
|
.filter((i) => {
|
|
354
375
|
const it = ice[i];
|
|
355
|
-
return inProj(it) && onBoard(it) && ofKind(it) && (iceCat ? catOf(it) === iceCat : it.status
|
|
376
|
+
return inProj(it) && onBoard(it) && ofKind(it) && (iceCat ? catOf(it) === iceCat : it.status === "new") && (!iceSrc || srcKey(it) === iceSrc);
|
|
356
377
|
})
|
|
357
378
|
.sort((a, b) => (Date.parse(ice[b].at) || 0) - (Date.parse(ice[a].at) || 0));
|
|
358
379
|
// Only the page: j and k, select-all and bulk actions stay on what shows.
|
|
@@ -382,8 +403,8 @@ export async function openSources() {
|
|
|
382
403
|
const srcIco = (it) => fav(it.source, "link", srcOf(it)?.social);
|
|
383
404
|
const curSrc = iceSrc && [...bySrc].find(([k]) => k === iceSrc)?.[1].it;
|
|
384
405
|
const chips = html`${
|
|
385
|
-
// Dismissed and Done are hidden until picked, so even a lone one is a choice.
|
|
386
|
-
byCat.size > 1 || byCat.has("Dismissed") || byCat.has("Done")
|
|
406
|
+
// Promoted, Dismissed and Done are hidden until picked, so even a lone one is a choice.
|
|
407
|
+
byCat.size > 1 || byCat.has("Dismissed") || byCat.has("Done") || byCat.has("Promoted")
|
|
387
408
|
? pick(
|
|
388
409
|
"ice-fc",
|
|
389
410
|
"Category",
|
|
@@ -407,8 +428,8 @@ export async function openSources() {
|
|
|
407
428
|
cardsOn = iceView === "cards" && !narrow;
|
|
408
429
|
// The boards bar: All, each board with what waits on it, + Board; the kind filters on the right.
|
|
409
430
|
const nOn = (b) => pv.filter((it) => isWaiting(it) && sameName(it.board, b.name)).length;
|
|
410
|
-
const boardsBar = html`<div class="ice-boards"><div class="ice-chips" role="group" aria-label="
|
|
411
|
-
const bar = html`<div class="tk-bar ice-bar">${!cardsOn && !narrow && order.length ? html`<input type="checkbox" id="ice-all" aria-label="Select every request shown"${nSel && nSel === order.length ? " checked" : ""}>` : ""}${narrow ? "" : html`<div class="ice-view" role="group" aria-label="View"><button data-view="cards" aria-pressed="${String(cardsOn)}">Cards</button><button data-view="sort" aria-pressed="${String(!cardsOn)}">Sort</button></div>`}<span class="count">${iceCat === "Dismissed" || iceCat === "Done" ? `${order.length} ${iceCat.toLowerCase()}` : `${order.length < waiting ? `${order.length} of ${waiting}` : waiting} waiting`}</span><span class="end"></span>${String(chips) ? html`<details class="ice-filt"><summary class="ib${iceCat || iceSrc ? " on" : ""}" aria-label="Filter requests" title="Filter by category or source">${ico("filter")}</summary><div class="ice-fpop">${chips}</div></details>` : ""}${order.some((i) => isWaiting(ice[i])) ? html`<button class="btn ghost sm" id="ice-sw" title="Sort one at a time: swipe right to promote, left to dismiss"><span aria-hidden="true">⇆</span> Swipe</button>` : ""}${narrow ? "" : html`<button class="btn sm" id="src-tog" aria-expanded="${String(!!srcShow)}" aria-controls="src-sec" title="Sources, and Gather all">${ico("link")} Sources · ${list.length}</button>`}</div>`;
|
|
431
|
+
const boardsBar = html`<div class="ice-boards"><div class="ice-chips" role="group" aria-label="Collections"><button class="ice-chip${iceBoard ? "" : " on"}" data-bd="" aria-pressed="${String(!iceBoard)}">All</button>${boards.map((b) => html`<button class="ice-chip${sameName(iceBoard, b.name) ? " on" : ""}" data-bd="${b.name}" aria-pressed="${String(sameName(iceBoard, b.name))}"${b.client ? raw(' title="A client\'s collection: its items are Client"') : ""}>${b.client ? PERSON : ""}<span>${b.name}</span><i>${nOn(b)}</i></button>`)}<button class="ice-chip add" id="ice-nb" title="Make a collection for a client or a topic">${ico("plus")}Collection</button></div><div class="ice-chips" role="group" aria-label="Kinds">${Object.entries(KIND).map(([k, l]) => html`<button class="ice-chip k-${k}${iceKinds.has(k) ? " on" : ""}" data-kf="${k}" aria-pressed="${String(iceKinds.has(k))}">${l}</button>`)}</div></div>`;
|
|
432
|
+
const bar = html`<div class="tk-bar ice-bar">${!cardsOn && !narrow && order.length ? html`<input type="checkbox" id="ice-all" aria-label="Select every request shown"${nSel && nSel === order.length ? " checked" : ""}>` : ""}${narrow ? "" : html`<div class="ice-view" role="group" aria-label="View"><button data-view="cards" aria-pressed="${String(cardsOn)}">Cards</button><button data-view="sort" aria-pressed="${String(!cardsOn)}">Sort</button></div>`}<span class="count">${iceCat === "Dismissed" || iceCat === "Done" || iceCat === "Promoted" ? `${order.length} ${iceCat.toLowerCase()}` : `${order.length < waiting ? `${order.length} of ${waiting}` : waiting} waiting`}</span><span class="end"></span>${String(chips) ? html`<details class="ice-filt"><summary class="ib${iceCat || iceSrc ? " on" : ""}" aria-label="Filter requests" title="Filter by category or source">${ico("filter")}</summary><div class="ice-fpop">${chips}</div></details>` : ""}${order.some((i) => isWaiting(ice[i])) ? html`<button class="btn ghost sm" id="ice-sw" title="Sort one at a time: swipe right to promote, left to dismiss"><span aria-hidden="true">⇆</span> Swipe</button>` : ""}${narrow ? "" : html`<button class="btn sm" id="src-tog" aria-expanded="${String(!!srcShow)}" aria-controls="src-sec" title="Sources, and Gather all">${ico("link")} Sources · ${list.length}</button>`}</div>`;
|
|
412
433
|
// The capture box: what is typed, pasted, attached or dictated lands in the icebox on the picked
|
|
413
434
|
// board. In All projects it names the project, as the Add pop-up did. Field and mic are slotted in.
|
|
414
435
|
const capPs = dir ? [] : showable();
|
|
@@ -420,7 +441,7 @@ export async function openSources() {
|
|
|
420
441
|
const capTo = capTo0,
|
|
421
442
|
capP = capPs.find((p) => p.dir === cap.dir);
|
|
422
443
|
const capBoards = ((d && d.boards) || []).filter((b) => b.dir === capTo);
|
|
423
|
-
const capBox = html`<div class="ice-cap" id="ice-cap"><span id="ice-cap-slot"></span>${cap.files.length ? html`<div class="ice-att">${cap.files.map((f, n) => html`<span class="ice-file">${ico("clip")}<span>${f.name}</span><button type="button" class="ib sm" data-rf="${n}" aria-label="Remove ${f.name}" title="Remove">${ico("x")}</button></span>`)}</div>` : ""}<div class="ice-cap-row"><button type="button" class="ib" id="ice-pick" aria-label="Attach files" title="Attach files">${ico("clip")}</button><span id="ice-mic-slot"></span><input type="file" id="ice-file" multiple hidden>${dir ? "" : pick("ice-cp", "Project", capP ? html`${plogo(capP.dir, capP.label)}<span>${short(capP.label)}</span>` : html`<span>Choose project</span>`, html`${capPs.map((p) => opt(p.dir, p.dir === cap.dir, html`${plogo(p.dir, p.label)}<span>${p.label}</span>`, p.label))}`)}${pick("ice-cb", "
|
|
444
|
+
const capBox = html`<div class="ice-cap" id="ice-cap"><span id="ice-cap-slot"></span>${cap.files.length ? html`<div class="ice-att">${cap.files.map((f, n) => html`<span class="ice-file">${ico("clip")}<span>${f.name}</span><button type="button" class="ib sm" data-rf="${n}" aria-label="Remove ${f.name}" title="Remove">${ico("x")}</button></span>`)}</div>` : ""}<div class="ice-cap-row"><button type="button" class="ib" id="ice-pick" aria-label="Attach files" title="Attach files">${ico("clip")}</button><span id="ice-mic-slot"></span><input type="file" id="ice-file" multiple hidden>${dir ? "" : pick("ice-cp", "Project", capP ? html`${plogo(capP.dir, capP.label)}<span>${short(capP.label)}</span>` : html`<span>Choose project</span>`, html`${capPs.map((p) => opt(p.dir, p.dir === cap.dir, html`${plogo(p.dir, p.label)}<span>${p.label}</span>`, p.label))}`)}${pick("ice-cb", "Collection", html`<span>${cap.board || "Inbox"}</span>`, html`${opt("", !cap.board, html`<span>Inbox</span>`, "inbox")}${capBoards.map((b) => opt(b.name, sameName(cap.board, b.name), html`${b.client ? PERSON : ""}<span>${b.name}</span>`, b.name))}${cap.board && !capBoards.some((b) => sameName(b.name, cap.board)) ? opt(cap.board, true, html`<span>${cap.board}</span><i>new</i>`, cap.board) : ""}${opt("\n", false, html`${ico("plus")}<span>New collection…</span>`, "new collection")}`)}<span class="end"></span><button type="button" class="btn pri sm" id="ice-save" aria-label="Save to the icebox"${cap.busy ? " disabled" : ""}>${ico("send")}<span>${cap.busy ? "Saving…" : "Save ↵"}</span></button></div></div>`;
|
|
424
445
|
const bulk = iceSel.size
|
|
425
446
|
? html`<div class="ice-bulk" role="toolbar" aria-label="Selected requests"><span>${iceSel.size} selected</span><span class="end"></span><button class="btn sm" id="ice-bp" title="Promote (p)">${ico("plus")} Promote</button><button class="btn ghost sm" id="ice-bz" title="Snooze a week (h)">${ico("clock")} Snooze</button><button class="btn ghost sm" id="ice-bd" title="Dismiss (d)">${ico("x")} Dismiss</button><button class="btn ghost sm" id="ice-bc" title="Clear selection (Esc)">Clear</button></div>`
|
|
426
447
|
: "";
|
|
@@ -465,8 +486,8 @@ export async function openSources() {
|
|
|
465
486
|
? html`${b("data-sz", "1d", "Tomorrow")}${b("data-sz", "1w", "Next week")}${b("data-sz", "1m", "Next month")}<div class="ice-date"><input type="date" class="sel" id="ice-sd" min="${day(1)}" max="${day(365)}" aria-label="Snooze until"><button type="button" class="btn sm" data-sz="">Snooze</button></div>`
|
|
466
487
|
: m === "kind"
|
|
467
488
|
? html`${Object.entries(KIND).map(([v, l]) => b("data-kd", v, l, it.kind === v && it.sorted !== "rules"))}`
|
|
468
|
-
: html`${b("data-bo", "", "Inbox", !it.board)}${((d && d.boards) || []).filter((x) => x.dir === it.dir).map((x) => b("data-bo", x.name, html`${x.client ? PERSON : ""}${x.name}`, sameName(it.board, x.name)))}<button type="button" role="menuitem" data-bo-new="1">${ico("plus")}New
|
|
469
|
-
return html`<div class="menu-pop ice-mpop" role="menu" data-mi="${i}" aria-label="${m === "snooze" ? "Snooze until" : m === "kind" ? "Kind" : "
|
|
489
|
+
: html`${b("data-bo", "", "Inbox", !it.board)}${((d && d.boards) || []).filter((x) => x.dir === it.dir).map((x) => b("data-bo", x.name, html`${x.client ? PERSON : ""}${x.name}`, sameName(it.board, x.name)))}<button type="button" role="menuitem" data-bo-new="1">${ico("plus")}New collection…</button>`;
|
|
490
|
+
return html`<div class="menu-pop ice-mpop" role="menu" data-mi="${i}" aria-label="${m === "snooze" ? "Snooze until" : m === "kind" ? "Kind" : "Collection"}">${inner}</div>`;
|
|
470
491
|
};
|
|
471
492
|
const badges = (it) =>
|
|
472
493
|
html`${it.status === "done" && it.written ? html`<span title="Written back ${ago(it.written)}">written back</span>` : ""}${it.status === "done" && it.writeError ? html`<span title="${it.writeError}">write-back failed</span>` : ""}${it.status === "promoted" ? html`<span title="Promoted to Tasks: ${it.idea || ""}">promoted</span>` : ""}${it.replied ? html`<span title="Replied ${ago(it.replied)}">replied</span>` : ""}`;
|
|
@@ -475,7 +496,7 @@ export async function openSources() {
|
|
|
475
496
|
const it = ice[i],
|
|
476
497
|
k = iceKey(it),
|
|
477
498
|
open = iceForm === k;
|
|
478
|
-
const head = html`<div class="ice-row${iceCur === k ? " cur" : ""}${iceSel.has(k) ? " sel" : ""}" data-i="${i}" data-k="${k}"><input type="checkbox" id="ice-ck-${i}" data-ck="${i}"${iceSel.has(k) ? " checked" : ""} aria-label="Select: ${it.text}">${live(it) ? menuBtn(i, it, "kind", kindOf(it), "ice-kb", "Kind") : kindOf(it)}<span class="ice-src" title="${srcName(it)}">${fav(it.source, "link", srcOf(it)?.social)}</span><button class="ice-t" id="ice-o-${i}" data-o="${i}" aria-expanded="${String(open)}" title="${it.text}">${it.text}</button><span class="ice-meta">${proj(it)}${badges(it)}${live(it) ? menuBtn(i, it, "board", it.board || "Inbox", "ice-bo" + (it.board ? "" : " none"), "
|
|
499
|
+
const head = html`<div class="ice-row${iceCur === k ? " cur" : ""}${iceSel.has(k) ? " sel" : ""}" data-i="${i}" data-k="${k}"><input type="checkbox" id="ice-ck-${i}" data-ck="${i}"${iceSel.has(k) ? " checked" : ""} aria-label="Select: ${it.text}">${live(it) ? menuBtn(i, it, "kind", kindOf(it), "ice-kb", "Kind") : kindOf(it)}<span class="ice-src" title="${srcName(it)}">${fav(it.source, "link", srcOf(it)?.social)}</span><button class="ice-t" id="ice-o-${i}" data-o="${i}" aria-expanded="${String(open)}" title="${it.text}">${it.text}</button><span class="ice-meta">${proj(it)}${badges(it)}${live(it) ? menuBtn(i, it, "board", it.board || "Inbox", "ice-bo" + (it.board ? "" : " none"), "Collection") : it.board ? html`<span>${it.board}</span>` : ""}<span class="ice-age">${ago(it.at)}</span><span class="ice-ra">${it.status === "promoted" || it.status === "done" ? "" : html`<button class="btn ghost sm" id="ice-pr-${i}" data-pr="${i}" title="Promote to Tasks (p)" aria-label="Promote to Tasks: ${it.text}">${ico("plus")}</button>`}${live(it) ? menuBtn(i, it, "snooze", ico("clock"), "btn ghost sm", "Snooze (h: a week)") : ""}${it.status === "promoted" || it.status === "done" ? "" : it.status === "dismissed" ? html`<button class="btn ghost sm" id="ice-rs-${i}" data-rs="${i}" title="Restore to waiting" aria-label="Restore: ${it.text}">Restore</button>` : html`<button class="btn ghost sm" id="ice-ds-${i}" data-ds="${i}" title="Dismiss (d)" aria-label="Dismiss: ${it.text}">${ico("x")}</button>`}</span></span>${menu(i, it)}</div>`;
|
|
479
500
|
const more = open
|
|
480
501
|
? html`<div class="ice-open">${it.notes ? html`<div class="ice-notes">${it.notes}</div>` : ""}${imgs(it)}<span class="hint" style="margin:0">From ${srcName(it)} · ${ago(it.at)}${it.post ? html` · <a href="${web(it.post)}" target="_blank" rel="noopener">open post</a>` : ""}</span>${replyBox(it)}${icePro === k ? form(it) : ""}</div>`
|
|
481
502
|
: "";
|
|
@@ -502,7 +523,7 @@ export async function openSources() {
|
|
|
502
523
|
const head = html`<div class="ice-row ice-prow${iceCur === k ? " cur" : ""}" data-i="${i}" data-k="${k}"${live(it) ? raw(' data-swipe="1"') : ""}><div class="ice-pbg" aria-hidden="true"><span class="pro">${ico("check")}Task</span><span class="dis">Dismiss${ico("x")}</span></div><div class="ice-pf"><div class="ice-pm"><div class="ice-ph">${live(it) ? menuBtn(i, it, "kind", kindOf(it), "ice-kb", "Kind") : kindOf(it)}${it.sorted === "rules" && live(it) ? html`<span class="ice-uns">unsorted</span>` : ""}<span class="ice-meta">${badges(it)}</span></div><button class="ice-t" id="ice-o-${i}" data-o="${i}" aria-expanded="${String(open)}">${it.text}</button><span class="ice-pmeta">${proj(it)}${it.board ? html`<span>${it.board}</span>` : ""}<span>${ago(it.at)}</span></span></div>${thumb(it)}${done ? "" : it.status === "dismissed" ? html`<button class="btn ghost sm" id="ice-rs-${i}" data-rs="${i}" aria-label="Restore: ${it.text}">Restore</button>` : html`<button class="ib ice-ptask" id="ice-pr-${i}" data-pr="${i}" aria-label="Make a task: ${it.text}" title="Make a task">${ico("arrow")}</button>`}</div>${menu(i, it)}</div>`;
|
|
503
524
|
// Opened, a phone row also offers what its gestures do, for anyone who cannot swipe or hold.
|
|
504
525
|
const acts = live(it)
|
|
505
|
-
? html`<div class="ice-form-acts ice-pacts">${menuBtn(i, it, "snooze", html`${ico("clock")}Snooze`, "btn ghost sm", "Snooze")}${menuBtn(i, it, "board", html
|
|
526
|
+
? html`<div class="ice-form-acts ice-pacts">${menuBtn(i, it, "snooze", html`${ico("clock")}Snooze`, "btn ghost sm", "Snooze")}${menuBtn(i, it, "board", html`${it.board || "Inbox"}`, "btn ghost sm", "Collection")}<span class="end"></span><button class="btn ghost sm" id="ice-ds-${i}" data-ds="${i}" aria-label="Dismiss: ${it.text}">${ico("x")}Dismiss</button></div>`
|
|
506
527
|
: "";
|
|
507
528
|
const more = open
|
|
508
529
|
? html`<div class="ice-open">${it.notes ? html`<div class="ice-notes">${it.notes}</div>` : ""}${imgs(it)}<span class="hint" style="margin:0">From ${srcName(it)} · ${ago(it.at)}${it.post ? html` · <a href="${web(it.post)}" target="_blank" rel="noopener">open post</a>` : ""}</span>${acts}${replyBox(it)}${icePro === k ? form(it) : ""}</div>`
|
|
@@ -516,7 +537,7 @@ export async function openSources() {
|
|
|
516
537
|
k = iceKey(it),
|
|
517
538
|
lk = it.link && /^https?:\/\//i.test(it.link.url) ? it.link : null,
|
|
518
539
|
site = lk ? host(lk.url).replace(/^www\./, "") : "";
|
|
519
|
-
const acts = html`${it.status === "promoted" || it.status === "done" ? "" : html`<button class="btn ghost sm" id="ice-pr-${i}" data-pr="${i}" title="Promote to Tasks (p)" aria-label="Promote to Tasks: ${it.text}">${ico("arrow")}Task</button>`}${live(it) ? html`${menuBtn(i, it, "snooze", html`${ico("clock")}Snooze`, "btn ghost sm", "Snooze")}${menuBtn(i, it, "kind", "Kind", "btn ghost sm", "Kind")}${menuBtn(i, it, "board", "
|
|
540
|
+
const acts = html`${it.status === "promoted" || it.status === "done" ? "" : html`<button class="btn ghost sm" id="ice-pr-${i}" data-pr="${i}" title="Promote to Tasks (p)" aria-label="Promote to Tasks: ${it.text}">${ico("arrow")}Task</button>`}${live(it) ? html`${menuBtn(i, it, "snooze", html`${ico("clock")}Snooze`, "btn ghost sm", "Snooze")}${menuBtn(i, it, "kind", "Kind", "btn ghost sm", "Kind")}${menuBtn(i, it, "board", "Collection", "btn ghost sm", "Collection")}` : ""}<span class="end"></span>${it.status === "promoted" || it.status === "done" ? "" : it.status === "dismissed" ? html`<button class="btn ghost sm" id="ice-rs-${i}" data-rs="${i}" title="Restore to waiting" aria-label="Restore: ${it.text}">Restore</button>` : html`<button class="btn ghost sm" id="ice-ds-${i}" data-ds="${i}" title="Dismiss (d)" aria-label="Dismiss: ${it.text}">${ico("x")}</button>`}`;
|
|
520
541
|
return html`<article class="ice-card${iceCur === k ? " cur" : ""}" data-i="${i}" data-k="${k}">${lk ? html`<a class="ice-lk" href="${web(lk.url)}" target="_blank" rel="noopener noreferrer" style="--h:${hue(site)}"><b>${lk.title || site}</b>${lk.summary ? html`<span>${lk.summary}</span>` : ""}<small>${site}</small></a>` : ""}<div class="ice-cb"><div class="ice-ch">${kindOf(it)}${it.sorted === "rules" && live(it) ? html`<span class="ice-uns" title="Kind set by a rule: pick one with Kind">unsorted</span>` : ""}<span class="ice-meta">${badges(it)}</span></div><button class="ice-ct" id="ice-o-${i}" data-o="${i}" title="Open in the Sort list">${it.text}</button>${imgs(it, true)}<div class="ice-cf">${it.board ? html`<span class="ice-cbd">${it.board}</span>` : ""}${(it.tags || []).map((t) => html`<span class="ice-tag">#${t}</span>`)}${proj(it)}<span class="end"></span><span class="ice-when">${it.source !== "manual" ? `${srcName(it)} · ` : ""}${ago(it.at)}</span></div></div><div class="ice-ca">${acts}</div>${menu(i, it)}</article>`;
|
|
521
542
|
};
|
|
522
543
|
const inbox =
|
|
@@ -682,12 +703,12 @@ export async function openSources() {
|
|
|
682
703
|
cap.dir = v;
|
|
683
704
|
openSources().then(() => cap.ta.focus());
|
|
684
705
|
});
|
|
685
|
-
wirePick("ice-cb", (v) => {
|
|
706
|
+
wirePick("ice-cb", async (v) => {
|
|
686
707
|
if (v === "\n") {
|
|
687
|
-
const
|
|
688
|
-
if (!
|
|
689
|
-
if (
|
|
690
|
-
v =
|
|
708
|
+
const a = await askCollection();
|
|
709
|
+
if (!a) return cap.ta.focus();
|
|
710
|
+
if (a.client) await post("/icebox", { op: "boards", act: "add", dir: dir || cap.dir, name: a.name, client: true });
|
|
711
|
+
v = a.name;
|
|
691
712
|
}
|
|
692
713
|
cap.board = v;
|
|
693
714
|
cap.boardDir = dir || cap.dir;
|
|
@@ -733,17 +754,17 @@ export async function openSources() {
|
|
|
733
754
|
} catch (e) {}
|
|
734
755
|
openSources();
|
|
735
756
|
}));
|
|
736
|
-
// +
|
|
757
|
+
// + Collection: a name, and whether it is a client's (its items then count as Client).
|
|
737
758
|
if ($("ice-nb"))
|
|
738
759
|
$("ice-nb").onclick = async () => {
|
|
739
760
|
const to = dir || cap.dir;
|
|
740
761
|
if (!to) return toast("Pick a project first");
|
|
741
|
-
const
|
|
742
|
-
if (!
|
|
743
|
-
const
|
|
762
|
+
const a = await askCollection(dir ? "" : capP?.label || "this project");
|
|
763
|
+
if (!a) return;
|
|
764
|
+
const { name, client } = a;
|
|
744
765
|
const j = await post("/icebox", { op: "boards", act: "add", dir: to, name, client });
|
|
745
766
|
if (j.ok) {
|
|
746
|
-
toast(`
|
|
767
|
+
toast(`Collection ${name} made`);
|
|
747
768
|
load();
|
|
748
769
|
}
|
|
749
770
|
if (srcOpen()) openSources();
|
|
@@ -1073,9 +1094,12 @@ export async function openSources() {
|
|
|
1073
1094
|
}));
|
|
1074
1095
|
pp.querySelectorAll("[data-kd]").forEach((b) => (b.onclick = () => setOne(it, { op: "kind", kind: b.dataset.kd }, `Kind: ${KIND[b.dataset.kd]}`)));
|
|
1075
1096
|
pp.querySelectorAll("[data-bo]").forEach((b) => (b.onclick = () => setOne(it, { op: "board", board: b.dataset.bo }, b.dataset.bo ? `Moved to ${b.dataset.bo}` : "Moved to the Inbox")));
|
|
1076
|
-
pp.querySelectorAll("[data-bo-new]").forEach((b) => (b.onclick = () => {
|
|
1077
|
-
|
|
1078
|
-
|
|
1097
|
+
pp.querySelectorAll("[data-bo-new]").forEach((b) => (b.onclick = async () => {
|
|
1098
|
+
iceMenu = "";
|
|
1099
|
+
const a = await askCollection();
|
|
1100
|
+
if (!a) return;
|
|
1101
|
+
if (a.client) await post("/icebox", { op: "boards", act: "add", dir: it.dir, name: a.name, client: true });
|
|
1102
|
+
setOne(it, { op: "board", board: a.name }, `Moved to ${a.name}`);
|
|
1079
1103
|
}));
|
|
1080
1104
|
});
|
|
1081
1105
|
// Bulk: one dismiss per project; promote one request at a time, each its own task
|
package/web/board.html
CHANGED
|
@@ -1043,6 +1043,8 @@ body:not(.paged) .src-sec,body:not(.paged) .src-scrim{display:none}
|
|
|
1043
1043
|
@media(prefers-reduced-motion:reduce){.ice-pf{transition:none}}
|
|
1044
1044
|
/* Save's send icon shows only on a phone, where the button is a round icon. */
|
|
1045
1045
|
#ice-save svg{display:none}
|
|
1046
|
+
/* The new-collection dialog (askCollection in web/board/icebox.ts). */
|
|
1047
|
+
dialog.kz #ice-cn{width:100%;box-sizing:border-box;margin:6px 0 10px}dialog.kz .ice-cn-cl{display:flex;align-items:center;justify-content:flex-start;gap:8px;font-size:13px;color:var(--dim);margin:0 0 12px;cursor:pointer;text-align:left}dialog.kz #ice-cn-c{width:16px;height:16px;flex:none;margin:0}
|
|
1046
1048
|
#ice-td{display:inline-flex;align-items:center;gap:6px}#ice-td svg{width:14px;height:14px}.ice-tdraft{font-size:12px}
|
|
1047
1049
|
/* The phone Icebox, tidy (2026-11-09-phone-icebox-tab-off): one capture row, one chip row, light rows. */
|
|
1048
1050
|
@media(max-width:640px){
|