kaizen-agent 1.69.0 → 1.70.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.
@@ -24,6 +24,7 @@ import { drawPick, hidePick, initPick, setOpen } from "./run-pick.ts";
24
24
  import { age } from "./labels.ts";
25
25
  import { go } from "./views.ts";
26
26
  import { isPhone } from "./phone.ts";
27
+ import { annotator } from "./annotate.ts";
27
28
 
28
29
  type Tab = { id: string; kind: "agent" | "shell" | "local" | "preview" | "note" | "wait" | "history"; title: string; key?: string; note?: string; agent?: string };
29
30
  // Per workspace: the extra items opened (localhost, preview, notes, History),
@@ -36,7 +37,7 @@ function splitAt(n: Node, at: string, add: string, dir: "cols" | "rows", before
36
37
  return { ...n, kids: n.kids.map((k) => splitAt(k, at, add, dir, before)) };
37
38
  }
38
39
  // seen: the runs that already opened the Browser on their Preview, so a run does it once.
39
- type Saved = { tabs: Tab[]; hidden: string[]; screens: Screen[]; on: string | null; seen?: string[] };
40
+ type Saved = { tabs: Tab[]; hidden: string[]; hb?: Record<string, number>; screens: Screen[]; on: string | null; seen?: string[] };
40
41
  const ALL: Record<string, Saved> = (() => {
41
42
  try {
42
43
  return JSON.parse(localStorage.getItem("kz-runtabs") || "{}");
@@ -122,6 +123,12 @@ function tabs(): Tab[] {
122
123
  out.push({ id: "sh:" + sh.key, kind: sh.agent ? "agent" : "shell", agent: sh.agent || undefined, title: sh.title, key: sh.key });
123
124
  // Opened by hand: History, localhost, Preview, notes.
124
125
  const mine = s.tabs.map((t) => (t.kind === "local" ? { ...t, title: "Browser" } : t)); // "local" was saved before the rename
126
+ // A closed agent tab stays hidden only for that agent: one started again under the same key (a resume) is a new
127
+ // agent (born differs) and the sidebar lists it, so its tab comes back.
128
+ for (const a of store.S.agents ?? []) {
129
+ const id = "agent:" + a.key;
130
+ if (s.hb && id in s.hb && s.hb[id] !== (a.born ?? 0)) (s.hidden = s.hidden.filter((h) => h !== id)), delete s.hb[id], save();
131
+ }
125
132
  const all = [...out.filter((t) => !s.hidden.includes(t.id)), ...mine];
126
133
  return all.filter((t, i) => all.findIndex((x) => x.id === t.id) === i);
127
134
  }
@@ -218,7 +225,10 @@ function showTerm() {
218
225
  // and the ask lapses after a while so a launch that never came up cannot pull focus later.
219
226
  const w = store.wantPty && Date.now() - store.wantPty.at < 20_000 ? store.wantPty.key : null;
220
227
  if (store.wantPty && !w) store.wantPty = null;
221
- const t = tabs().find((x) => x.key === (wantTerm || w));
228
+ // Asked for by name (the sidebar's mark, a launch): shown even if its tab was closed before.
229
+ const want = wantTerm || w, s = saved();
230
+ if (want) s.hidden = s.hidden.filter((h) => h !== "agent:" + want && h !== "sh:" + want);
231
+ const t = tabs().find((x) => x.key === want);
222
232
  wantTerm = null;
223
233
  if (t && store.wantPty?.key === t.key) store.wantPty = null;
224
234
  return !!t && (show(t.id), true);
@@ -444,7 +454,7 @@ function browser(el: HTMLElement) {
444
454
  fwd: string[] = [];
445
455
  el.insertAdjacentHTML(
446
456
  "beforeend",
447
- String(html`<form class="urlbar"><button type="button" data-b="back" title="Back" aria-label="Back">‹</button><button type="button" data-b="fwd" title="Forward" aria-label="Forward">›</button><button type="button" data-b="reload" title="Reload" aria-label="Reload">${ico("refresh")}</button><input class="sel" aria-label="Address" spellcheck="false" value="${url}"><a class="rwin" data-b="tab" target="_blank" rel="noopener" href="${url}" title="Open in a new browser tab">${ico("popout")}<span>New tab</span></a></form>`),
457
+ String(html`<form class="urlbar"><button type="button" data-b="back" title="Back" aria-label="Back">‹</button><button type="button" data-b="fwd" title="Forward" aria-label="Forward">›</button><button type="button" data-b="reload" title="Reload" aria-label="Reload">${ico("refresh")}</button><input class="sel" aria-label="Address" spellcheck="false" value="${url}"><button type="button" class="rwin" data-b="ann" title="Pick elements on this page and send notes to the agent (localhost pages)">${ico("eye")}<span>Annotate</span></button><a class="rwin" data-b="tab" target="_blank" rel="noopener" href="${url}" title="Open in a new browser tab">${ico("popout")}<span>New tab</span></a></form>`),
448
458
  );
449
459
  const f = el.querySelector("form")!,
450
460
  inp = f.querySelector("input")!,
@@ -460,7 +470,27 @@ function browser(el: HTMLElement) {
460
470
  const note = document.createElement("p");
461
471
  note.className = "rnote";
462
472
  const far = "This page is on the computer running kaizen; from this device localhost is the device itself. Use Open in browser on that computer.";
463
- el.append(frame, note);
473
+ // The annotator (annotate.ts): its toolbar sits above this row, its notes list beside the frame.
474
+ const row = document.createElement("div");
475
+ row.className = "annrow";
476
+ row.append(frame);
477
+ el.append(row, note);
478
+ const annBtn = f.querySelector<HTMLButtonElement>("[data-b=ann]")!;
479
+ annBtn.hidden = !loopback; // from a phone, localhost is the phone itself
480
+ const ann = annotator({
481
+ host: el, frame, wsKey: ctx!.k, button: annBtn,
482
+ run: () => (card?.id ? { dir: card.state, id: card.id } : null),
483
+ reload: () => go(url, false),
484
+ // The framed page navigated on its own: show its address, do not load it again.
485
+ onLocation: (u) => {
486
+ if (u === url) return;
487
+ back.push(url), (fwd.length = 0);
488
+ url = u;
489
+ inp.value = u;
490
+ if (ext) ext.href = u;
491
+ try { localStorage.setItem(k, u); } catch {}
492
+ },
493
+ });
464
494
  const go = (u, push = true) => {
465
495
  if (push && url !== u) back.push(url), (fwd.length = 0);
466
496
  url = u;
@@ -474,7 +504,17 @@ function browser(el: HTMLElement) {
474
504
  note.hidden = !hide;
475
505
  note.textContent = far;
476
506
  if (hide) return void expose(u);
477
- frame.src = u;
507
+ // Annotate on: a loopback page is framed through the board's proxy (annotate-proxy.ts), which adds the picker.
508
+ const seq = ++nav;
509
+ void ann.open(u).then((via) => {
510
+ if (seq !== nav) return;
511
+ frame.src = via ?? u;
512
+ if (via) return;
513
+ frameCheck(u);
514
+ });
515
+ };
516
+ let nav = 0;
517
+ const frameCheck = (u: string) => {
478
518
  // Most public sites refuse to be framed (X-Frame-Options / frame-ancestors), and the
479
519
  // browser only shows its own error page. The board asks the site first and says so.
480
520
  void fetch("/frameable?url=" + encodeURIComponent(u))
@@ -515,6 +555,7 @@ function browser(el: HTMLElement) {
515
555
  el.onclick = (e) => {
516
556
  const b = (e.target as Element).closest<HTMLElement>("[data-b]")?.dataset.b;
517
557
  if (b === "win") void openWindow(url);
558
+ else if (b === "ann") ann.toggle();
518
559
  else if (b === "reload") go(url, false);
519
560
  else if (b === "back" && back.length) fwd.push(url), go(back.pop()!, false);
520
561
  else if (b === "fwd" && fwd.length) back.push(url), go(fwd.pop()!, false);
@@ -537,6 +578,15 @@ async function openWindow(u: string) {
537
578
  // The run's Preview: its screenshots (each opens the image viewer on click), with an Open
538
579
  // app link when it names a localhost address. The address is framed only when the Preview
539
580
  // has no images: the dev server a run used is often gone, and a dead frame hides the proof.
581
+ // No run, no `## Preview`: what an agent last showed with `kaizen preview <image|url>` in this workspace.
582
+ async function directPreview(el: HTMLElement) {
583
+ if (!ctx) return false;
584
+ const p = await fetchPreview(ctx.dir, ctx.ws);
585
+ if (!p) return false;
586
+ const u = p.image ? fileUrl(ctx.dir, p.image) : p.url!;
587
+ el.insertAdjacentHTML("beforeend", String(p.image ? html`<div class="rprev"><figure><img src="${u}" alt="Latest change" style="max-width:100%"><figcaption>${p.image.split("/").pop()}</figcaption></figure></div>` : html`<iframe class="rframe" title="Preview" src="${u}"></iframe>`));
588
+ return true;
589
+ }
540
590
  async function previewPane(el: HTMLElement) {
541
591
  let doc = store.runDoc && store.runDoc.id === card?.id ? store.runDoc : null;
542
592
  if (!doc && card?.kind === "run")
@@ -544,6 +594,8 @@ async function previewPane(el: HTMLElement) {
544
594
  doc = await (await fetch(`/run/${encodeURIComponent(card.id)}?dir=${encodeURIComponent(card.state)}`)).json();
545
595
  } catch {}
546
596
  const pv = doc && preview(doc.impl);
597
+ (el as any).refresh = () => (el.replaceChildren(), void previewPane(el));
598
+ if (!pv && (await directPreview(el))) return;
547
599
  const url = loopbackUrl(pv);
548
600
  const shots = pv && /!\[[^\]]*\]\(/.test(pv);
549
601
  if (url && loopback && !shots) return void el.insertAdjacentHTML("beforeend", String(html`<iframe class="rframe" title="Preview" src="${url}"></iframe>`));
@@ -576,6 +628,9 @@ function addTab(t: Tab) {
576
628
  else if (target) for (const sc of s.screens) sc.tree = prune(sc.tree, (id) => id !== t.id) ?? sc.tree;
577
629
  show(t.id);
578
630
  }
631
+ // Automatic opens (a run's Preview, `kaizen preview`) bring a tab forward only when it is not open yet;
632
+ // an open one just navigates, so the user can leave it.
633
+ const autoTab = (t: Tab) => { if (!saved().tabs.some((x) => x.id === t.id)) addTab(t); };
579
634
  // After an item is added: run screens() (which places it) and show the screen holding it.
580
635
  function show(id: string) {
581
636
  const s = saved();
@@ -700,6 +755,7 @@ async function closeTab(id: string) {
700
755
  a = store.S.agents?.find((x) => x.key === k);
701
756
  if (a?.busy && !confirm("This agent is still working. End it?")) return;
702
757
  s.hidden.push(id);
758
+ (s.hb ||= {})[id] = a?.born ?? 0;
703
759
  await post("/pty/exit", { key: k });
704
760
  load(true);
705
761
  }
@@ -731,6 +787,25 @@ function onMoveMenu(e: Event) {
731
787
  m.style.left = Math.max(8, r.right - m.offsetWidth) + "px";
732
788
  }
733
789
 
790
+ // + makes a new tab; split right/down adds to the tab shown. `n` is a menu item's data-n.
791
+ function openNew(n: string, mode: string) {
792
+ const s = saved();
793
+ target = mode === "tab" || !s.on ? null : { screen: s.on, dir: mode as "cols" | "rows" };
794
+ if (n === "shell") void newPty();
795
+ else if (n.startsWith("agent:")) void newPty(n.slice(6));
796
+ else if (n === "local") addTab({ id: "local", kind: "local", title: "Browser" });
797
+ else if (n === "history") addTab({ id: "history", kind: "history", title: "History" });
798
+ else openPreview();
799
+ }
800
+ // Ctrl+Space r / d: a second terminal like the focused one (same agent, or a shell), split right or down.
801
+ // Anything else (Browser, Preview, notes) has no copy to make, so the menu opens to pick from.
802
+ function likeFocused(): string | null {
803
+ const sc = screens().find((x) => x.id === saved().on);
804
+ const t = sc && tabs().find((x) => x.id === sc.focus);
805
+ if (t?.kind === "shell") return "shell";
806
+ if (t?.kind === "agent") return "agent:" + (t.agent ?? (defAgent || agents[0]?.cmd || ""));
807
+ return null;
808
+ }
734
809
  function wire() {
735
810
  const bar = $("rtabs"),
736
811
  s = saved();
@@ -748,15 +823,8 @@ function wire() {
748
823
  const n = t.closest<HTMLElement>("[data-n]")?.dataset.n;
749
824
  if (n) {
750
825
  const d = t.closest<HTMLDetailsElement>(".radd")!;
751
- const mode = d.dataset.mode;
752
826
  d.open = false;
753
- // + makes a new tab; split right/down adds to the tab shown.
754
- target = mode === "tab" || !s.on ? null : { screen: s.on, dir: mode as "cols" | "rows" };
755
- if (n === "shell") void newPty();
756
- else if (n.startsWith("agent:")) void newPty(n.slice(6));
757
- else if (n === "local") addTab({ id: "local", kind: "local", title: "Browser" });
758
- else if (n === "history") addTab({ id: "history", kind: "history", title: "History" });
759
- else openPreview();
827
+ openNew(n, d.dataset.mode as string);
760
828
  return;
761
829
  }
762
830
  };
@@ -926,11 +994,47 @@ async function autoBrowse() {
926
994
  try {
927
995
  localStorage.setItem("kz-browse:" + k, u);
928
996
  } catch {}
929
- addTab({ id: "local", kind: "local", title: "Browser" });
997
+ autoTab({ id: "local", kind: "local", title: "Browser" });
930
998
  (panes.get("local")?.el as any)?.browseTo?.(u);
931
999
  }
932
1000
  }
933
1001
 
1002
+ // `kaizen preview <url|image>` (cli/preview.ts) wrote what an agent changed: the Browser tab opens
1003
+ // on it, inside the board. Never an outside window. The newest one per workspace opens once; one
1004
+ // older than two minutes at first sight is stale and is only recorded.
1005
+ const previewAt = new Map<string, number>();
1006
+ const fileUrl = (dir: string, image: string) => `${location.origin}/file?dir=${encodeURIComponent(dir)}&p=${encodeURIComponent(image)}`;
1007
+ // The latest preview written for this workspace, or null.
1008
+ async function fetchPreview(dir: string, ws: string) {
1009
+ let p: { url?: string; image?: string; ws?: string; at?: number } = {};
1010
+ try {
1011
+ p = await (await fetch("/preview?dir=" + encodeURIComponent(dir))).json();
1012
+ } catch {}
1013
+ const same = p.ws && (p.ws === ws || p.ws.startsWith(ws + "/") || ws.startsWith(p.ws + "/"));
1014
+ return p.at && same && (p.url || p.image) ? p : null;
1015
+ }
1016
+ async function pollPreview() {
1017
+ if (!ctx) return;
1018
+ const k = ctx.k, dir = ctx.dir;
1019
+ const p = await fetchPreview(dir, ctx.ws);
1020
+ if (!p || ctx?.k !== k || (previewAt.get(k) ?? 0) >= p.at!) return;
1021
+ const first = !previewAt.has(k);
1022
+ previewAt.set(k, p.at!);
1023
+ if (first && Date.now() - p.at! > 120_000) return;
1024
+ if (p.image) {
1025
+ // A screenshot belongs in Preview; a live page in the Browser.
1026
+ autoTab({ id: "preview", kind: "preview", title: "Preview" });
1027
+ (panes.get("preview")?.el as any)?.refresh?.();
1028
+ return;
1029
+ }
1030
+ try {
1031
+ localStorage.setItem("kz-browse:" + k, p.url!);
1032
+ } catch {}
1033
+ autoTab({ id: "local", kind: "local", title: "Browser" });
1034
+ (panes.get("local")?.el as any)?.browseTo?.(p.url!);
1035
+ }
1036
+ setInterval(() => void pollPreview(), 3000);
1037
+
934
1038
  // A phone's run sheet: drag it down from anywhere its content is at the top, or tap outside it.
935
1039
  function initSheet() {
936
1040
  const p = $("panel"),
@@ -1004,6 +1108,8 @@ function paneKey(k: string) {
1004
1108
  return;
1005
1109
  }
1006
1110
  const mode = { c: "tab", r: "cols", d: "rows" }[k];
1111
+ const same = mode && mode !== "tab" && !noPty ? likeFocused() : null;
1112
+ if (same) return void openNew(same, mode!);
1007
1113
  if (mode) {
1008
1114
  const add = $("rtabs").querySelector<HTMLDetailsElement>(`.radd[data-mode=${mode}]`);
1009
1115
  if (add) add.open = true;
@@ -1040,7 +1146,7 @@ function keyHint(on: boolean) {
1040
1146
  const h = document.createElement("div");
1041
1147
  h.id = "keyhint";
1042
1148
  h.setAttribute("role", "status");
1043
- const keys = [["←↓↑→", "pane"], ["1-9", "tab"], ["n p", "next, prev"], ["c", "new tab"], ["r", "split right"], ["d", "split down"], ["x", "close pane"], ["?", "all keys"]];
1149
+ const keys = [["←↓↑→", "pane"], ["1-9", "tab"], ["n p", "next, prev"], ["c", "new tab"], ["r", "split right, same as this pane"], ["d", "split down, same as this pane"], ["x", "close pane"], ["?", "all keys"]];
1044
1150
  h.innerHTML = String(html`${keys.map(([k, t]) => html`<span><kbd>${k}</kbd>${t}</span>`)}`);
1045
1151
  document.body.append(h);
1046
1152
  }
@@ -1143,3 +1249,32 @@ export function openWorkspace(c) {
1143
1249
  markCurrent();
1144
1250
  go("run");
1145
1251
  }
1252
+
1253
+ // The run view's right panel: drag its left edge to resize it; the width is kept for next
1254
+ // time and a double-click puts it back to the default.
1255
+ const GRIP_KEY = "kz-rpanel-w", GRIP_MIN = 260;
1256
+ function initGrip() {
1257
+ const grip = document.getElementById("rgrip"), panel = document.getElementById("panel"), root = document.documentElement;
1258
+ if (!grip || !panel) return;
1259
+ const set = (w: number) => root.style.setProperty("--rpanel-w", `${Math.round(Math.min(Math.max(GRIP_MIN, innerWidth * 0.6), Math.max(GRIP_MIN, w)))}px`);
1260
+ try { const w = Number(localStorage.getItem(GRIP_KEY)); if (w) set(w); } catch { /* private window: default width */ }
1261
+ grip.onpointerdown = (e) => {
1262
+ e.preventDefault();
1263
+ grip.setPointerCapture(e.pointerId);
1264
+ document.body.classList.add("rdrag");
1265
+ const move = (m: PointerEvent) => set(panel.getBoundingClientRect().right - m.clientX);
1266
+ const up = () => {
1267
+ grip.removeEventListener("pointermove", move);
1268
+ document.body.classList.remove("rdrag");
1269
+ try { localStorage.setItem(GRIP_KEY, String(Math.round(panel.getBoundingClientRect().width))); } catch { /* not kept */ }
1270
+ };
1271
+ grip.addEventListener("pointermove", move);
1272
+ grip.addEventListener("pointerup", up, { once: true });
1273
+ grip.addEventListener("pointercancel", up, { once: true });
1274
+ };
1275
+ grip.ondblclick = () => {
1276
+ root.style.removeProperty("--rpanel-w");
1277
+ try { localStorage.removeItem(GRIP_KEY); } catch { /* nothing kept */ }
1278
+ };
1279
+ }
1280
+ if (typeof document !== "undefined") initGrip();
@@ -294,7 +294,7 @@ dialog.gs::backdrop{background:rgb(0 0 0/.35)}
294
294
  .gs-w{margin-left:auto;padding-left:8px;color:var(--dim);font-size:var(--fs-xs,11px);flex:none}
295
295
  .gs-none{padding:14px 8px;text-align:center;color:var(--dim);font-size:var(--fs-s,12px)}
296
296
  .gs-live{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
297
- @media(max-width:640px){.rail a.it.gs-it{display:none}}`;
297
+ @media(max-width:640px){.rail a.it.gs-it{order:4}}`;
298
298
 
299
299
  export function initSearch() {
300
300
  const st = document.createElement("style");
package/web/board.html CHANGED
@@ -139,13 +139,13 @@ body .rail a.upd::after{left:calc(50% + 6px);top:4px}body .toast{left:16px;botto
139
139
  [data-rail=min] .rail .psec{padding:0;margin:12px 0 2px;flex-direction:column}[data-rail=min] .rail .rbot{flex-direction:column}
140
140
  [data-rail=min] .plist .proj{justify-content:center;margin:10px 0 4px;padding:0}[data-rail=min] .plist .row{grid-template-columns:14px;justify-content:center;padding:0}
141
141
  @media(max-width:640px){.rail .psec,.rail .plist,.rail .rib{display:none}.rail .rbot,[data-rail=min] .rail .rbot{display:contents}.rail a.it[data-view=tasks]{order:3}.rail a.it[data-view=board]{order:4}.rail a.it .n,.rail a.it .srcs{display:none}}
142
- /* phones: Home, Chat, Runs, Settings. The board, Tasks and the Icebox are set up on a computer (web/board/phone.ts) */
142
+ /* phones: Home, Chat, Runs, Search (Settings is a Search result). The board, Tasks and the Icebox are set up on a computer (web/board/phone.ts) */
143
143
  @media(min-width:641px){.rail .rbot .lbl{display:none}.rail .rbot a.it{flex:none;width:var(--btn-xs);height:var(--btn-xs);padding:0;justify-content:center;margin-right:auto}[data-rail=min] .rail .rbot a.it{width:var(--btn-s);height:var(--btn-s);margin-right:0}}
144
144
  .rail a.it.ponly,#phome{display:none}
145
145
  @media(max-width:640px){
146
146
  .rail a.it:is([data-view=board],[data-view=tasks],[data-view=sources]),#foot,#ctx-open,body .rail .rbot .rib{display:none!important}
147
147
  .rail a.it.ponly{display:flex}
148
- .rail a.it[data-view=home]{order:1}.rail a.it[data-view=chat]{order:2}.rail a.it[data-view=device]{order:3}.rail a.it[data-view=settings]{order:4}
148
+ .rail a.it[data-view=home]{order:1}.rail a.it[data-view=chat]{order:2}.rail a.it[data-view=device]{order:3}.rail a.it[data-view=settings]{display:none}
149
149
  .rail,[data-rail=min] .rail{padding:8px 8px max(2px,calc(env(safe-area-inset-bottom) - 8px));border-top:1px solid color-mix(in srgb,var(--line) 70%,transparent)}
150
150
  .rail a.it,[data-rail=min] .rail a.it{min-height:46px;gap:3px;font-size:10.5px;letter-spacing:.01em}
151
151
  .rail a.it svg{width:44px;height:26px;padding:4px 12px;box-sizing:border-box;border-radius:13px;transition:background .15s}
@@ -561,9 +561,9 @@ body.runv #runv{grid-area:1/1;display:flex;flex-direction:column;min-width:0;min
561
561
  .rpane>.term{flex:1;min-height:0;padding:6px 0 0 8px}
562
562
  .rframe{flex:1;min-height:0;width:100%;border:0;background:var(--bg-2)}
563
563
  .urlbar{display:flex;gap:6px;align-items:center;padding:6px 10px;border-bottom:1px solid var(--line)}.urlbar input{flex:1;min-width:0;font:12px var(--mono);border-radius:var(--r-s)}.urlbar button{width:28px;height:28px;display:grid;place-items:center;border-radius:var(--r-s);color:var(--dim);font-size:16px}.urlbar button:hover{background:var(--hover)}.urlbar svg{width:15px;height:15px}
564
- .rpane:not(.split)>.ph{display:none}.rnote,.rnone{color:var(--dim);padding:16px;margin:0}#rpanes{grid-template-columns:minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr)!important}#rpanes>.rtree,#rpanes>.rpane{grid-area:1/1}.rtree{display:flex;min-width:0;min-height:0}.rtree.rows{flex-direction:column}.rtree>*{min-width:0;min-height:0}.ph>span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}.pmove>summary{list-style:none;cursor:pointer;padding:0 4px;border-radius:var(--r-s)}.pmove>summary::-webkit-details-marker{display:none}.pmove>summary:hover{background:var(--hover);color:var(--ink)}.pmove .menu-pop{position:fixed;z-index:40;right:auto;bottom:auto;width:max-content;min-width:200px;max-width:320px}.pmove .mh{display:block;padding:4px 10px;font-size:11px;color:var(--dim);font-weight:500}.ph button{background:none;border:0;color:inherit;cursor:pointer}.rdrop{box-shadow:inset 0 -2px 0 var(--accent)!important;background:var(--hover)!important}.rpane.rdrop-l{box-shadow:inset 3px 0 0 var(--accent)}.rpane.rdrop-r{box-shadow:inset -3px 0 0 var(--accent)}.rpane.rdrop-t{box-shadow:inset 0 3px 0 var(--accent)}.rpane.rdrop-b{box-shadow:inset 0 -3px 0 var(--accent)}.rgut{flex:0 0 1px;background:var(--line);position:relative;z-index:2}.rdrag iframe{pointer-events:none}.rgut::after{content:"";position:absolute;inset:0 -4px;cursor:col-resize}.rtree.rows>.rgut::after{inset:-4px 0;cursor:row-resize}.rpane.split.focus{outline:1px solid var(--accent);outline-offset:-1px}.rwin{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px;border:1px solid var(--line);border-radius:var(--r-s);background:none;color:var(--ink);font:inherit;font-size:12px;cursor:pointer;text-decoration:none;white-space:nowrap}.rwin:hover{background:var(--hover)}.rwin svg{width:14px;height:14px}.rnote b{display:block;color:var(--ink);margin-bottom:4px}.rnote .rwin{margin:8px 6px 0 0;vertical-align:middle}.urlbar button.rwin{width:auto;height:28px;padding:0 10px;display:inline-flex;font-size:12px;color:var(--ink)}.shots{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:12px;margin-top:12px}.shots figure{margin:0;border:1px solid var(--line);border-radius:var(--r-xs);overflow:hidden;background:var(--bg-2)}.shots img{display:block;width:100%;height:180px;object-fit:cover;object-position:top;border-radius:0}.shots figcaption{padding:6px 10px;font-size:12px;color:var(--dim);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rprev{overflow:auto;padding:16px 20px}.rprev img{max-width:100%;border-radius:var(--r-xs)}
564
+ .rpane:not(.split)>.ph{display:none}.annrow{flex:1;min-height:0;display:flex}.annrow>.rframe{flex:1;min-width:0;width:auto}.annbar{display:flex;flex-wrap:wrap;gap:6px;align-items:center;padding:4px 10px;border-bottom:1px solid var(--line);font-size:12px;color:var(--dim)}.annbar[hidden],.annlist[hidden],.urlbar [hidden]{display:none}.annbar .rwin.on,.urlbar .rwin.on{background:var(--accent);color:var(--on-accent);border-color:var(--accent)}.annbar .rwin[disabled]{opacity:.45;cursor:default}.annbar .sep{width:1px;height:18px;background:var(--line)}.annlist{flex:0 0 280px;min-width:0;overflow:auto;border-left:1px solid var(--line);padding:8px;display:flex;flex-direction:column;gap:8px;font-size:12px}.annempty{color:var(--dim);margin:8px 4px}.ann{display:flex;gap:8px;align-items:flex-start;border:1px solid var(--line);border-radius:var(--r-s);padding:8px}.ann.flash{outline:2px solid var(--accent)}.ann>button{background:none;border:0;color:var(--dim);cursor:pointer;font-size:16px;line-height:1}.annn{flex:0 0 22px;height:22px;border-radius:50%;background:var(--accent);color:var(--on-accent);display:grid;place-items:center;font-size:12px}.annn.g{background:#34c759;color:#fff}.annb{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}.annc{color:var(--ink);white-space:pre-wrap;word-break:break-word;outline:0;border-radius:3px}.annc:focus{background:var(--hover)}.annb code{color:var(--dim);font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.annb small{color:var(--dim)}.annb img{max-width:100%;border:1px solid var(--line);border-radius:var(--r-xs)}.annset{display:flex;flex-direction:column;gap:6px;border:1px solid var(--line);border-radius:var(--r-s);padding:8px}.annset label{display:flex;gap:6px;align-items:center;justify-content:space-between}@media(max-width:640px){.annlist{flex-basis:160px}}.rnote,.rnone{color:var(--dim);padding:16px;margin:0}#rpanes{grid-template-columns:minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr)!important}#rpanes>.rtree,#rpanes>.rpane{grid-area:1/1}.rtree{display:flex;min-width:0;min-height:0}.rtree.rows{flex-direction:column}.rtree>*{min-width:0;min-height:0}.ph>span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis}.pmove>summary{list-style:none;cursor:pointer;padding:0 4px;border-radius:var(--r-s)}.pmove>summary::-webkit-details-marker{display:none}.pmove>summary:hover{background:var(--hover);color:var(--ink)}.pmove .menu-pop{position:fixed;z-index:40;right:auto;bottom:auto;width:max-content;min-width:200px;max-width:320px}.pmove .mh{display:block;padding:4px 10px;font-size:11px;color:var(--dim);font-weight:500}.ph button{background:none;border:0;color:inherit;cursor:pointer}.rdrop{box-shadow:inset 0 -2px 0 var(--accent)!important;background:var(--hover)!important}.rpane.rdrop-l{box-shadow:inset 3px 0 0 var(--accent)}.rpane.rdrop-r{box-shadow:inset -3px 0 0 var(--accent)}.rpane.rdrop-t{box-shadow:inset 0 3px 0 var(--accent)}.rpane.rdrop-b{box-shadow:inset 0 -3px 0 var(--accent)}.rgut{flex:0 0 1px;background:var(--line);position:relative;z-index:2}.rdrag iframe{pointer-events:none}.rgut::after{content:"";position:absolute;inset:0 -4px;cursor:col-resize}.rtree.rows>.rgut::after{inset:-4px 0;cursor:row-resize}.rpane.split.focus{outline:1px solid var(--accent);outline-offset:-1px}.rwin{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px;border:1px solid var(--line);border-radius:var(--r-s);background:none;color:var(--ink);font:inherit;font-size:12px;cursor:pointer;text-decoration:none;white-space:nowrap}.rwin:hover{background:var(--hover)}.rwin svg{width:14px;height:14px}.rnote b{display:block;color:var(--ink);margin-bottom:4px}.rnote .rwin{margin:8px 6px 0 0;vertical-align:middle}.urlbar button.rwin{width:auto;height:28px;padding:0 10px;display:inline-flex;font-size:12px;color:var(--ink)}.shots{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:12px;margin-top:12px}.shots figure{margin:0;border:1px solid var(--line);border-radius:var(--r-xs);overflow:hidden;background:var(--bg-2)}.shots img{display:block;width:100%;height:180px;object-fit:cover;object-position:top;border-radius:0}.shots figcaption{padding:6px 10px;font-size:12px;color:var(--dim);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rprev{overflow:auto;padding:16px 20px}.rprev img{max-width:100%;border-radius:var(--r-xs)}
565
565
  .rempty{margin:auto;text-align:center;color:var(--dim)}
566
- body.runv #panel{grid-area:1/2;position:relative!important;inset:auto!important;transform:none!important;visibility:visible!important;transition:width .18s;overflow:hidden;width:340px!important;max-width:none;z-index:auto!important;border:0;box-shadow:none;background:var(--canvas);display:grid;grid-template-columns:minmax(0,1fr) 44px;grid-template-rows:auto minmax(0,1fr) auto}
566
+ body.runv #panel{grid-area:1/2;position:relative!important;inset:auto!important;transform:none!important;visibility:visible!important;transition:width .18s;overflow:hidden;width:var(--rpanel-w,340px)!important;max-width:none;z-index:auto!important;border:0;box-shadow:none;background:var(--canvas);display:grid;grid-template-columns:minmax(0,1fr) 44px;grid-template-rows:auto minmax(0,1fr) auto}
567
567
  body.runv #panel>header{grid-area:1/1;border:0;padding:14px 12px 12px 18px}body.runv #pfoot{border:0;padding:12px 12px 14px 18px}
568
568
  body.runv #psub{display:block}body.runv #pbody{padding:8px 12px 12px 18px}body.runv #panel>header .t{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:8px}body.runv #psub{display:contents}.rmeta{font-size:11px;color:var(--dim);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:120px}.rprog{grid-column:1/-1;display:flex;align-items:center;gap:10px;margin-top:8px;font-size:11px;color:var(--dim)}.rprog span{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:50%}.rprog b{position:relative;flex:1;height:3px;border-radius:2px;background:var(--line);overflow:hidden}.rprog i{position:absolute;inset:0 auto 0 0;border-radius:2px;background:var(--run);transition:width .6s cubic-bezier(.2,.8,.2,1)}.rprog.s-running i::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent,rgba(255,255,255,.55),transparent);animation:rsweep 1.6s ease-in-out infinite}.rprog.s-waiting i{background:var(--warn);animation:rpulse 1.8s ease-in-out infinite}.rprog.s-waiting span{color:var(--warn)}.rprog.s-stalled i{background:var(--danger)}.rprog.s-done i{background:var(--ok)}@keyframes rsweep{from{transform:translateX(-100%)}to{transform:translateX(100%)}}@keyframes rpulse{50%{opacity:.45}}@media (prefers-reduced-motion:reduce){.rprog i,.rprog i::after{animation:none!important;transition:none}}body.runv #pbody{grid-area:2/1;min-height:0}body.runv #pfoot{grid-area:3/1}
569
569
  body.runv #pclose,body.runv #pterm{display:none}
@@ -599,7 +599,8 @@ body.runv #panel.parked,body.runv.rflip #panel.parked{display:none}
599
599
  @media(max-width:640px){.ppick{min-height:44px}.pk{min-height:44px}}
600
600
  @keyframes sheet{from{translate:0 100%}}
601
601
  /* hidden by width, not display, so it slides like the rail */
602
- @media(min-width:641px){body.runv.rflip #panel{width:0!important}body.runv #panel{grid-template-columns:296px 44px}}
602
+ @media(min-width:641px){body.runv.rflip #panel{width:0!important}body.runv #panel{grid-template-columns:calc(var(--rpanel-w,340px) - 44px) 44px}body.runv:not(.rflip) #rgrip{display:block;position:absolute;z-index:3;top:0;bottom:0;left:0;width:8px;cursor:col-resize;touch-action:none}body.runv #rgrip:hover,body.rdrag #rgrip{background:linear-gradient(90deg,var(--line),transparent)}body.rdrag{user-select:none}body.rdrag #panel{transition:none}}
603
+ #rgrip{display:none}
603
604
  @media(max-width:640px){body.runv .app{grid-template-columns:minmax(0,1fr)}.rsplit{display:none}body.runv #panel{display:none}body.runv.rflip #pclose{display:grid}body.runv.rflip #panel{display:grid;position:fixed!important;inset:auto 0 0 0!important;height:80%;width:auto!important;z-index:15!important;padding:18px 0 env(safe-area-inset-bottom);background:var(--bg-2);box-shadow:0 0 0 100vmax rgb(0 0 0/.4);border-radius:14px 14px 0 0;transition:translate .18s;animation:sheet .2s}
604
605
  /* the grab handle: the sheet follows a finger down and closes (run-view.ts) */
605
606
  body.runv.rflip #panel::before{content:"";position:absolute;top:7px;left:50%;width:36px;height:4px;margin-left:-18px;border-radius:2px;background:var(--line)}body.runv.rflip #panel>.body{overscroll-behavior:contain;scrollbar-width:none}body.runv.rflip #panel>.body::-webkit-scrollbar{display:none}body .prog .ph{display:flex;justify-content:space-between;gap:8px}body.runv.rflip #panel>header{padding-top:8px}body.runv.rflip .rmeta{max-width:64px}
@@ -666,7 +667,7 @@ body.homev #home{flex:1;min-height:0;display:flex;position:relative;animation:fi
666
667
  .hactivity{display:flex;align-items:center;gap:10px;min-height:54px;font-size:12px;color:var(--dim);overflow-wrap:anywhere}
667
668
  .hmascot{position:relative;display:block;width:52px;height:52px;flex:none;border-radius:12px}
668
669
  .hmascot .mascot{display:block;width:100%;height:100%;background:var(--accent);animation:hfloat 2.4s ease-in-out infinite}
669
- .hlaptop{position:absolute;left:14px;bottom:5px;width:24px;height:13px;border:1.5px solid #dce9ff;border-radius:3px 3px 2px 2px;background:linear-gradient(145deg,#3269bd,#142e61);box-shadow:0 0 8px #4384ff66}
670
+ .hlaptop{position:absolute;left:14px;top:20px;animation:hfloat 2.4s ease-in-out infinite;width:24px;height:13px;border:1.5px solid #dce9ff;border-radius:3px 3px 2px 2px;background:linear-gradient(145deg,#3269bd,#142e61);box-shadow:0 0 8px #4384ff66}
670
671
  .hlaptop:after{content:"";position:absolute;left:-4px;right:-4px;bottom:-4px;height:2px;border-radius:0 0 5px 5px;background:#b8d0ff}
671
672
  .hactivity-copy{display:flex;min-width:0;flex-direction:column;gap:6px}
672
673
  .hdots{display:flex;align-items:center;gap:6px;height:7px}
@@ -1028,6 +1029,7 @@ a.schip:hover{color:var(--ink);border-color:color-mix(in srgb,var(--line) 60%,va
1028
1029
  @view-transition{navigation:auto}
1029
1030
  ::view-transition-group(*){animation-duration:.2s}
1030
1031
  @media(prefers-reduced-motion:reduce){:root:not([data-motion=full]) *,:root:not([data-motion=full]) *::before,:root:not([data-motion=full]) *::after,:root:not([data-motion=full])::view-transition-group(*),:root:not([data-motion=full])::view-transition-old(*),:root:not([data-motion=full])::view-transition-new(*){transition:none!important;animation:none!important}}
1032
+ @media(prefers-reduced-motion:reduce){:root:not([data-motion=full]):not([data-motion=reduce]) .hdots i{animation:hdot 1.05s ease-in-out infinite!important}:root:not([data-motion=full]):not([data-motion=reduce]) .hdots i:nth-child(2){animation-delay:.16s!important}:root:not([data-motion=full]):not([data-motion=reduce]) .hdots i:nth-child(3){animation-delay:.32s!important}}
1031
1033
  :root[data-motion=reduce] *,:root[data-motion=reduce] *::before,:root[data-motion=reduce] *::after,:root[data-motion=reduce]::view-transition-group(*),:root[data-motion=reduce]::view-transition-old(*),:root[data-motion=reduce]::view-transition-new(*){transition:none!important;animation:none!important}
1032
1034
  /* Every page's top bar (Board, Tasks, Icebox, Terminal, Settings, a run's tabs): one height, one divider. */
1033
1035
  /* Tasks uses the Board's own header, as the Icebox does; its extra filters go in #hx. */
@@ -1219,6 +1221,7 @@ html body.wsb:not(.paged) #board{grid-template-columns:repeat(4,minmax(200px,1fr
1219
1221
 
1220
1222
  <div class="scrim" id="scrim"></div>
1221
1223
  <aside id="panel" aria-label="detail">
1224
+ <div id="rgrip" title="Drag to resize, double-click to reset"></div>
1222
1225
  <header><div class="t"><div class="pwrap"><button type="button" class="ppick" id="ppick" aria-haspopup="listbox" aria-expanded="false" title="Choose a run"></button><div class="ppop" id="ppop" role="listbox" aria-label="Runs in this workspace" hidden></div></div><b id="ptitle"></b><div class="sub" id="psub"></div></div><button class="ib" id="pterm" aria-label="Terminal" title="Terminal" hidden><svg><use href="#i-term"/></svg></button><button class="ib" id="pclose" aria-label="Close" title="Close"><svg><use href="#i-close"/></svg></button></header>
1223
1226
  <div class="pstrip"><nav id="ptabs"></nav><button class="pnotes" id="pnotes" title="Project notes" aria-label="Project notes"><svg><use href="#t-book"/></svg></button></div>
1224
1227
  <div class="body md" id="pnlist"></div>