kaizen-agent 1.60.2 → 1.61.0
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/notes.test.ts +2 -1
- package/cli/pty.test.ts +15 -1
- package/cli/pty.ts +13 -2
- package/cli/shell-agent.test.ts +23 -0
- package/cli/state.test.ts +19 -0
- package/cli/state.ts +17 -11
- package/cli/web.ts +25 -5
- package/package.json +1 -1
- package/web/board/add-project.ts +14 -4
- package/web/board/run-view.ts +20 -4
- package/web/board/settings-pages.test.ts +19 -0
- package/web/board/settings-pages.ts +44 -0
- package/web/board/settings.ts +118 -62
- package/web/board/store.ts +2 -0
- package/web/board/update.ts +1 -1
- package/web/board/views.ts +5 -1
- package/web/board/ws-name.test.ts +10 -0
- package/web/board/ws-tabs.test.ts +14 -1
- package/web/board/ws-tabs.ts +12 -1
- package/web/board.html +51 -9
- package/web/board.js +82 -77
- package/web/notebook.js +23 -23
- package/web/notebook.ts +1 -0
- package/web/notes.html +12 -5
- package/web/popup.html +2 -2
- package/web/term.js +1 -1
- package/web/video.html +12 -5
- package/web/video.js +38 -38
package/web/board/settings.ts
CHANGED
|
@@ -2,22 +2,22 @@ import { store } from "./store.ts";
|
|
|
2
2
|
import { termStop } from "./agent-term.ts";
|
|
3
3
|
import { load, post } from "./api.ts";
|
|
4
4
|
import { stopDictation } from "./dictation.ts";
|
|
5
|
-
import { $, html, SKEL } from "./dom.ts";
|
|
5
|
+
import { $, html, ico, SKEL } from "./dom.ts";
|
|
6
6
|
import { close } from "./panel.ts";
|
|
7
|
+
import { placeOf, SETTINGS_NAV } from "./settings-pages.ts";
|
|
7
8
|
import { askNotify, notifyOn, playSound, soundPick, SOUNDS, toast } from "./toast.ts";
|
|
8
9
|
import { updBar } from "./update.ts";
|
|
9
|
-
import { view } from "./views.ts";
|
|
10
|
+
import { go, view } from "./views.ts";
|
|
10
11
|
|
|
11
12
|
// ---- settings
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
13
|
+
const PAGES = SETTINGS_NAV.flatMap(([, ps]) => ps);
|
|
14
|
+
const narrow = () => matchMedia("(max-width:640px)").matches;
|
|
15
|
+
// Ctrl+F searches settings, as in Orca. Only while the page shows: elsewhere it stays the browser's.
|
|
16
|
+
addEventListener("keydown", (e) => {
|
|
17
|
+
if (view !== "settings" || !(e.ctrlKey || e.metaKey) || e.key.toLowerCase() !== "f") return;
|
|
18
|
+
e.preventDefault();
|
|
19
|
+
$("sq")?.focus();
|
|
20
|
+
});
|
|
21
21
|
export async function openSettings() {
|
|
22
22
|
if (view !== "settings") return;
|
|
23
23
|
const gen = ++store.pageGen;
|
|
@@ -38,6 +38,7 @@ export async function openSettings() {
|
|
|
38
38
|
$("ptabs").innerHTML = "";
|
|
39
39
|
$("pfoot").innerHTML = "";
|
|
40
40
|
const cur = document.documentElement.dataset.theme || "system";
|
|
41
|
+
const colour = document.documentElement.dataset.color || "monochrome";
|
|
41
42
|
let cfg = await fetch("/settings?scope=" + encodeURIComponent(store.setScope))
|
|
42
43
|
.then((r) => (r.ok ? r.json() : null))
|
|
43
44
|
.catch(() => null);
|
|
@@ -63,10 +64,11 @@ export async function openSettings() {
|
|
|
63
64
|
.map((v) => html`<button id="${id}-${v}" data-v="${v}" class="${v === on ? "on" : ""}" aria-pressed="${String(v === on)}">${v}</button>`)}</span>`;
|
|
64
65
|
if (vals.length === 2 && vals.includes("true") && vals.includes("false")) {
|
|
65
66
|
const yes = on === "true";
|
|
66
|
-
return html`<button class="chk${yes ? " on" : ""}" id="${id}" data-v="${yes ? "false" : "true"}" role="switch" aria-checked="${String(yes)}" title="${yes ? "On" : "Off"}"></button>`;
|
|
67
|
+
return html`<button class="chk sm${yes ? " on" : ""}" id="${id}" data-v="${yes ? "false" : "true"}" role="switch" aria-checked="${String(yes)}" title="${yes ? "On" : "Off"}"></button>`;
|
|
67
68
|
}
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
// Short choices sit side by side, joined, as Orca's do; a long list keeps the stepper.
|
|
70
|
+
if (vals.every((v) => /^\d+$/.test(v)) || (vals.length <= 5 && vals.every((v) => v) && vals.join("").length <= 32))
|
|
71
|
+
return html`<span class="bar" id="${id}" role="group" aria-labelledby="${id}-l">${vals.map((v) => html`<button id="${id}-${v}" data-v="${v}" class="${v === on ? "on" : ""}" aria-pressed="${String(v === on)}">${v}</button>`)}</span>`;
|
|
70
72
|
// Wired by stepper() below; the group takes its name from the row's label.
|
|
71
73
|
return html`<span class="step" id="${id}" role="group" aria-labelledby="${id}-l"><button id="${id}-prev" aria-label="Previous">‹</button><output aria-live="polite">${on === "" ? "—" : on}</output><button id="${id}-next" aria-label="Next">›</button></span>`;
|
|
72
74
|
};
|
|
@@ -87,51 +89,71 @@ export async function openSettings() {
|
|
|
87
89
|
const np = typeof Notification === "undefined" ? null : Notification.permission;
|
|
88
90
|
const nton = notifyOn();
|
|
89
91
|
const ntHelp = !nton ? "Off in this browser" : np === "granted" ? "" : np === "denied" ? "Pop-ups blocked by this browser; the sound still plays" : np ? "Pop-ups wait for the browser to ask; the sound still plays" : "Pop-ups not supported here; the sound still plays";
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
);
|
|
122
|
-
})}</div>`,
|
|
123
|
-
)
|
|
124
|
-
: html`<p class="snone">Settings could not be read. Run <code>kaizen settings</code>.</p>`
|
|
92
|
+
// Each page's subsections, in the order they first appear.
|
|
93
|
+
const pageRows = new Map<string, Map<string, unknown[]>>(PAGES.map((p) => [p.id, new Map()]));
|
|
94
|
+
const put = (page, sub, r) => {
|
|
95
|
+
const m = pageRows.get(page);
|
|
96
|
+
if (!m.has(sub)) m.set(sub, []);
|
|
97
|
+
m.get(sub).push(r);
|
|
98
|
+
};
|
|
99
|
+
if (cfg) {
|
|
100
|
+
put("general", "Scope", row(
|
|
101
|
+
"Settings for",
|
|
102
|
+
html`<select class="sel" id="s-scope">${[{ dir: "all", label: "All projects" }, ...cfg.projects].map((p) => html`<option value="${p.dir}"${p.dir === cfg.scope ? " selected" : ""}>${p.label}</option>`)}</select>`,
|
|
103
|
+
scoped ? "This project's own .kaizen/config.yml; anything it does not set comes from All projects." : "~/.kaizen/config.yml; a project's own config wins where it sets a value.",
|
|
104
|
+
"s-scope",
|
|
105
|
+
"settings for scope project all projects",
|
|
106
|
+
));
|
|
107
|
+
for (const r of cfg.rows) {
|
|
108
|
+
const id = "s-" + r.key.replace(/\./g, "-");
|
|
109
|
+
const [page, sub] = placeOf(r.key);
|
|
110
|
+
put(page, sub + (scoped && r.group === "Board" ? " · all projects" : ""), row(
|
|
111
|
+
r.label,
|
|
112
|
+
r.text
|
|
113
|
+
? r.folder
|
|
114
|
+
? html`<span class="fpick"><input class="sel" id="${id}" value="${r.value}" placeholder="not set" spellcheck="false"><button class="btn" id="${id}-pick" type="button">Browse…</button></span>`
|
|
115
|
+
: html`<input class="sel" id="${id}" value="${r.value}" placeholder="not set" spellcheck="false">`
|
|
116
|
+
: ctl(id, r.values, r.value),
|
|
117
|
+
((t, n) => (t && n ? html`${t} · ${n}` : n || t))([r.help, r.idle].filter(Boolean).join(" · "), scopeNote(r, id)),
|
|
118
|
+
id,
|
|
119
|
+
[r.label, r.help, r.key, r.group, ...r.values].join(" "),
|
|
120
|
+
!!r.idle,
|
|
121
|
+
));
|
|
122
|
+
}
|
|
125
123
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
124
|
+
put("mobile", "Phone", row("Phone address", cfg?.phoneUrls?.length ? html`<span class="phoneurls">${cfg.phoneUrls.map((url) => html`<a href="${url}" target="_blank" rel="noopener">${url}</a>`)}</span>` : html`<span>Not set</span>`, cfg?.phoneUrls?.length ? "Configured address; Tailscale must be running on both devices." : "Run kaizen setup on this PC to connect your phone.", "phone-url", "phone address url tailscale setup"));
|
|
125
|
+
put("integrations", "Google", row("OAuth client id", html`<input class="sel" id="gg-id" placeholder="${gg.hasClient ? "Saved. Paste a new one to replace it" : "Desktop app client id from Google Cloud"}" spellcheck="false" autocomplete="off">`, "", "gg-id", "google oauth client id sheets write back"));
|
|
126
|
+
put("integrations", "Google", row("OAuth client secret", html`<span class="fpick"><input class="sel" id="gg-secret" type="password" placeholder="${gg.hasClient ? "Saved. Paste a new one to replace it" : ""}" spellcheck="false" autocomplete="off"><button class="btn" id="gg-save" type="button">Save</button></span>`, "", "gg-secret", "google oauth client secret"));
|
|
127
|
+
put("integrations", "Google", row("Google account", html`<button class="btn${gg.connected ? "" : " pri"}" id="gg-conn" type="button"${gg.hasClient || gg.connected ? "" : " disabled"}>${gg.connected ? "Disconnect" : "Connect"}</button>`, "", "gg-conn", "google account connect sheets write back"));
|
|
128
|
+
put("appearance", "Browser", row("Theme", ctl("th", ["system", "light", "dark"], cur), "", "th", "theme light dark system browser"));
|
|
129
|
+
put("appearance", "Browser", row("Color", ctl("co", ["monochrome", "blue"], colour), "", "co", "color colour palette monochrome blue theme browser"));
|
|
130
|
+
put("appearance", "Browser", row("Motion", ctl("mo", ["system", "full", "reduce"], document.documentElement.dataset.motion || "system"), "Animations on the board and notes. System follows the device's reduce-motion setting.", "mo", "motion animation reduce reduced browser"));
|
|
131
|
+
put("notifications", "Browser", row("Notifications", html`<button class="chk sm${nton ? " on" : ""}" id="nt" role="switch" aria-checked="${String(nton)}"></button>`, ntHelp, "nt", "notifications " + ntHelp + " browser"));
|
|
132
|
+
put("notifications", "Browser", row("Notification sound", ctl("ns", SOUNDS, soundPick()), "Plays with each notice. Changing it plays it.", "ns", "notification sound audio browser " + SOUNDS.join(" "), !nton));
|
|
133
|
+
// A narrow screen starts on the list of pages, a wide one on the first page.
|
|
134
|
+
store.setPage ??= new URLSearchParams(location.search).get("page") || "";
|
|
135
|
+
const scopeName = scoped ? cfg.projects.find((p) => p.dir === cfg.scope)?.label : "";
|
|
136
|
+
// A save redraws the page: the rows stay where they were scrolled to.
|
|
137
|
+
const top = $("smain")?.scrollTop || 0;
|
|
138
|
+
$("pbody").innerHTML = html`<div class="sset" id="sset">
|
|
139
|
+
<nav class="snav" aria-label="Settings">
|
|
140
|
+
<button class="sback" id="sback" type="button">${ico("chev")}Back to app</button>
|
|
141
|
+
<div class="sq"><input class="sel" id="sq" type="search" placeholder="Search settings" aria-label="Search settings" spellcheck="false" autocomplete="off" value="${store.setQ}"></div>
|
|
142
|
+
<div class="snavs">${SETTINGS_NAV.map(([g, ps]) => html`<div class="snavg"><p>${g}</p>${ps.map((p) => html`<button type="button" data-page="${p.id}">${ico(p.ico)}<span>${p.title}</span></button>`)}</div>`)}</div>
|
|
143
|
+
</nav>
|
|
144
|
+
<div class="smain" id="smain">
|
|
145
|
+
${PAGES.map((p) => html`<div class="spage" data-page="${p.id}">
|
|
146
|
+
<button class="sup" type="button">${ico("chev")}Settings</button>
|
|
147
|
+
<header><h2>${p.title}</h2><p>${p.desc}${scopeName ? ` Editing ${scopeName}.` : ""}</p></header>
|
|
148
|
+
${p.id === "general" ? html`<div id="supd"></div>` : ""}
|
|
149
|
+
<div class="scard">${[...pageRows.get(p.id)].map(([sub, rows]) => html`<h3 class="sg">${sub}</h3><div class="sgrp">${rows}</div>`)}</div>
|
|
150
|
+
</div>`)}
|
|
151
|
+
${cfg ? "" : html`<p class="snone">Settings could not be read. Run <code>kaizen settings</code>.</p>`}
|
|
152
|
+
<p class="snone" id="snone" hidden></p>
|
|
153
|
+
</div>
|
|
154
|
+
</div>`;
|
|
155
|
+
// Hides rows that do not match, then any subsection and page left with none. The page
|
|
156
|
+
// shown is the one picked, or while searching the first that still has a match.
|
|
135
157
|
updBar();
|
|
136
158
|
const heads = [...$("pbody").querySelectorAll(".sg")];
|
|
137
159
|
const filter = () => {
|
|
@@ -148,7 +170,31 @@ export async function openSettings() {
|
|
|
148
170
|
});
|
|
149
171
|
$("snone").hidden = any;
|
|
150
172
|
$("snone").textContent = `No setting matches “${store.setQ.trim()}”.`;
|
|
173
|
+
const has = (s) => !!s.querySelector(".sg:not([hidden])");
|
|
174
|
+
const secs = [...$("pbody").querySelectorAll<HTMLElement>(".spage")];
|
|
175
|
+
const hits = secs.filter(has);
|
|
176
|
+
const picked = store.setPage && secs.find((s) => s.dataset.page === store.setPage);
|
|
177
|
+
const cur = (picked && has(picked) ? picked : null) || (q || !narrow() ? hits[0] : null);
|
|
178
|
+
secs.forEach((s) => (s.hidden = s !== cur));
|
|
179
|
+
$("sset").classList.toggle("pick", !cur);
|
|
180
|
+
$("pbody").querySelectorAll<HTMLElement>(".snavg button").forEach((b) => {
|
|
181
|
+
const on = b.dataset.page === cur?.dataset.page;
|
|
182
|
+
b.hidden = !hits.some((s) => s.dataset.page === b.dataset.page);
|
|
183
|
+
on ? b.setAttribute("aria-current", "page") : b.removeAttribute("aria-current");
|
|
184
|
+
});
|
|
185
|
+
$("pbody").querySelectorAll<HTMLElement>(".snavg").forEach((g) => (g.hidden = !g.querySelector("button:not([hidden])")));
|
|
151
186
|
};
|
|
187
|
+
// The page goes in the address, without a history step per page: Back to app leaves in one.
|
|
188
|
+
const pick = (id) => {
|
|
189
|
+
store.setPage = id;
|
|
190
|
+
history.replaceState(null, "", "?view=settings" + (id ? "&page=" + id : ""));
|
|
191
|
+
filter();
|
|
192
|
+
$("pbody").scrollTop = $("smain").scrollTop = 0;
|
|
193
|
+
};
|
|
194
|
+
$("pbody").querySelectorAll<HTMLElement>(".snavg button").forEach((b) => (b.onclick = () => pick(b.dataset.page)));
|
|
195
|
+
$("pbody").querySelectorAll<HTMLElement>(".sup").forEach((b) => (b.onclick = () => pick("")));
|
|
196
|
+
// Back where Settings was opened from; arriving by address, Home.
|
|
197
|
+
$("sback").onclick = () => (store.setBack ? history.back() : go("home", true));
|
|
152
198
|
$("sq").oninput = (e) => {
|
|
153
199
|
store.setQ = e.target.value;
|
|
154
200
|
filter();
|
|
@@ -164,6 +210,7 @@ export async function openSettings() {
|
|
|
164
210
|
} else close();
|
|
165
211
|
};
|
|
166
212
|
filter();
|
|
213
|
+
$("smain").scrollTop = top;
|
|
167
214
|
if (hadFocus) {
|
|
168
215
|
const f = $("sq");
|
|
169
216
|
f.focus();
|
|
@@ -211,10 +258,19 @@ export async function openSettings() {
|
|
|
211
258
|
// Re-rendering replaces the arrows, so the one pressed gets focus back.
|
|
212
259
|
const refocus = async (f) => {
|
|
213
260
|
await openSettings();
|
|
214
|
-
if (f && /^s
|
|
261
|
+
if (f && /^s-/.test(f)) $(f)?.focus();
|
|
262
|
+
};
|
|
263
|
+
// A browser choice drawn as joined segments applies on click; a long list steps.
|
|
264
|
+
const choice = (el, vals, on, apply) => {
|
|
265
|
+
if (el.matches(".step")) return stepper(el, vals, on, apply);
|
|
266
|
+
el.querySelectorAll("[data-v]").forEach((b) => (b.onclick = () => {
|
|
267
|
+
apply(b.dataset.v);
|
|
268
|
+
openSettings();
|
|
269
|
+
}));
|
|
215
270
|
};
|
|
216
|
-
|
|
217
|
-
|
|
271
|
+
choice($("th"), ["system", "light", "dark"], cur, setTheme);
|
|
272
|
+
choice($("co"), ["monochrome", "blue"], colour, setColor);
|
|
273
|
+
choice($("mo"), ["system", "full", "reduce"], document.documentElement.dataset.motion || "system", setMotion);
|
|
218
274
|
$("nt").onclick = () => {
|
|
219
275
|
const on = !notifyOn();
|
|
220
276
|
try {
|
|
@@ -223,7 +279,7 @@ export async function openSettings() {
|
|
|
223
279
|
if (on) askNotify();
|
|
224
280
|
setTimeout(openSettings, 300);
|
|
225
281
|
};
|
|
226
|
-
|
|
282
|
+
choice($("ns"), SOUNDS, soundPick(), (v) => {
|
|
227
283
|
try {
|
|
228
284
|
localStorage.setItem("kz-sound", v);
|
|
229
285
|
} catch (e) {}
|
package/web/board/store.ts
CHANGED
|
@@ -27,6 +27,8 @@ export const store = {
|
|
|
27
27
|
setQ: "",
|
|
28
28
|
// Settings' scope: "all" or a project's state dir. Set on opening; never moves the board.
|
|
29
29
|
setScope: "all",
|
|
30
|
+
setPage: null as string | null,
|
|
31
|
+
setBack: false,
|
|
30
32
|
// Settings and the Icebox fill the same panel after a fetch: a fill only lands if no other view
|
|
31
33
|
// or fill started since, or a slow answer paints one page under the other's title.
|
|
32
34
|
pageGen: 0,
|
package/web/board/update.ts
CHANGED
|
@@ -31,7 +31,7 @@ export function updBar() {
|
|
|
31
31
|
d.innerHTML = html`<span>kaizen <b>${upd.latest}</b> is available. You are running ${upd.version}.</span><span class="updact">${news}<button class="btn" id="upd-chk">Check for updates</button><button class="btn pri" id="upd-go">Update kaizen</button></span>`;
|
|
32
32
|
}
|
|
33
33
|
if (ver && ver.failed) d.insertAdjacentHTML("afterbegin", html`<span class="updfail" role="alert">Last update failed: ${ver.failed}</span>`);
|
|
34
|
-
$("pbody").prepend(d);
|
|
34
|
+
($("supd") || $("pbody")).prepend(d);
|
|
35
35
|
const check = $("upd-chk");
|
|
36
36
|
check.onclick = async () => {
|
|
37
37
|
check.disabled = true;
|
package/web/board/views.ts
CHANGED
|
@@ -38,6 +38,7 @@ export function go(v, push) {
|
|
|
38
38
|
markView(v);
|
|
39
39
|
document.body.classList.toggle("paged", v !== "board");
|
|
40
40
|
document.body.classList.toggle("ice", v === "sources");
|
|
41
|
+
document.body.classList.toggle("setv", v === "settings");
|
|
41
42
|
document.body.classList.toggle("termv", v === "terminal");
|
|
42
43
|
const ph = isPhone() && v === "home";
|
|
43
44
|
document.body.classList.toggle("homev", (v === "home" && !ph) || v === "chat");
|
|
@@ -98,7 +99,10 @@ export function initViews() {
|
|
|
98
99
|
a.onclick = (e) => {
|
|
99
100
|
if (e.ctrlKey || e.metaKey || e.shiftKey || e.button) return;
|
|
100
101
|
e.preventDefault();
|
|
101
|
-
if (a.dataset.view === "settings")
|
|
102
|
+
if (a.dataset.view === "settings") {
|
|
103
|
+
store.setQ = "";
|
|
104
|
+
store.setBack = view !== "settings";
|
|
105
|
+
}
|
|
102
106
|
vt(() => go(a.dataset.view, true));
|
|
103
107
|
};
|
|
104
108
|
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { expect, test } from "bun:test";
|
|
2
|
+
import { branchSlug } from "./ws-tabs.ts";
|
|
3
|
+
|
|
4
|
+
test("branchSlug turns plain words into a branch name git accepts", () => {
|
|
5
|
+
for (const [input, want] of [["Fix login bug!", "fix-login-bug"], ["feature/My Thing", "feature/my-thing"], [" ..a..b. ", "a.b"], ["--x--", "x"], ["日本語", ""], ["a.lock", "a-lock"], ["a//b/", "a/b"]]) expect(branchSlug(input)).toBe(want);
|
|
6
|
+
for (const s of ["x".repeat(59) + " y z", "a/.b", "a-/b"]) {
|
|
7
|
+
const r = Bun.spawnSync(["git", "check-ref-format", "--branch", branchSlug(s)]);
|
|
8
|
+
expect(r.exitCode).toBe(0);
|
|
9
|
+
}
|
|
10
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { expect, test } from "bun:test";
|
|
2
|
-
import { agentStatus, agentsHtml, forgetAgents, lineOf, settleIn, toggleOpen, wsAgents, SETTLE_MS, awaiting, dueWord, chosen, loopbackUrl, toOpen, stageKeys, stageTabs, finished, historyOf, liveIn, migrate, pickable, prune, wsKey } from "./ws-tabs.ts";
|
|
2
|
+
import { agentStatus, agentsHtml, forgetAgents, lineOf, settleIn, toggleOpen, wsAgents, SETTLE_MS, awaiting, dueWord, chosen, newRun, loopbackUrl, toOpen, stageKeys, stageTabs, finished, historyOf, liveIn, migrate, pickable, prune, wsKey } from "./ws-tabs.ts";
|
|
3
3
|
|
|
4
4
|
const run = (id: string, status: string, o: any = {}) => ({ kind: "run", state: "/p/.kaizen", id, status, moved: 1, ws: "/p", ...o });
|
|
5
5
|
const wsOf = (c) => c.ws;
|
|
@@ -90,6 +90,13 @@ test("pickable: waiting first, then newest; done+approved, abandoned, archived a
|
|
|
90
90
|
expect(pickable(cs, "/p/.kaizen", "/p/.kaizen/wt/x", wsOf).map((c) => c.id)).toEqual(["f"]);
|
|
91
91
|
});
|
|
92
92
|
|
|
93
|
+
test("newRun: only a listed run not seen yet, first in picker order", () => {
|
|
94
|
+
const live = [run("w", "waiting"), run("b", "building")];
|
|
95
|
+
expect(newRun(live, new Set(["w", "b"]))).toBeUndefined();
|
|
96
|
+
expect(newRun(live, new Set(["w"]))?.id).toBe("b");
|
|
97
|
+
expect(newRun(live, new Set())?.id).toBe("w");
|
|
98
|
+
});
|
|
99
|
+
|
|
93
100
|
test("chosen: the pick stays while pickable or History, else the first, else none", () => {
|
|
94
101
|
const live = [run("w", "waiting"), run("b", "building")],
|
|
95
102
|
hist = [run("d", "done")];
|
|
@@ -179,3 +186,9 @@ test("prune keeps a split node it drops nothing from, so a gutter drag writes to
|
|
|
179
186
|
expect(cut.kids).toEqual(["a", "b"]);
|
|
180
187
|
expect(cut.sizes).toEqual([2, 1]);
|
|
181
188
|
});
|
|
189
|
+
|
|
190
|
+
test("a terminal that carried plan and build is named for the run's stage", () => {
|
|
191
|
+
const c = { kind: "run", column: 2, pty: { all: ["a"], stages: { plan: "a", impl: "a" } } };
|
|
192
|
+
expect(stageTabs(c, "Claude")).toEqual([{ key: "a", title: "Build · Claude" }]);
|
|
193
|
+
expect(stageTabs({ ...c, column: 3 }, "Claude")[0].title).toBe("Review · Claude");
|
|
194
|
+
});
|
package/web/board/ws-tabs.ts
CHANGED
|
@@ -76,6 +76,8 @@ export const pickable = (cards: any[], dir: string, ws: string, wsOfCard) =>
|
|
|
76
76
|
// waiting/newest, else none.
|
|
77
77
|
export const chosen = (live: any[], hist: any[], picked?: string | null, keyOf: (c) => string = (c) => c.id) =>
|
|
78
78
|
[...live, ...hist].find((c) => keyOf(c) === picked) ?? live[0] ?? null;
|
|
79
|
+
// A run the picker lists that this visit has not seen yet: it was just created.
|
|
80
|
+
export const newRun = (live: any[], seen: Set<string>, keyOf: (c) => string = (c) => c.id) => live.find((c) => !seen.has(keyOf(c)));
|
|
79
81
|
|
|
80
82
|
// The terminal the board launched for each stage of a run: plan/impl/review sub-tab -> pty key.
|
|
81
83
|
// plan, impl and review are recorded when the board launches them (the idea's agent once its run
|
|
@@ -102,7 +104,11 @@ export function stageTabs(c, agent: string): { key: string; title: string }[] {
|
|
|
102
104
|
const word = { plan: "Plan", impl: "Build", review: "Review" },
|
|
103
105
|
all: string[] = c?.pty ? c.pty.all ?? [c.pty.key] : [],
|
|
104
106
|
by = new Map(Object.entries(stageKeys(c)).map(([s, k]) => [k, word[s]])),
|
|
105
|
-
free = all.filter((k) => !by.has(k))
|
|
107
|
+
free = all.filter((k) => !by.has(k)),
|
|
108
|
+
now = word[{ 1: "plan", 2: "impl", 3: "review" }[c?.column as number] ?? ""],
|
|
109
|
+
last = all.at(-1);
|
|
110
|
+
// One terminal can carry several stages: the newest staged one is named for where the run is now.
|
|
111
|
+
if (now && last && by.has(last)) by.set(last, now);
|
|
106
112
|
return all.map((key) => ({ key, title: by.has(key) ? `${by.get(key)} · ${agent}` : agent + (free.length > 1 ? " " + (free.indexOf(key) + 1) : "") }));
|
|
107
113
|
}
|
|
108
114
|
|
|
@@ -171,3 +177,8 @@ export function agentsHtml(rows: ARow[], now: number, open: boolean, dir: string
|
|
|
171
177
|
const chips = (["asking", "working", "done"] as Status[]).map((st) => ({ st, rs: rows.filter((r) => r.st === st) })).filter((g) => g.rs.length);
|
|
172
178
|
return html`<div class="wag"><span class="chips">${chips.map((g) => html`<span class="chip">${dot(g.st)}${g.rs.map((r) => html`<button type="button" class="amark" data-term="${r.a.key}" ${at} title="${r.a.name} - ${WORD[g.st]}: open its terminal" aria-label="${r.a.name} - ${WORD[g.st]}: open its terminal">${mark(r.a)}</button>`)}</span>`)}</span>${chev}</div>`;
|
|
173
179
|
}
|
|
180
|
+
|
|
181
|
+
/** A branch name from plain words; empty when nothing usable is left (the caller picks a name). */
|
|
182
|
+
export function branchSlug(text: string): string {
|
|
183
|
+
return text.toLowerCase().trim().replace(/[^a-z0-9/._-]+/g, "-").replace(/\.{2,}/g, ".").replace(/\/{2,}/g, "/").replace(/(^|\/)[-.]+/g, "$1").slice(0, 60).replace(/[-./]+(\/|$)/g, "$1").replace(/\/$/, "").replace(/\.lock(\/|$)/g, "-lock$1");
|
|
184
|
+
}
|
package/web/board.html
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover">
|
|
6
|
-
<script>if(matchMedia("(display-mode:standalone)").matches||navigator.standalone){document.querySelector("meta[name=viewport]").content+=",maximum-scale=1,user-scalable=no";addEventListener("gesturestart",e=>e.preventDefault());if(navigator.standalone){const s=()=>document.documentElement.style.setProperty("--sh",(
|
|
6
|
+
<script>if(matchMedia("(display-mode:standalone)").matches||navigator.standalone){document.querySelector("meta[name=viewport]").content+=",maximum-scale=1,user-scalable=no";addEventListener("gesturestart",e=>e.preventDefault());if(navigator.standalone){const s=()=>{document.documentElement.style.setProperty("--sh",(innerWidth>innerHeight?Math.min:Math.max)(screen.width,screen.height)+"px");scrollTo(0,0)},r=()=>{s();setTimeout(s,400)};s();addEventListener("resize",r);addEventListener("orientationchange",r)}}</script>
|
|
7
7
|
<title>kaizen</title>
|
|
8
8
|
<link rel="manifest" href="/manifest.webmanifest">
|
|
9
|
-
<meta name="theme-color" content="#
|
|
10
|
-
<meta name="theme-color" content="#
|
|
9
|
+
<meta name="theme-color" content="#f7f7f7" media="(prefers-color-scheme: light)">
|
|
10
|
+
<meta name="theme-color" content="#121212" media="(prefers-color-scheme: dark)">
|
|
11
11
|
<meta name="mobile-web-app-capable" content="yes">
|
|
12
12
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
13
13
|
<meta name="apple-mobile-web-app-title" content="kaizen">
|
|
@@ -16,12 +16,16 @@
|
|
|
16
16
|
<link rel="icon" type="image/png" href="/logo.png">
|
|
17
17
|
<link rel="apple-touch-icon" href="/logo.png">
|
|
18
18
|
<style>
|
|
19
|
-
:
|
|
20
|
-
|
|
21
|
-
:root[data-theme=
|
|
19
|
+
/* Colour: monochrome by default; ok, warn and danger keep their hue because they carry meaning. data-color=blue is the navy palette (kz-color). */
|
|
20
|
+
:root{--bg:#f7f7f7;--bg-2:#fff;--line:#dedede;--ink:#171717;--ink-hi:#171717;--dim:#666;--accent:#171717;--run:#525252;--ok:#1f9d55;--warn:#a8720a;--danger:#c8322f;--on-accent:#fff;color-scheme:light}
|
|
21
|
+
@media(prefers-color-scheme:dark){:root:not([data-theme=light]){--bg:#121212;--bg-2:#1a1a1a;--line:#2e2e2e;--ink:#ededed;--ink-hi:#fafafa;--dim:#a0a0a0;--accent:#ededed;--run:#c4c4c4;--ok:#5fd28a;--warn:#e6b450;--danger:#e85050;--on-accent:#121212;color-scheme:dark}}
|
|
22
|
+
:root[data-theme=dark]{--bg:#121212;--bg-2:#1a1a1a;--line:#2e2e2e;--ink:#ededed;--ink-hi:#fafafa;--dim:#a0a0a0;--accent:#ededed;--run:#c4c4c4;--ok:#5fd28a;--warn:#e6b450;--danger:#e85050;--on-accent:#121212;color-scheme:dark}
|
|
23
|
+
:root[data-color=blue]{--bg:#f6f8fc;--bg-2:#fff;--line:#d9e0ee;--ink:#0c162f;--ink-hi:#0c162f;--dim:#5b6b8c;--accent:#2d50a5;--run:#0f8fa3;--on-accent:#fff;color-scheme:light}
|
|
24
|
+
@media(prefers-color-scheme:dark){:root[data-color=blue]:not([data-theme=light]){--bg:#0c162f;--bg-2:#121e3c;--line:#22305a;--ink:#eef2fa;--ink-hi:#deeeff;--dim:#96aacd;--accent:#486ed9;--run:#4fd6e6;--on-accent:#fff;color-scheme:dark}}
|
|
25
|
+
:root[data-color=blue][data-theme=dark]{--bg:#0c162f;--bg-2:#121e3c;--line:#22305a;--ink:#eef2fa;--ink-hi:#deeeff;--dim:#96aacd;--accent:#486ed9;--run:#4fd6e6;--on-accent:#fff;color-scheme:dark}
|
|
22
26
|
*{box-sizing:border-box}
|
|
23
27
|
/* Shape, type and depth. --shade is the one shadow colour, themed like the rest. */
|
|
24
|
-
:root{--r:4px;--r-s:4px;--r-pill:999px;--font:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",sans-serif;--mono:ui-monospace,"JetBrains Mono","Cascadia Code","SF Mono",Menlo,Consolas,monospace;--
|
|
28
|
+
:root{--r:4px;--r-s:4px;--r-pill:999px;--font:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",sans-serif;--mono:ui-monospace,"JetBrains Mono","Cascadia Code","SF Mono",Menlo,Consolas,monospace;--hover:color-mix(in srgb,var(--dim) 12%,transparent);--shade:rgb(0 0 0/.08);--shadow-1:0 1px 2px var(--shade);--shadow-2:0 0 0 1px var(--shade),0 8px 24px -6px var(--shade);--canvas:color-mix(in srgb,var(--bg) 95.5%,var(--ink));--row:28px;--row-h:32px;--ico:14px;--ico-s:12px;--btn-xs:24px;--btn-s:32px;--btn:36px;--tabbar:36px;--pane-h:24px;--fs-xs:11px;--fs-s:12px;--fs:13px;--fs-l:14px;--gap:6px;--padx:8px}
|
|
25
29
|
@media(prefers-color-scheme:dark){:root:not([data-theme=light]){--shade:rgb(0 0 0/.45);--canvas:color-mix(in srgb,var(--bg) 70%,black)}}
|
|
26
30
|
:root[data-theme=dark]{--shade:rgb(0 0 0/.45);--canvas:color-mix(in srgb,var(--bg) 70%,black)}
|
|
27
31
|
body{margin:0;background:var(--canvas);color:var(--ink);font:13px/1.5 var(--font);-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;height:100vh;height:100dvh;overflow:hidden;display:flex}
|
|
@@ -417,9 +421,9 @@ dialog.onb::backdrop,dialog.onb-ask::backdrop{background:rgb(0 0 0/.55);backdrop
|
|
|
417
421
|
.onb-card.th .cap b{display:inline-flex;align-items:center;gap:6px;font-weight:500}.onb-card.th .cap b svg{width:14px;height:14px}
|
|
418
422
|
.onb-card.th .cap small{display:inline}
|
|
419
423
|
.pv{display:flex;height:84px;border-radius:6px;overflow:hidden;border:1px solid var(--line)}
|
|
420
|
-
.pv i{display:block}.pv.dark{background:#
|
|
424
|
+
.pv i{display:block}.pv.dark{background:#121212}.pv.light{background:#f7f7f7}
|
|
421
425
|
.pv .sb{width:30%;background:rgb(128 140 170/.22)}
|
|
422
|
-
.pv.sys{background:linear-gradient(90deg,#
|
|
426
|
+
.pv.sys{background:linear-gradient(90deg,#121212 50%,#f7f7f7 50%)}
|
|
423
427
|
.pv .ln{align-self:flex-start;margin:14px 0 0 10px;height:5px;width:36%;border-radius:3px;background:rgb(128 140 170/.45)}
|
|
424
428
|
.pv .ln.s{width:22%;margin-left:-36%;margin-top:26px}
|
|
425
429
|
.onb-panel{border:1px solid var(--line);border-radius:10px;padding:14px;display:flex;flex-direction:column;gap:12px}.onb-panel p{margin:0;font-size:var(--fs);color:var(--dim)}
|
|
@@ -436,6 +440,7 @@ dialog.onb-ask{border:1px solid var(--line);background:var(--bg);color:var(--ink
|
|
|
436
440
|
dialog.onb-ask h3{margin:0 0 4px;font-size:16px;color:var(--ink-hi)}dialog.onb-ask p{margin:0 0 16px;font-size:var(--fs);color:var(--dim)}
|
|
437
441
|
@media(max-width:640px){dialog.onb{width:100vw;height:100dvh;max-width:none;max-height:none;border-radius:0}dialog.onb[open]{padding:18px 18px 12px}.onb-grid,.onb-themes{grid-template-columns:1fr 1fr}.onb-main h2{font-size:24px}.onb-ft kbd{display:none}}
|
|
438
442
|
@media(prefers-reduced-motion:reduce){.onb-prog button{transition:none}}
|
|
443
|
+
dialog.kz.wsnew{width:min(576px,calc(100vw - 32px))}dialog.wsnew .inl{gap:12px;max-height:85dvh;overflow-y:auto}dialog.wsnew .wsfrom{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:-6px}dialog.wsnew .wsfrom i{font-style:normal;opacity:.7}dialog.wsnew .wsbase{display:flex;align-items:center;gap:4px;font-size:12px;color:var(--dim);min-width:0}dialog.wsnew .wsbase select{width:auto;max-width:200px;border:0;background:none;color:var(--ink);font-size:12px;padding:2px}dialog.wsnew .wsadv summary{cursor:pointer;font-size:12px;color:var(--dim);padding:2px 0}dialog.wsnew .wsadv[open] summary{margin-bottom:8px}dialog.wsnew .err:empty{display:none}dialog.wsnew .err:not(:empty){color:var(--danger);border:1px solid color-mix(in srgb,var(--danger) 30%,transparent);background:color-mix(in srgb,var(--danger) 10%,transparent);border-radius:var(--r-s);padding:8px 12px}dialog.wsnew .row{justify-content:flex-end;align-items:center}dialog.wsnew .wskey{order:-1;margin-right:auto;font:11px var(--mono);color:var(--dim)}
|
|
439
444
|
dialog.kz{border:0;padding:0;background:none;width:min(480px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:visible;color:var(--ink)}dialog.kz::backdrop{background:rgb(0 0 0/.45)}dialog.kz>.inl{background:var(--bg);border:1px solid var(--line);border-radius:12px;padding:16px;gap:10px}dialog.kz .inl input,dialog.kz .inl textarea{background:var(--canvas);border-color:var(--line)}dialog.kz .row input{flex:1;min-width:0}dialog.kz #ndc{align-self:flex-start}dialog.kz .btn.opt{display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:8px 12px;text-align:left}dialog.kz .btn.opt small{color:var(--dim)}dialog.kz label.att{display:flex;flex-direction:column;gap:4px}dialog.kz label.att:has(input[type=checkbox]){flex-direction:row;align-items:center}dialog.kz select{background:var(--canvas);border:1px solid var(--line);border-radius:var(--r-s);color:var(--ink);padding:6px 8px;font:inherit}dialog.viewer{width:min(1100px,calc(100vw - 32px));height:calc(100dvh - 32px);background:var(--bg);border-radius:var(--r);display:none;flex-direction:column;overflow:hidden}dialog.viewer[open]{display:flex}.viewer-hd{display:flex;gap:12px;align-items:center;padding:8px 12px;border-bottom:1px solid var(--line)}.viewer-hd span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}dialog.viewer img{flex:1;min-height:0;width:100%;object-fit:contain}dialog.viewer iframe{flex:1;border:0;width:100%;background:#fff}
|
|
440
445
|
.inl .run-actions{display:grid;gap:8px}.inl .run-actions .row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.inl .run-actions .pri{grid-column:1/-1}
|
|
441
446
|
.notes{display:flex;flex-direction:column;gap:8px}
|
|
@@ -736,6 +741,40 @@ aside .foot .more .menu-pop{left:0;right:auto;top:auto;bottom:calc(100% + 4px)}.
|
|
|
736
741
|
.sq{position:sticky;top:-24px;z-index:1;background:var(--bg);padding:24px 0 12px;margin:-24px 0 4px;border-bottom:1px solid var(--line)}.sq input{width:100%;max-width:none}.sq+.sg{margin-top:16px}
|
|
737
742
|
.sjump{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}.sjump button{padding:3px 10px;border:1px solid var(--line);border-radius:var(--r-pill);font-size:12px;color:var(--dim)}.sjump button:hover{background:var(--hover);color:var(--ink)}
|
|
738
743
|
.snone{color:var(--dim);margin-top:20px}
|
|
744
|
+
/* settings, laid out as Orca's: its own sidebar in place of the rail, one page per item, rows in one card */
|
|
745
|
+
@media(min-width:641px){body.setv .rail{display:none}body.setv #panel>header{display:none}body.setv #panel>.body{padding:0}}
|
|
746
|
+
.sset{display:grid;grid-template-columns:280px minmax(0,1fr);height:100%}
|
|
747
|
+
.snav{min-height:0;display:flex;flex-direction:column;background:var(--bg-2);border-right:1px solid var(--line)}
|
|
748
|
+
.sback{display:flex;align-items:center;gap:8px;padding:0 var(--padx);margin:12px;height:var(--btn-s);border-radius:var(--r-s);font-size:13px;color:var(--dim);text-align:left}.sback:hover,.sup:hover{color:var(--ink)}
|
|
749
|
+
.sback svg,.sup svg{width:var(--ico);height:var(--ico);transform:rotate(90deg)}
|
|
750
|
+
.snav .sq{position:static;background:none;margin:0;padding:12px;border-block:1px solid var(--line)}
|
|
751
|
+
.snavs{flex:1;min-height:0;overflow-y:auto;padding:16px 12px}
|
|
752
|
+
.snavg{display:grid;gap:2px;margin-bottom:20px}.snavg[hidden],.snavg button[hidden],.spage[hidden]{display:none}
|
|
753
|
+
.snavg p{margin:0 0 6px;padding:0 12px;font-size:11px;font-weight:500;text-transform:uppercase;letter-spacing:.18em;color:var(--dim)}
|
|
754
|
+
.snavg button{display:flex;align-items:center;gap:8px;height:32px;padding:0 12px;border-radius:var(--r-s);font-size:13px;color:var(--dim);text-align:left;white-space:nowrap;overflow:hidden}
|
|
755
|
+
.snavg button span{overflow:hidden;text-overflow:ellipsis}
|
|
756
|
+
.snavg button svg{flex:none;width:var(--ico);height:var(--ico)}
|
|
757
|
+
.snavg button:hover{background:var(--hover);color:var(--ink)}.snavg button[aria-current]{background:var(--hover);color:var(--ink-hi);font-weight:500}
|
|
758
|
+
.smain{min-width:0;overflow-y:auto;padding:40px 72px 64px}
|
|
759
|
+
.spage{max-width:832px;margin:0 auto}.sup{display:none}
|
|
760
|
+
.spage>header{display:block;padding:0 0 20px;margin-bottom:24px;border-bottom:1px solid var(--line)}
|
|
761
|
+
.spage>header h2{margin:0 0 6px;padding:0;border:0;font-size:24px;font-weight:600;line-height:1.2;color:var(--ink-hi)}
|
|
762
|
+
.spage>header p{margin:0;font-size:14px;line-height:1.7;color:var(--dim)}
|
|
763
|
+
.scard{padding:24px 28px;background:var(--bg-2);border:1px solid var(--line);border-radius:var(--r)}
|
|
764
|
+
.sset .sg{margin:24px 0 4px;padding-top:24px;border-top:1px solid var(--line);font-size:14px;font-weight:600;text-transform:none;letter-spacing:0;color:var(--ink-hi)}
|
|
765
|
+
.sset .sg:first-child,.sset .sg[hidden]:first-child+.sgrp+.sg{margin-top:0;padding-top:0;border-top:0}
|
|
766
|
+
.sset .sgrp{background:none;border:0;border-radius:0;overflow:visible}
|
|
767
|
+
.sset .srow,.sset .srow:not([hidden])~.srow:not([hidden]){margin:0;padding:12px 0;border:0;min-height:0;gap:2px 24px}
|
|
768
|
+
.sset .srow label{align-self:end;font-size:13px;font-weight:500;color:var(--ink-hi)}
|
|
769
|
+
.sset .srow>:nth-child(2){grid-row:1/3}
|
|
770
|
+
.sset .srow .hint{grid-column:1;max-width:none;line-height:1.5}
|
|
771
|
+
.sset .srow input.sel,.sset .srow select.sel{width:240px;height:var(--btn-s);padding:0 10px;border:1px solid var(--line);border-radius:var(--r-s);background-color:var(--bg);color:var(--ink);text-align:left;text-align-last:left}
|
|
772
|
+
.sset .bar{gap:0;padding:0;background:none;border:1px solid var(--line);border-radius:var(--r-s);overflow:hidden}
|
|
773
|
+
.sset .bar button{height:30px;padding:0 12px;border-radius:0;font-size:12px;color:var(--dim)}.sset .bar button+button{border-left:1px solid var(--line)}
|
|
774
|
+
.sset .bar button.on,.sset .bar button.on:hover{background:var(--hover);box-shadow:none;color:var(--ink-hi)}
|
|
775
|
+
.sset .step{background:none;border:1px solid var(--line)}
|
|
776
|
+
#supd:not(:empty){margin-bottom:16px}
|
|
777
|
+
@media(max-width:640px){.sset{display:block;height:auto}.snav{background:none;border:0}.sback{display:none}.snav .sq{border-top:0;padding-inline:16px}.snavs{overflow:visible;padding-inline:4px}.sset:not(.pick) .snav{display:none}.sset.pick .smain>.spage{display:none}.smain{overflow:visible;padding:12px 16px 24px}.sup{display:flex;align-items:center;gap:6px;margin-bottom:12px;font-size:13px;color:var(--dim)}.scard{padding:8px 16px 16px}.sset .srow{grid-template-columns:minmax(0,1fr)}.sset .srow>:nth-child(2){grid-column:1;grid-row:auto;justify-self:start;margin-top:6px;max-width:100%}.sset .srow .hint{grid-row:auto}.sset .srow input.sel,.sset .fpick{width:100%}.sset .fpick input.sel{flex:1;min-width:0}.sset .bar{flex-wrap:wrap}}
|
|
739
778
|
/* a switch: the same <button role="switch"> the save wiring binds to, drawn as a track and a thumb */
|
|
740
779
|
.chk{width:51px;height:31px;flex-shrink:0;border-radius:var(--r-pill);background:color-mix(in srgb,var(--dim) 40%,transparent);position:relative;transition:background .12s}
|
|
741
780
|
.chk::after{content:"";position:absolute;top:2px;left:2px;width:27px;height:27px;border-radius:50%;background:var(--on-accent);box-shadow:0 2px 4px rgb(0 0 0/.25);transition:transform .12s}
|
|
@@ -1070,6 +1109,9 @@ html body.wsb:not(.paged) #board{grid-template-columns:repeat(4,minmax(200px,1fr
|
|
|
1070
1109
|
document.getElementById("fold").onclick=()=>{fold=r.dataset.rail==="min"?"full":"min";try{localStorage.setItem("kz-rail",fold)}catch(e){}rail()};
|
|
1071
1110
|
// Theme: light, dark, or unset for system, in kz-theme. The toggle shows what is on screen and flips it.
|
|
1072
1111
|
const paint=()=>{const d=r.dataset.theme?r.dataset.theme==="dark":os.matches;const b=document.getElementById("themet");if(b){b.dataset.dark=d;b.title=d?"Dark theme: switch to light":"Light theme: switch to dark";b.setAttribute("aria-label",b.title)}};
|
|
1112
|
+
// Colour: unset for monochrome, or blue, in kz-color. kz-theme repaints the terminals and Settings.
|
|
1113
|
+
window.setColor=c=>{if(c==="blue")r.dataset.color=c;else delete r.dataset.color;try{c==="blue"?localStorage.setItem("kz-color",c):localStorage.removeItem("kz-color")}catch(e){}dispatchEvent(new Event("kz-theme"))};
|
|
1114
|
+
try{if(localStorage.getItem("kz-color")==="blue")r.dataset.color="blue"}catch(e){}
|
|
1073
1115
|
window.setTheme=t=>{if(t==="system")delete r.dataset.theme;else r.dataset.theme=t;try{t==="system"?localStorage.removeItem("kz-theme"):localStorage.setItem("kz-theme",t)}catch(e){}paint();dispatchEvent(new Event("kz-theme"))};
|
|
1074
1116
|
try{const t=localStorage.getItem("kz-theme");if(t)r.dataset.theme=t}catch(e){}
|
|
1075
1117
|
// Motion: full, reduce, or unset to follow the system's reduced-motion, in kz-motion.
|