kaizen-agent 1.63.0 → 1.64.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/README.md +10 -10
- package/agents/kaizen-planner.md +2 -2
- package/cli/backlog.test.ts +1 -1
- package/cli/board.test.ts +24 -24
- package/cli/dashboard.ts +15 -15
- package/cli/handoff.test.ts +133 -0
- package/cli/handoff.ts +122 -0
- package/cli/install.ts +31 -5
- package/cli/notes.test.ts +3 -3
- package/cli/notes.ts +1 -1
- package/cli/pty.ts +16 -2
- package/cli/resources.test.ts +50 -0
- package/cli/resources.ts +113 -0
- package/cli/restart.test.ts +28 -1
- package/cli/settings.ts +8 -5
- package/cli/sources.test.ts +32 -32
- package/cli/sources.ts +15 -15
- package/cli/state.test.ts +74 -51
- package/cli/state.ts +77 -49
- package/cli/usage.test.ts +11 -0
- package/cli/web.ts +139 -38
- package/cli/workers.ts +11 -4
- package/cli/worktree.test.ts +174 -1
- package/cli/worktree.ts +190 -35
- package/commands/kaizen-discover.md +1 -1
- package/package.json +1 -1
- package/skills/kaizen/README.md +2 -2
- package/skills/kaizen/SKILL.md +2 -2
- package/skills/kaizen/config.default.yml +32 -22
- package/skills/kaizen/discover.md +8 -8
- package/skills/kaizen/gather.md +2 -2
- package/skills/kaizen/settings.md +3 -0
- package/skills/kaizen/spec-build.md +13 -0
- package/skills/kaizen/spec-main.md +13 -0
- package/skills/kaizen/spec-plan.md +1 -1
- package/skills/kaizen/spec.md +1 -1
- package/skills/kaizen-help/SKILL.md +2 -2
- package/web/board/api.ts +10 -10
- package/web/board/cards.ts +47 -46
- package/web/board/git.ts +4 -4
- package/web/board/icebox.ts +14 -14
- package/web/board/keys.ts +3 -3
- package/web/board/labels.ts +2 -2
- package/web/board/live.ts +3 -3
- package/web/board/main.ts +1 -1
- package/web/board/markdown.ts +1 -1
- package/web/board/panel.ts +17 -17
- package/web/board/phone.ts +10 -12
- package/web/board/projects.ts +6 -6
- package/web/board/resources.ts +152 -0
- package/web/board/run-view.ts +5 -5
- package/web/board/search.ts +11 -11
- package/web/board/settings-cleanup.ts +42 -0
- package/web/board/settings-pages.ts +1 -1
- package/web/board/settings.ts +13 -0
- package/web/board/store.ts +1 -1
- package/web/board/{ideas.ts → tasks.ts} +22 -22
- package/web/board/terms.ts +3 -3
- package/web/board/views.ts +23 -12
- package/web/board/workspace.ts +9 -7
- package/web/board/ws-board-ui.ts +1 -1
- package/web/board/ws-board.test.ts +1 -1
- package/web/board/ws-board.ts +1 -1
- package/web/board/ws-tabs.test.ts +10 -2
- package/web/board/ws-tabs.ts +10 -9
- package/web/board.html +46 -34
- package/web/board.js +107 -97
- package/web/notebook.js +22 -22
- package/web/notebook.ts +5 -5
- package/web/notes-lib.ts +2 -2
- package/web/notes.html +12 -11
- package/web/term-font.test.ts +22 -0
- package/web/term-font.ts +30 -0
- package/web/term.js +38 -38
- package/web/term.ts +13 -2
- package/web/video.html +12 -11
- package/web/video.js +48 -48
|
@@ -55,6 +55,19 @@ code in the same folder. If `kaizen worktree start` fails, say why and stop; do
|
|
|
55
55
|
back to the project folder unasked. A run whose `state.json` has no `worktree` builds in
|
|
56
56
|
place, exactly as before.
|
|
57
57
|
|
|
58
|
+
**Hand the build to a second agent, when the run gets a worktree.** The agent the user is
|
|
59
|
+
talking to stays with them. Before `kaizen worktree start`, it writes into `02-approval.md`
|
|
60
|
+
every decision made in chat that the plan lacks: the second agent never sees the chat. After
|
|
61
|
+
it, it runs `kaizen handoff start <id>`. Exit 0: say the worktree agent is building, and end
|
|
62
|
+
the turn; the board types a one-line pointer into this terminal when that agent ends. Exit
|
|
63
|
+
3: no board terminal or none answered, so build here in the worktree as above. The second
|
|
64
|
+
agent reads the run's files, runs build, review and the fix loop in the worktree, under the
|
|
65
|
+
same rules (it is the coordinator if the plan has approved workers), and ends with
|
|
66
|
+
`kaizen handoff done` or `kaizen handoff blocked "<reason>"`. It never runs `kaizen done`
|
|
67
|
+
or `kaizen worktree land`. It takes no bypass from Orchestration. `runs/<id>/handoff.json`
|
|
68
|
+
is written only by these commands and the board. A worktree cut while the project is on a
|
|
69
|
+
branch other than the default is cut from that local branch and records `base_branch`.
|
|
70
|
+
|
|
58
71
|
**Workers, only when the run has them.** When `01-plan.md` has a `## Workers` section and
|
|
59
72
|
`02-approval.md` says `workers: approved`, the build agent is the coordinator. Run
|
|
60
73
|
`kaizen worker init`: if it refuses, say why in `03-impl.md` and build the whole plan
|
|
@@ -90,6 +90,19 @@ subagents at all.
|
|
|
90
90
|
|
|
91
91
|
---
|
|
92
92
|
|
|
93
|
+
## After a handoff
|
|
94
|
+
|
|
95
|
+
Woken by the line `kaizen run <id>: the worktree agent ended (...)`, or asked about the run,
|
|
96
|
+
read `state.json`, `handoff.json`, `03-impl.md` and `04-review.md`, whatever the line says:
|
|
97
|
+
it is a pointer, not a result. `done`: report what changed, the checks and open findings,
|
|
98
|
+
then take the final approval and land as usual; in `auto` carry on without stopping.
|
|
99
|
+
`blocked`, `failed` or `quiet`: say why and what is left, and keep the worktree. `quiet` means the second agent went silent and may still report; `kaizen handoff start <id>` opens a new one on the same worktree. A run with
|
|
100
|
+
`base_branch` lands by a local merge into that branch, with no push; if the project folder
|
|
101
|
+
is on another branch or the merge conflicts, `kaizen worktree land` says so and keeps the
|
|
102
|
+
|
|
103
|
+
Landing rebases the branch onto its base first, in every land path: a conflict only in `git.generated` paths takes the base's side and runs `git.rebuild_on_land`, any other conflict aborts and keeps the worktree, and a rebase that pulled commits runs `git.land_check`. A branch already pushed is replaced with `--force-with-lease`, on `kaizen/<id>` only. A failure is written to `runs/<id>/land.json` and cleared on success; the board shows it as `Conflict` or `Land failed` with a red `!`.
|
|
104
|
+
worktree, so tell the user.
|
|
105
|
+
|
|
93
106
|
## Preview gate
|
|
94
107
|
|
|
95
108
|
Before setting `stage: "review"` after a build, in either runner, open `03-impl.md` and
|
|
@@ -234,7 +234,7 @@ a case against it.
|
|
|
234
234
|
|
|
235
235
|
**Write the parts a person reads for a person.** Framing, the Work list, Goal, Scope,
|
|
236
236
|
Discovery, Foundation, Roadmap, Risks and Out of scope suggestions are read by someone deciding whether to approve,
|
|
237
|
-
often on a narrow panel. Write them in everyday words: short sentences, one
|
|
237
|
+
often on a narrow panel. Write them in everyday words: short sentences, one task per
|
|
238
238
|
bullet, things named by what the user sees ("the chat bubble", "the Plan tab") rather
|
|
239
239
|
than by function, file, CSS value or gate id. Code names, `path:line` and gate ids
|
|
240
240
|
belong in Reuse, the File manifest, Steps and Verification, where the builder and
|
package/skills/kaizen/spec.md
CHANGED
|
@@ -86,7 +86,7 @@ Record the track in `state.json` as `track`, with the three answers written into
|
|
|
86
86
|
Create the run id as `YYYY-MM-DD-<short-kebab-slug>`. Write the request verbatim —
|
|
87
87
|
do not summarize it, since later stages read this instead of the conversation and a
|
|
88
88
|
summary is where requirements quietly disappear. The board also finds a run's card by
|
|
89
|
-
this text: a request that does not contain the user's words leaves their
|
|
89
|
+
this text: a request that does not contain the user's words leaves their task as a
|
|
90
90
|
second card. Context you add goes below the verbatim text, never in place of it.
|
|
91
91
|
|
|
92
92
|
Verbatim includes the mess. Requests arrive as thinking out loud: half-formed,
|
|
@@ -31,7 +31,7 @@ anything.
|
|
|
31
31
|
| `kaizen done <id> [--user-approved]` | Finish a run; refused while the review gate waits on the user, `--user-approved` after a clear yes in chat |
|
|
32
32
|
| `/kaizen backlog` | Print open backlog items across all runs, grouped by source run, rescued items last under `Orphaned` |
|
|
33
33
|
| `/kaizen gather` | Read request sources kaizen cannot read by itself; their requests land in the icebox, nothing starts |
|
|
34
|
-
| `/kaizen discover` | Group what is in the icebox and promote the
|
|
34
|
+
| `/kaizen discover` | Group what is in the icebox and promote the tasks you pick; nothing starts |
|
|
35
35
|
| `/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 |
|
|
36
36
|
| `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 |
|
|
37
37
|
| `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 |
|
|
@@ -101,7 +101,7 @@ Each iteration is written to `runs/<id>/05-iterations/`.
|
|
|
101
101
|
| `git.auto_commit` | `false` | `true`: commit the run's changed files when it is done; never pushes |
|
|
102
102
|
| `subagents.model` | `inherit` | Model the stage subagents run on (opus/sonnet/haiku, Claude Code only) |
|
|
103
103
|
| `subagents.effort` | `inherit` | Reasoning effort for the stage subagents (low/medium/high, Claude Code only) |
|
|
104
|
-
| `sources.every` | `24h` | How often the web board checks request sources for new
|
|
104
|
+
| `sources.every` | `24h` | How often the web board checks request sources for new tasks (`off\|1h\|6h\|24h`) |
|
|
105
105
|
| `agent.default` | `auto` | Coding agent to launch from dashboard backlog |
|
|
106
106
|
| `agent.<cmd>.model`, `.effort` | — | Model/effort flags for the launched session, per tool (`claude`, `codex`, `agy`, `opencode`, `gemini`); model names are the tool's own |
|
|
107
107
|
|
package/web/board/api.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { store } from "./store.ts";
|
|
2
2
|
import { key, render } from "./cards.ts";
|
|
3
3
|
import { $, vt } from "./dom.ts";
|
|
4
|
-
import { close,
|
|
4
|
+
import { close, taskBody, open, openRun } from "./panel.ts";
|
|
5
5
|
import { notifyUser, toast } from "./toast.ts";
|
|
6
6
|
import { openTerms, termsShowing } from "./terms.ts";
|
|
7
7
|
import { refreshBoardBadge } from "./badge.ts";
|
|
@@ -110,7 +110,7 @@ async function read(quiet: boolean) {
|
|
|
110
110
|
store.flash.clear();
|
|
111
111
|
} else store.flash.clear(); // no redraw now: a flash at some later one would be stale
|
|
112
112
|
if (termsShowing()) openTerms();
|
|
113
|
-
// Run on
|
|
113
|
+
// Run on a task closed the panel: open the card on its agent once the board knows the session.
|
|
114
114
|
if (store.wantTerm && !store.openKey && !store.mode) {
|
|
115
115
|
const n = store.S.cards.find((x) => key(x) === store.wantTerm && x.pty);
|
|
116
116
|
if (n) {
|
|
@@ -129,20 +129,20 @@ async function read(quiet: boolean) {
|
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
131
|
if (store.runDoc && c.kind === "run") openRun(c, true, true);
|
|
132
|
-
else if (c.kind === "idea")
|
|
132
|
+
else if (c.kind === "idea") taskBody(c);
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
-
//
|
|
136
|
-
// offering "Run again": the newest run in its project whose request holds the
|
|
135
|
+
// A task's card goes when its run starts. Follow it to that run rather than keep
|
|
136
|
+
// offering "Run again": the newest run in its project whose request holds the task's
|
|
137
137
|
// text, the rule boardCards() retires it by. No such run: close the panel.
|
|
138
|
-
// ponytail: checks the five newest runs, one /run fetch each; a run that took the
|
|
138
|
+
// ponytail: checks the five newest runs, one /run fetch each; a run that took the task
|
|
139
139
|
// further back than that closes the panel instead.
|
|
140
|
-
async function follow(
|
|
141
|
-
const k = key(
|
|
140
|
+
async function follow(task) {
|
|
141
|
+
const k = key(task),
|
|
142
142
|
norm = (s) => s.toLowerCase().replace(/\s+/g, " ").trim(),
|
|
143
|
-
t = norm(
|
|
143
|
+
t = norm(task.text);
|
|
144
144
|
for (const r of store.S.cards
|
|
145
|
-
.filter((x) => x.kind === "run" && x.state ===
|
|
145
|
+
.filter((x) => x.kind === "run" && x.state === task.state)
|
|
146
146
|
.sort((a, b) => (b.moved ?? 0) - (a.moved ?? 0))
|
|
147
147
|
.slice(0, 5)) {
|
|
148
148
|
const d = await fetch(`/run/${encodeURIComponent(r.id)}?dir=${encodeURIComponent(r.state)}`)
|
package/web/board/cards.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { COLS, ICON, MARKS, NAMES, WORD, age, d, need } from "./labels.ts";
|
|
|
8
8
|
import { brief } from "./markdown.ts";
|
|
9
9
|
import { open, openAt, toggleArchive } from "./panel.ts";
|
|
10
10
|
import { isPhone } from "./phone.ts";
|
|
11
|
-
import {
|
|
11
|
+
import { taskCombo, list, newDir, plogo, setNewDir, short, showList, showable } from "./projects.ts";
|
|
12
12
|
import { askNotify, toast } from "./toast.ts";
|
|
13
13
|
import { answer, decided, resumable, resume } from "./approvals.ts";
|
|
14
14
|
import { termsBadge } from "./terms.ts";
|
|
@@ -30,8 +30,8 @@ let order = (() => {
|
|
|
30
30
|
}
|
|
31
31
|
})();
|
|
32
32
|
let archive = false; // showing the archive instead of the board
|
|
33
|
-
// The
|
|
34
|
-
let
|
|
33
|
+
// The Tasks column shows tasks or the runs' open backlog, never both; kept per browser.
|
|
34
|
+
let tasksTab = (() => {
|
|
35
35
|
try {
|
|
36
36
|
return localStorage.getItem("kz-ideas-tab") === "backlog" ? "backlog" : "ideas";
|
|
37
37
|
} catch (e) {
|
|
@@ -46,7 +46,7 @@ const SEVS = [
|
|
|
46
46
|
["low", "Low", (s) => s === "low"],
|
|
47
47
|
["none", "No severity", (s) => !s],
|
|
48
48
|
];
|
|
49
|
-
// Open backlog items as cards for the
|
|
49
|
+
// Open backlog items as cards for the Tasks column. A card's key names its line by
|
|
50
50
|
// source and number, which is what Start and Reject send back.
|
|
51
51
|
const backlogList = () =>
|
|
52
52
|
(store.S.backlog || []).map((b) => ({
|
|
@@ -69,7 +69,7 @@ const show = (c) => {
|
|
|
69
69
|
let picking = false;
|
|
70
70
|
const picked = new Set();
|
|
71
71
|
|
|
72
|
-
// Two
|
|
72
|
+
// Two tasks may carry the same text; load() numbers the repeats so a key names one card.
|
|
73
73
|
export const key = (c) =>
|
|
74
74
|
c._k || (c.kind === "idea" ? "idea:" + c.state + ":" + c.text : "run:" + c.state + ":" + c.id);
|
|
75
75
|
|
|
@@ -133,6 +133,7 @@ function card(c) {
|
|
|
133
133
|
// Orchestration: only a run that has workers carries them, so any other card is unchanged.
|
|
134
134
|
const wk: { id: string; status: string; bypass: boolean }[] = c.workers || [];
|
|
135
135
|
if (wk.length) chips.push(html`<span class="chip" title="${wk.map((x) => `${x.id} ${x.status}${x.bypass ? " (bypass)" : ""}`).join(", ")}">${wk.length} workers</span>`);
|
|
136
|
+
if (c.land) marks.push(html`<span class="mk bad" title="${c.land.why}">! ${c.land.kind === "conflict" ? "Conflict" : "Land failed"}</span>`);
|
|
136
137
|
if (c.signal === "blocked") marks.push(mk("i-ask", `Waiting on you: ${c.blocked?.question ?? ""}`, " warn ask"));
|
|
137
138
|
else if (c.signal === "stale") marks.push(html`<span class="mk warn" title="The agent has gone quiet: no report and no terminal activity">stale</span>`);
|
|
138
139
|
else if (c.signal === "unverified") marks.push(html`<span class="mk warn" title="The agent ended without finishing this stage properly">unverified</span>`);
|
|
@@ -140,7 +141,7 @@ function card(c) {
|
|
|
140
141
|
marks.push(mk("i-ask", "The agent is asking you something: open it, terminal button at the top", " warn ask"));
|
|
141
142
|
else if (c.pty && c.pty.alive)
|
|
142
143
|
marks.push(mk("i-term", "The agent is running in this run's workspace: open it", " run"));
|
|
143
|
-
// A gathered
|
|
144
|
+
// A gathered task's notes open with the stamp promote() writes (ingest() wrote it before
|
|
144
145
|
// the icebox); its chip names the source.
|
|
145
146
|
const g = c.notes && /^\[[^\]]*\] (?:Gathered from|Promoted from the icebox:) (.+?)\. Outside text/.exec(c.notes);
|
|
146
147
|
// A card filed by a run names that run; the parent itself shows nothing.
|
|
@@ -251,7 +252,7 @@ function card(c) {
|
|
|
251
252
|
} else {
|
|
252
253
|
items.push(["open", actionOf(c), ico("open")]);
|
|
253
254
|
items.push(["archive", "Archive", ico("archive")]);
|
|
254
|
-
if (c.column === 1 && c.status !== "abandoned") items.push(["toidea", "Back to
|
|
255
|
+
if (c.column === 1 && c.status !== "abandoned") items.push(["toidea", "Back to task", ico("restore")]);
|
|
255
256
|
}
|
|
256
257
|
el.innerHTML += html`<div class="menu-pop" role="menu">${items.map((i) => (i ? html`<button role="menuitem" data-a="${i[0]}" class="${i[3] || ""}">${i[2]}${i[1]}</button>` : raw("<hr>")))}</div>`;
|
|
257
258
|
}
|
|
@@ -280,8 +281,8 @@ function card(c) {
|
|
|
280
281
|
return;
|
|
281
282
|
}
|
|
282
283
|
if (a === "toidea") {
|
|
283
|
-
const r = await post("/to-
|
|
284
|
-
if (r.ok) toast("Back in
|
|
284
|
+
const r = await post("/to-task", { dir: c.state, id: c.id });
|
|
285
|
+
if (r.ok) toast("Back in Tasks");
|
|
285
286
|
load();
|
|
286
287
|
return;
|
|
287
288
|
}
|
|
@@ -370,7 +371,7 @@ function inlineForm(c) {
|
|
|
370
371
|
}
|
|
371
372
|
if (files.length) {
|
|
372
373
|
const r = await post("/note", { dir, for: next, text: "", files: await dataUrls(files) });
|
|
373
|
-
if (!r.ok) toast("
|
|
374
|
+
if (!r.ok) toast("Task saved, files not attached");
|
|
374
375
|
}
|
|
375
376
|
editFiles = { k: "", files: [] };
|
|
376
377
|
store.mode = null;
|
|
@@ -379,8 +380,8 @@ function inlineForm(c) {
|
|
|
379
380
|
};
|
|
380
381
|
}
|
|
381
382
|
if (store.mode === "reject") {
|
|
382
|
-
const
|
|
383
|
-
li.innerHTML = html`<div class="q">${c.kind === "backlog" ? "Not doing this backlog item?" :
|
|
383
|
+
const task = c.kind !== "run";
|
|
384
|
+
li.innerHTML = html`<div class="q">${c.kind === "backlog" ? "Not doing this backlog item?" : task ? "Reject this task?" : "Abandon this run?"} The reason is recorded.</div><input placeholder="Why not?"><div class="row"><button class="btn ghost" data-a="c">Keep it</button><button class="btn warn" data-a="s">${task ? "Reject" : "Abandon"}</button></div>`;
|
|
384
385
|
li.querySelector("[data-a=s]").onclick = async () => {
|
|
385
386
|
const why = li.querySelector("input").value.trim();
|
|
386
387
|
if (!why) {
|
|
@@ -392,10 +393,10 @@ function inlineForm(c) {
|
|
|
392
393
|
const r =
|
|
393
394
|
c.kind === "backlog"
|
|
394
395
|
? await post("/backlog", { op: "reject", dir, source: c.source, n: c.n, reason: why })
|
|
395
|
-
:
|
|
396
|
+
: task
|
|
396
397
|
? await post("/inbox", { op: "reject", dir, text: c.text, reason: why })
|
|
397
398
|
: await post("/abort", { dir, id: c.id, why });
|
|
398
|
-
if (r.ok) toast(
|
|
399
|
+
if (r.ok) toast(task ? "Rejected" : "Abandoned, reason recorded");
|
|
399
400
|
load();
|
|
400
401
|
};
|
|
401
402
|
}
|
|
@@ -455,7 +456,7 @@ function inlineForm(c) {
|
|
|
455
456
|
|
|
456
457
|
const runHtml = (c) =>
|
|
457
458
|
html`<div class="q">Run "${c.text}"</div><div class="q dim">Opens your agent with this request in a terminal.</div><div class="q dim">Full plans, builds, and checks with a separate reviewer. Lite does it in one session.</div><div id="run-pick" style="display:grid;gap:6px"><div id="run-agent" class="agents" role="radiogroup" aria-label="Agent"></div></div><div class="run-actions"><label class="yolo" id="run-yolo" title="Yolo: the agent runs every command and edit without asking" hidden><button type="button" class="chk" role="switch" aria-checked="false"></button>Yolo</label><div class="row"><button type="button" class="btn ghost" data-a="c">Cancel</button><button type="button" class="btn" data-a="l">Lite</button><button type="button" class="btn pri" data-a="s">Full run</button></div></div>`;
|
|
458
|
-
// The run form as a popup over any page: Start in the new-
|
|
459
|
+
// The run form as a popup over any page: Start in the new-task form and on Tasks.
|
|
459
460
|
export function runPopup(c) {
|
|
460
461
|
const dl = modal(runHtml(c)),
|
|
461
462
|
f = dl.querySelector("form");
|
|
@@ -558,53 +559,53 @@ async function startRun(c, kind) {
|
|
|
558
559
|
toast((kind === "full" ? "Full" : kind === "lite" ? "Lite" : "Started") + (yolo ? " yolo" : "") + " run " + where(r) + ": " + via(r.agent));
|
|
559
560
|
// A backlog card has no terminal of its own; the run's card gets it once the run exists.
|
|
560
561
|
if (r.pty && !backlog) (store.wantTerm = key(c)), (store.wantPty = { key: r.pty, at: Date.now() });
|
|
561
|
-
//
|
|
562
|
+
// A task's run opens in its workspace; the view follows it once the run card exists.
|
|
562
563
|
if (!backlog) openWorkspace(c);
|
|
563
564
|
}
|
|
564
565
|
load();
|
|
565
566
|
}
|
|
566
567
|
|
|
567
|
-
const HINT = { 0: "Add
|
|
568
|
+
const HINT = { 0: "Add a task to start a run", 1: "Tasks you run are planned here", 2: "Approved plans are built here", 3: "Finished builds are checked here" };
|
|
568
569
|
|
|
569
|
-
// Files picked in the new-
|
|
570
|
+
// Files picked in the new-task form. Held here, not in the form, because the board
|
|
570
571
|
// redraws the inline form on every change and a redraw would drop them.
|
|
571
572
|
let newFiles = [];
|
|
572
|
-
// The new-
|
|
573
|
-
// Opened from another page (
|
|
573
|
+
// The new-task form, wired into f: inline at the top of Tasks, or in a modal.
|
|
574
|
+
// Opened from another page (Tasks, a workspace, the side menu): always the project picker,
|
|
574
575
|
// preset to that page's project or empty so one is chosen. The Board keeps its own rule.
|
|
575
576
|
let formPick: { dir: string | null } | null = null;
|
|
576
|
-
function
|
|
577
|
+
function taskForm(f, shut) {
|
|
577
578
|
// A phone has no project picker in its header: the form is the only place to choose.
|
|
578
579
|
const picking = store.all || !!formPick || isPhone();
|
|
579
580
|
const close = () => {
|
|
580
581
|
newFiles = [];
|
|
581
582
|
shut();
|
|
582
583
|
};
|
|
583
|
-
f.innerHTML = html`${picking ? html`<div class="combo" id="ndc"><button type="button" class="sel" id="newdir" aria-label="Project for this
|
|
584
|
+
f.innerHTML = html`${picking ? html`<div class="combo" id="ndc"><button type="button" class="sel" id="newdir" aria-label="Project for this task" aria-haspopup="listbox" aria-expanded="false"></button><div class="menu-pop" hidden><input class="sel" aria-label="Search projects" placeholder="Search projects…" spellcheck="false" autocomplete="off"><div id="nds" role="listbox"></div></div></div>` : ""}<input id="newidea" placeholder="What do you want to build?"><label for="newnotes">Anything the planner should know <span class="dim">(optional)</span></label><textarea id="newnotes" placeholder="Context, constraints, examples, and what a good result looks like"></textarea><div class="att" id="newatt"></div><input type="file" id="newfile" multiple hidden><div class="row"><button type="button" class="ib" id="newpick" aria-label="Attach files" title="Attach files">${ico("clip")}</button><button type="button" class="btn ghost" id="nc">Cancel</button><div class="split"><button type="button" class="btn pri" id="ns">Add</button><button type="button" class="btn pri" id="nm" aria-label="More ways to add" aria-haspopup="menu" aria-expanded="false">${ico("chev")}</button><div class="menu-pop" role="menu" hidden><button type="button" role="menuitem" id="nr" title="Add the task and run it now">${ico("play")}Start run</button></div></div></div>`;
|
|
584
585
|
const inp = f.querySelector("#newidea"),
|
|
585
586
|
files = newFiles;
|
|
586
587
|
draft(inp, "f:new:0");
|
|
587
588
|
draft(f.querySelector("textarea"), "f:new:1");
|
|
588
|
-
// run: add the
|
|
589
|
+
// run: add the task, then launch it at once with the project's runner and agent.
|
|
589
590
|
const save = async (run) => {
|
|
590
591
|
const text = inp.value.trim();
|
|
591
592
|
if (!text) return;
|
|
592
593
|
const notes = f.querySelector("textarea").value.trim();
|
|
593
594
|
const dir = picking ? newDir : null;
|
|
594
595
|
if (picking && !dir) {
|
|
595
|
-
toast("Choose a project for this
|
|
596
|
+
toast("Choose a project for this task");
|
|
596
597
|
f.querySelector<HTMLElement>("#newdir")?.click();
|
|
597
598
|
return;
|
|
598
599
|
}
|
|
599
600
|
close();
|
|
600
601
|
const r = await post("/inbox", dir ? { op: "add", dir, text, notes } : { op: "add", text, notes });
|
|
601
602
|
if (r.ok) {
|
|
602
|
-
toast("
|
|
603
|
-
// The
|
|
603
|
+
toast("Task added");
|
|
604
|
+
// The task exists first: a failed upload leaves it as plain text.
|
|
604
605
|
if (files.length) {
|
|
605
606
|
const enc = await dataUrls(files);
|
|
606
607
|
const n = await post("/note", { dir, for: text, text: "", files: enc });
|
|
607
|
-
if (!n.ok) toast("
|
|
608
|
+
if (!n.ok) toast("Task added, files not attached");
|
|
608
609
|
}
|
|
609
610
|
if (run) {
|
|
610
611
|
await load();
|
|
@@ -637,7 +638,7 @@ function ideaForm(f, shut) {
|
|
|
637
638
|
if (picking) {
|
|
638
639
|
if (formPick) setNewDir(formPick.dir);
|
|
639
640
|
// From another page a choice is always required: a preset project the picker does not offer is not swapped for another.
|
|
640
|
-
|
|
641
|
+
taskCombo(f, !!formPick);
|
|
641
642
|
}
|
|
642
643
|
f.querySelector("#ns").onclick = () => save(false);
|
|
643
644
|
f.querySelector("#nr").onclick = () => save(true);
|
|
@@ -688,8 +689,8 @@ function ideaForm(f, shut) {
|
|
|
688
689
|
setTimeout(() => inp.focus());
|
|
689
690
|
}
|
|
690
691
|
|
|
691
|
-
// New
|
|
692
|
-
export function
|
|
692
|
+
// New task from the top bar, the empty board or n: the same form, in a modal.
|
|
693
|
+
export function newTask(from?: { dir: string | null }) {
|
|
693
694
|
// The header button passes its click event: only an explicit { dir } is another page's call.
|
|
694
695
|
formPick = from && "dir" in from ? from : null;
|
|
695
696
|
if (store.mode === "new") {
|
|
@@ -701,7 +702,7 @@ export function newIdea(from?: { dir: string | null }) {
|
|
|
701
702
|
const f = dl.querySelector("form");
|
|
702
703
|
f.onsubmit = (e) => e.preventDefault();
|
|
703
704
|
dl.addEventListener("close", () => stopDictation(false));
|
|
704
|
-
|
|
705
|
+
taskForm(f, () => dl.close());
|
|
705
706
|
}
|
|
706
707
|
|
|
707
708
|
export function render() {
|
|
@@ -745,7 +746,7 @@ export function render() {
|
|
|
745
746
|
);
|
|
746
747
|
}
|
|
747
748
|
strip.push(
|
|
748
|
-
`<button class="${archive ? "on" : ""}" data-f="__archive" title="${cs.filter((c) => c.kind === "idea").length}
|
|
749
|
+
`<button class="${archive ? "on" : ""}" data-f="__archive" title="${cs.filter((c) => c.kind === "idea").length} tasks · ${cs.filter((c) => c.kind === "run").length} runs on the board">${archive ? "Back to board" : "Archive " + nArch}</button>`,
|
|
749
750
|
);
|
|
750
751
|
$("strip").innerHTML = strip.join("");
|
|
751
752
|
// The phone's status button: amber dot while a run waits, accent while a filter or the archive is on.
|
|
@@ -794,14 +795,14 @@ export function render() {
|
|
|
794
795
|
if (!wsm && !cs.length && store.mode !== "new") {
|
|
795
796
|
b.innerHTML = archive
|
|
796
797
|
? '<div class="empty"><div class="mascot"></div><b>Nothing archived</b></div>'
|
|
797
|
-
: '<div class="empty"><div class="mascot"></div><b>Nothing here yet</b><p>Add
|
|
798
|
+
: '<div class="empty"><div class="mascot"></div><b>Nothing here yet</b><p>Add a task and kaizen will plan it, build it, and check the result.</p><button class="btn pri" id="newempty">New task</button></div>';
|
|
798
799
|
if (!archive)
|
|
799
|
-
$("newempty").onclick =
|
|
800
|
+
$("newempty").onclick = newTask;
|
|
800
801
|
}
|
|
801
802
|
(wsm ? [] : COLS).forEach((name, ci) => {
|
|
802
803
|
const s = document.createElement("section");
|
|
803
804
|
const q = query.trim().toLowerCase();
|
|
804
|
-
const bl = ci === 0 && !archive &&
|
|
805
|
+
const bl = ci === 0 && !archive && tasksTab === "backlog";
|
|
805
806
|
const all = bl ? backlogList().filter((c) => !only || store.shown.has(c.state)) : cs;
|
|
806
807
|
const list = all.filter(
|
|
807
808
|
(c) =>
|
|
@@ -811,8 +812,8 @@ export function render() {
|
|
|
811
812
|
(archive || !nested(c)) &&
|
|
812
813
|
(!q || `${c.title || ""} ${c.text || ""} ${c.id || ""}`.toLowerCase().includes(q)),
|
|
813
814
|
);
|
|
814
|
-
// Runs age by their last move,
|
|
815
|
-
//
|
|
815
|
+
// Runs age by their last move, tasks by when they were added, across every project;
|
|
816
|
+
// a task from before the stamp falls back to its inbox position.
|
|
816
817
|
if (ci < 4 && !bl) {
|
|
817
818
|
const at = (c) => (c.kind === "run" ? c.moved || 0 : c.added || 0),
|
|
818
819
|
old = order[ci] === "old",
|
|
@@ -823,18 +824,18 @@ export function render() {
|
|
|
823
824
|
}
|
|
824
825
|
const clearable = ci === 4 && !archive && list.length;
|
|
825
826
|
const olderThan = (days) => list.filter((c) => store.S.now - (c.moved || store.S.now) > days * d);
|
|
826
|
-
// The
|
|
827
|
+
// The Tasks column is titled by its two tabs, icons without counts: tasks, or the
|
|
827
828
|
// runs' leftovers. On Backlog a filter icon narrows it to one severity.
|
|
828
829
|
const tabbed = ci === 0 && !archive,
|
|
829
830
|
nb = tabbed ? backlogList().filter((c) => !only || store.shown.has(c.state)) : [];
|
|
830
831
|
const title = tabbed
|
|
831
|
-
? `<span class="itabs" role="tablist" aria-label="
|
|
832
|
-
["ideas", "
|
|
832
|
+
? `<span class="itabs" role="tablist" aria-label="To do column">${[
|
|
833
|
+
["ideas", "To do", `<svg><use href="#s-idea"/></svg>`],
|
|
833
834
|
["backlog", "Backlog: what finished runs left undone", ico("clock")],
|
|
834
835
|
]
|
|
835
836
|
.map(
|
|
836
837
|
([v, l, svg]) =>
|
|
837
|
-
`<button role="tab" aria-selected="${String(
|
|
838
|
+
`<button role="tab" aria-selected="${String(tasksTab === v)}" data-t="${v}" title="${l}" aria-label="${l}">${svg}${tasksTab === v ? `<b>${l.split(":")[0]}</b>` : ""}</button>`,
|
|
838
839
|
)
|
|
839
840
|
.join("")}</span>`
|
|
840
841
|
: `${name}<i>${list.length || ""}</i>`;
|
|
@@ -847,7 +848,7 @@ export function render() {
|
|
|
847
848
|
).join("")}</div>`
|
|
848
849
|
: "")
|
|
849
850
|
: "";
|
|
850
|
-
let head = `<h2>${title}${ci < 4 && !bl && list.length > 1 ? `<button class="btn sm ghost ord" title="Sort order">${order[ci] === "old" ? "Oldest" : "Newest"}</button>` : ""}${sevBtn}${tabbed ? `<button class="ib sm newi" title="New
|
|
851
|
+
let head = `<h2>${title}${ci < 4 && !bl && list.length > 1 ? `<button class="btn sm ghost ord" title="Sort order">${order[ci] === "old" ? "Oldest" : "Newest"}</button>` : ""}${sevBtn}${tabbed ? `<button class="ib sm newi" title="New task" aria-label="New task">${ico("plus")}</button>` : ""}`;
|
|
851
852
|
if (clearable && picking)
|
|
852
853
|
head += `<span class="pickbar"><button class="btn sm ghost" data-p="cancel">Cancel</button><button class="btn sm pri" data-p="go" ${picked.size ? "" : "disabled"}>Archive ${picked.size || ""}</button></span>`;
|
|
853
854
|
else if (clearable) head += `<button class="btn sm ghost clear" title="Archive finished runs">Clear ▾</button>`;
|
|
@@ -858,10 +859,10 @@ export function render() {
|
|
|
858
859
|
s.querySelectorAll("[data-t]").forEach(
|
|
859
860
|
(bt) =>
|
|
860
861
|
(bt.onclick = () => {
|
|
861
|
-
|
|
862
|
+
tasksTab = bt.dataset.t;
|
|
862
863
|
store.sevMenu = false;
|
|
863
864
|
try {
|
|
864
|
-
localStorage.setItem("kz-ideas-tab",
|
|
865
|
+
localStorage.setItem("kz-ideas-tab", tasksTab);
|
|
865
866
|
} catch (e) {}
|
|
866
867
|
render();
|
|
867
868
|
}),
|
|
@@ -898,7 +899,7 @@ export function render() {
|
|
|
898
899
|
if (tabbed)
|
|
899
900
|
s.querySelector(".newi").onclick = () => {
|
|
900
901
|
store.mode = "new";
|
|
901
|
-
|
|
902
|
+
tasksTab = "ideas";
|
|
902
903
|
render();
|
|
903
904
|
};
|
|
904
905
|
if (clearable) {
|
|
@@ -956,7 +957,7 @@ export function render() {
|
|
|
956
957
|
const f = document.createElement("li");
|
|
957
958
|
f.className = "inl";
|
|
958
959
|
ul.appendChild(f);
|
|
959
|
-
|
|
960
|
+
taskForm(f, () => {
|
|
960
961
|
store.mode = null;
|
|
961
962
|
render();
|
|
962
963
|
});
|
package/web/board/git.ts
CHANGED
|
@@ -61,14 +61,14 @@ function steps(c) {
|
|
|
61
61
|
why: files
|
|
62
62
|
? "Commit changes first"
|
|
63
63
|
: b && !b.upstream
|
|
64
|
-
? "Not published yet: Create PR pushes it"
|
|
64
|
+
? b.local ? "Lands by local merge: kaizen worktree land" : "Not published yet: Create PR pushes it"
|
|
65
65
|
: g.ahead > 0
|
|
66
66
|
? ""
|
|
67
67
|
: "Nothing to push",
|
|
68
68
|
},
|
|
69
69
|
];
|
|
70
70
|
if (!b) return s;
|
|
71
|
-
const noGh = b.gh ? "" : "Needs the GitHub CLI (gh) and a GitHub remote";
|
|
71
|
+
const noGh = b.local ? "Lands by local merge: kaizen worktree land" : b.gh ? "" : "Needs the GitHub CLI (gh) and a GitHub remote";
|
|
72
72
|
const prWhy =
|
|
73
73
|
noGh ||
|
|
74
74
|
(files
|
|
@@ -134,7 +134,7 @@ export function gitTab(c, refresh) {
|
|
|
134
134
|
rows = g.rows || [],
|
|
135
135
|
staged = rows.filter((r) => r.staged),
|
|
136
136
|
unstaged = rows.filter((r) => !r.staged),
|
|
137
|
-
target = b ? `origin/${b.base}` : `${g.remote}/${g.branch || "HEAD"}`;
|
|
137
|
+
target = b ? (b.local ? b.base : `origin/${b.base}`) : `${g.remote}/${g.branch || "HEAD"}`;
|
|
138
138
|
if (u.msg === undefined) u.msg = commitMsg(store.runDoc.impl) || c.title || c.text || "";
|
|
139
139
|
u.shut = u.shut || {};
|
|
140
140
|
// The main button: Stage all while nothing is staged, Commit once something is, else the
|
|
@@ -223,7 +223,7 @@ export function gitTab(c, refresh) {
|
|
|
223
223
|
: u.ask === "remove"
|
|
224
224
|
? html`<div class="gsec gform">
|
|
225
225
|
<div class="ghd">Remove the worktree and delete ${b.branch}?</div>
|
|
226
|
-
<div class="dim">Its work is on ${b.base}. The branch is deleted here and on GitHub.</div>
|
|
226
|
+
<div class="dim">Its work is on ${b.base}. The branch is deleted here${b.local ? "" : " and on GitHub"}.</div>
|
|
227
227
|
<div class="row"><button class="btn ghost" data-a="cancel">Cancel</button><button class="btn danger" data-a="go-remove">Remove workspace</button></div>
|
|
228
228
|
</div>`
|
|
229
229
|
: "";
|
package/web/board/icebox.ts
CHANGED
|
@@ -4,12 +4,12 @@ import { load, post } from "./api.ts";
|
|
|
4
4
|
import { via } from "./cards.ts";
|
|
5
5
|
import { mic, stopDictation } from "./dictation.ts";
|
|
6
6
|
import { $, dataUrls, html, ico, modal, motion, pageOf, pager, pagerHtml, raw, SKEL, wirePager } from "./dom.ts";
|
|
7
|
-
import {
|
|
7
|
+
import { taskCombo, newDir, plogo, setShown, short, showable } from "./projects.ts";
|
|
8
8
|
import { playSound, soundPick, toast } from "./toast.ts";
|
|
9
9
|
import { go, view } from "./views.ts";
|
|
10
10
|
|
|
11
11
|
// ---- the icebox: requests gathered from request sources, read like an inbox, until
|
|
12
|
-
// someone promotes them to
|
|
12
|
+
// someone promotes them to tasks or dismisses them. The sources themselves sit in a
|
|
13
13
|
// section below, folded. Same panel as settings.
|
|
14
14
|
const SRC = "Icebox";
|
|
15
15
|
// What the page keeps across the rebuild every server change brings: the item whose
|
|
@@ -344,10 +344,10 @@ export async function openSources() {
|
|
|
344
344
|
const bulk = iceSel.size
|
|
345
345
|
? 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-bd" title="Dismiss (d)">${ico("x")} Dismiss</button><button class="btn ghost sm" id="ice-bc" title="Clear selection (Esc)">Clear</button></div>`
|
|
346
346
|
: "";
|
|
347
|
-
// The open item's form: a clean title for the
|
|
348
|
-
// what was gathered is added to the
|
|
347
|
+
// The open item's form: a clean title for the task's card and the person's own details;
|
|
348
|
+
// what was gathered is added to the task's notes by the server.
|
|
349
349
|
const form = (it) =>
|
|
350
|
-
html`<div class="ice-form"><label for="ice-title" class="hint" style="margin:0">
|
|
350
|
+
html`<div class="ice-form"><label for="ice-title" class="hint" style="margin:0">Task title</label><input class="sel" id="ice-title" data-k="${iceKey(it)}" maxlength="200" value="${it.text}" aria-label="Task title"><label for="ice-details" class="hint" style="margin:0">Details</label><textarea class="sel" id="ice-details" rows="3" aria-label="Details"></textarea><div class="ice-form-acts"><span class="end"></span><button class="btn ghost sm" id="ice-cancel">Cancel</button><button class="btn pri sm" id="ice-ok">Promote</button></div></div>`;
|
|
351
351
|
// A gathered post can be answered: Reply drafts, the box is the approval, Send reply posts that text.
|
|
352
352
|
const replyBox = (it) => {
|
|
353
353
|
if (!it.post) return "";
|
|
@@ -369,7 +369,7 @@ export async function openSources() {
|
|
|
369
369
|
const it = ice[i],
|
|
370
370
|
k = iceKey(it),
|
|
371
371
|
open = iceForm === k;
|
|
372
|
-
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}"><span class="ice-src" title="${srcName(it)}">${fav(it.source, "link", list.find((x) => x.dir === it.dir && x.url === it.source)?.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">${many ? html`<span class="nm" title="${it.project || ""}">${plogo(it.dir, it.project || "")}${short(it.project || "")}</span>` : ""}${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
|
|
372
|
+
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}"><span class="ice-src" title="${srcName(it)}">${fav(it.source, "link", list.find((x) => x.dir === it.dir && x.url === it.source)?.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">${many ? html`<span class="nm" title="${it.project || ""}">${plogo(it.dir, it.project || "")}${short(it.project || "")}</span>` : ""}${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>` : ""}<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>`}${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></div>`;
|
|
373
373
|
const more = open
|
|
374
374
|
? 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="${it.post}" target="_blank" rel="noopener">open post</a>` : ""}</span>${replyBox(it)}${icePro === k ? form(it) : ""}</div>`
|
|
375
375
|
: "";
|
|
@@ -380,13 +380,13 @@ export async function openSources() {
|
|
|
380
380
|
? html`<div class="ice-zero"><h4>No matches</h4><p style="margin-top:10px"><button class="btn sm" id="ice-unf">Clear filters</button></p></div>`
|
|
381
381
|
: order.length
|
|
382
382
|
? html`<div class="tk-list ice-list">${[...groups].map(([g, ix]) => (ix.some((i) => onPage.has(i)) ? html`<div class="ice-cat">${g}<i>${ix.length}</i></div>${ix.filter((i) => onPage.has(i)).map(row)}` : ""))}${pagerHtml(icePg)}</div>`
|
|
383
|
-
: html`<div class="ice-zero"><h4>Nothing waiting</h4><p>Requests gathered from your sources wait here until you turn them into
|
|
383
|
+
: html`<div class="ice-zero"><h4>Nothing waiting</h4><p>Requests gathered from your sources wait here until you turn them into tasks.</p>${list.length ? "" : html`<p style="margin-top:10px"><button class="btn sm pri" id="ice-addsrc">${ico("plus")} Add a source</button></p>`}</div>`;
|
|
384
384
|
// Swipe: the waiting requests the filters show, least skipped first; a restored one
|
|
385
385
|
// comes back on top. Nothing is written by a skip.
|
|
386
386
|
const deck = iceSwipe
|
|
387
387
|
? filtered.filter((i) => isWaiting(ice[i])).sort((a, b) => (iceSwipe.skip.get(iceKey(ice[a])) || 0) - (iceSwipe.skip.get(iceKey(ice[b])) || 0))
|
|
388
388
|
: [];
|
|
389
|
-
// The card always names its project: a swipe decides for that project's
|
|
389
|
+
// The card always names its project: a swipe decides for that project's Tasks.
|
|
390
390
|
const pName = (it) => it.project || store.S.projects.find((p) => p.dir === it.dir)?.label || "";
|
|
391
391
|
const swCard = (i, back) => {
|
|
392
392
|
const it = ice[i];
|
|
@@ -677,7 +677,7 @@ export async function openSources() {
|
|
|
677
677
|
}
|
|
678
678
|
if (srcOpen()) openSources().then(focusCur);
|
|
679
679
|
})();
|
|
680
|
-
// Bulk: one dismiss per project; promote one request at a time, each its own
|
|
680
|
+
// Bulk: one dismiss per project; promote one request at a time, each its own task
|
|
681
681
|
// titled as gathered (one promote call with several ids would merge them into one).
|
|
682
682
|
const bulkDo = async (op) => {
|
|
683
683
|
const its = ice.filter((it) => iceSel.has(iceKey(it)));
|
|
@@ -699,7 +699,7 @@ export async function openSources() {
|
|
|
699
699
|
iceSel.clear();
|
|
700
700
|
if (ok)
|
|
701
701
|
toast(
|
|
702
|
-
`${ok} ${op === "promote" ? "promoted to
|
|
702
|
+
`${ok} ${op === "promote" ? "promoted to Tasks" : "dismissed"}${ok < its.length ? `, ${its.length - ok} not` : ""}`,
|
|
703
703
|
);
|
|
704
704
|
load();
|
|
705
705
|
if (srcOpen()) openSources().then(focusCur);
|
|
@@ -861,7 +861,7 @@ export async function openSources() {
|
|
|
861
861
|
return;
|
|
862
862
|
}
|
|
863
863
|
$("ice-ok").disabled = true;
|
|
864
|
-
iceAct("promote", open1, "Promoted to
|
|
864
|
+
iceAct("promote", open1, "Promoted to Tasks", { text: title, details: $("ice-details").value });
|
|
865
865
|
};
|
|
866
866
|
$("ice-ok").onclick = ok;
|
|
867
867
|
$("ice-cancel").onclick = () => {
|
|
@@ -908,7 +908,7 @@ export async function openSources() {
|
|
|
908
908
|
if (j.ok) {
|
|
909
909
|
S.n++;
|
|
910
910
|
op === "promote" ? S.pro++ : S.dis++;
|
|
911
|
-
// Only a dismiss can be undone here: a promote has already made
|
|
911
|
+
// Only a dismiss can be undone here: a promote has already made a task card.
|
|
912
912
|
S.last = op === "dismiss" ? it : null;
|
|
913
913
|
S.pop = true;
|
|
914
914
|
} else toast(`Could not ${op}: ${j.error || "kaizen did not answer"}`);
|
|
@@ -1181,7 +1181,7 @@ export async function openSources() {
|
|
|
1181
1181
|
$("ice-new").onclick = () => {
|
|
1182
1182
|
const all = !dir;
|
|
1183
1183
|
if (!dir && !showable().length) return toast("Pick a project first");
|
|
1184
|
-
// The new-
|
|
1184
|
+
// The new-task form, cut down: the request, files, dictation and, in All projects, the project.
|
|
1185
1185
|
const dl = modal(
|
|
1186
1186
|
`${all ? `<div class="combo" id="ndc"><button type="button" class="sel" id="newdir" aria-label="Project for this request" aria-haspopup="listbox" aria-expanded="false"></button><div class="menu-pop" hidden><input class="sel" aria-label="Search projects" placeholder="Search projects…" spellcheck="false" autocomplete="off"><div id="nds" role="listbox"></div></div></div>` : ""}<textarea id="newidea" placeholder="What did someone ask for?" aria-label="Request"></textarea><div class="att"></div><input type="file" multiple hidden><div class="row"><button type="button" class="ib" id="newpick" aria-label="Attach files" title="Attach files">${ico("clip")}</button><button type="button" class="btn ghost" value="">Cancel</button><button class="btn pri">Add</button></div>`,
|
|
1187
1187
|
);
|
|
@@ -1206,7 +1206,7 @@ export async function openSources() {
|
|
|
1206
1206
|
}
|
|
1207
1207
|
};
|
|
1208
1208
|
f.querySelector(".btn.ghost").onclick = () => dl.close();
|
|
1209
|
-
if (all)
|
|
1209
|
+
if (all) taskCombo(f);
|
|
1210
1210
|
const m = mic([inp]);
|
|
1211
1211
|
if (m) f.querySelector(".row").prepend(m);
|
|
1212
1212
|
dl.addEventListener("close", () => stopDictation(false));
|