Public: anyone can read this; the crew can change it.

Migrated from github.com/Trevato/SO-ARM100

workbenchthis machine

The room announcement and warn-only boundary warnings fold into one 'N notes' pill in the status strip that opens a dismissable list; #notice is gone #369

Merged opened this

Check · Review · Land done · Live — Landed; nothing deploys from this branch, so this is the end of its path.

Merged

smith/arm:smith/336-the-room-announcement-and-warn-only-boun → main 2 commits fork

  • Merged. smith/336-the-room-announcement-and-warn-only-boun was merged into main as 19c6b03.

Review

Sign in to review this change.
10 files changed +247 −18
Software/so101/src/stop-layout.test.ts +29 −1
@@ -1,5 +1,5 @@
11 import { afterAll, beforeAll, describe, expect, test } from "bun:test";
2 import { mkdtempSync } from "node:fs";
2 import { mkdtempSync, readFileSync } from "node:fs";
33 import { tmpdir } from "node:os";
44 import { join } from "node:path";
55 import { FeetechBus } from "./bus.ts";
@@ -144,3 +144,31 @@ describe("the hold line", () => {
144144 expect(css()).not.toMatch(/@media[^{]*360[^{]*\{[^}]*#holdLine/);
145145 });
146146 });
147
148 describe("notes on the served page", () => {
149 const css = () => flatRules([...html.matchAll(/<style\b[^>]*>([\s\S]*?)<\/style>/gi)].map((m) => m[1]!).join("\n"));
150 const notesJs = readFileSync(new URL("./ui/notes.js", import.meta.url), "utf8");
151 const notesCss = flatRules(readFileSync(new URL("./ui/notes.css", import.meta.url), "utf8"));
152 const body = (sel: string) => [...css(), ...notesCss].filter((r) => r.selector.split(",").some((s) => s.trim() === sel)).map((r) => r.body).join(";");
153 const minHeight = (sel: string) => Number(/min-height:\s*(\d+)px/.exec(body(sel))?.[1]);
154
155 test("#notice and the banner's .bad/.warn styles are gone", () => {
156 const markup = html.replace(/<!--[\s\S]*?-->/g, "").replace(/<(script|style)\b[\s\S]*?<\/\1>/gi, "");
157 expect(markup).not.toContain('id="notice"');
158 expect(css().some((r) => /#notice\b|#banner\.(bad|warn)/.test(r.selector))).toBe(false);
159 expect(body("#banner")).toMatch(/display:\s*none/);
160 });
161
162 test("with two notes the camera box is the same size as with none: the pill is in the strip, the list floats, nothing is in the view", () => {
163 const markup = html.replace(/<!--[\s\S]*?-->/g, "").replace(/<(script|style)\b[\s\S]*?<\/\1>/gi, "");
164 const app = markup.slice(markup.indexOf('<div id="app"'), markup.indexOf('<section id="strip"'));
165 expect(app).not.toMatch(/id="notes(Pill|List)"/);
166 expect(notesJs).toMatch(/\$\("turnActions"\)\.after\(pill, live\)/); // the pill joins the strip's row, the list goes on the body
167 expect(body("#notesList")).toMatch(/position:\s*fixed/);
168 // the pill is a 44 px target no taller than the strip's own minimum height, so it grows nothing
169 expect(minHeight("#notesPill")).toBeGreaterThanOrEqual(44);
170 expect(minHeight("#notesPill")).toBeLessThan(minHeight("#strip"));
171 // styled by the page, so it never shows unstyled while the stylesheet loads
172 expect(notesCss.some((r) => r.selector.includes("notesPill"))).toBe(false);
173 });
174 });
Software/so101/src/ui/hold-line.js +1 −1
@@ -1,4 +1,4 @@
1 // A stop-like hold takes the status strip's row; a warn-only notice stays in the banner. E-stop and manual stop are the page's.
1 // A stop-like hold takes the status strip's row; a warn-only warning is a note (ui/notes.js). E-stop and manual stop are the page's.
22 const lost = "The arm has been unreachable for over a minute. This is the SIMULATION, not the real arm.";
33
44 /** @returns {{ bad: boolean, text: string } | null} */
Software/so101/src/ui/lobby-panel.js +2 −3
@@ -29,7 +29,7 @@ export const backoff = (attempt) => Math.min(250 * 2 ** Math.max(0, attempt - 1)
2929 const tell = (what) => /** @type {any} */ (globalThis).dispatchEvent?.(new Event(what));
3030
3131 /**
32 * @param {any} page what the page owns: $, el, relayed, tab(), showTab, msg, applyLock, applyStatus, noStatus, words, admin
32 * @param {any} page what the page owns: $, el, relayed, tab(), showTab, msg, applyLock, applyStatus, noStatus, words, admin, note
3333 */
3434 export function createRoom(page) {
3535 const { $, el, relayed, msg } = page;
@@ -111,8 +111,7 @@ export function createRoom(page) {
111111 $("driverTag").textContent = d ? `🎮 ${d.name}${driving ? " (you)" : ""}` : "";
112112 $("strip").classList.toggle("ready", Boolean(driving && d.readyBy));
113113 alertNext(Boolean(mine && mine.place === 1 && !st.paused));
114 $("notice").hidden = !st.announcement;
115 $("notice").textContent = st.announcement ?? "";
114 page.note("notice", st.announcement);
116115 $("capLine").textContent = st.maxSpeedPercent < 100 ? `Speed limited to ${st.maxSpeedPercent}% of full` : "";
117116 $("turnActions").replaceChildren(...turnButtons());
118117 $("quiet").checked = quiet();
Software/so101/src/ui/lobby-panel.test.ts +4 −4
@@ -49,7 +49,7 @@ describe("the room over /live", () => {
4949 const page = {
5050 $: (id: string) => nodes.get(id) ?? (nodes.set(id, node()), nodes.get(id)),
5151 el: (tag: string, props: object = {}) => Object.assign(node(), { tag }, props),
52 relayed: true, tab: () => "chat", showTab() {}, applyLock() {}, applyStatus() {}, noStatus() {}, words() {}, admin() {},
52 relayed: true, tab: () => "chat", showTab() {}, applyLock() {}, applyStatus() {}, noStatus() {}, words() {}, admin() {}, note() {},
5353 msg: (text: string, bad?: boolean) => void shown.push([text, bad]),
5454 };
5555 const room = createRoom(page);
@@ -79,7 +79,7 @@ describe("the room over /live", () => {
7979 const page = {
8080 $: (id: string) => nodes.get(id) ?? (nodes.set(id, Object.assign(node(), { classList: classList() })), nodes.get(id)),
8181 el: (tag: string, props: object = {}) => Object.assign(node(), { tag }, props),
82 relayed: true, tab: () => "chat", showTab() {}, applyLock: () => calls.push("lock"), applyStatus() {}, noStatus: () => calls.push("noStatus"), words() {}, admin() {},
82 relayed: true, tab: () => "chat", showTab() {}, applyLock: () => calls.push("lock"), applyStatus() {}, noStatus: () => calls.push("noStatus"), words() {}, admin() {}, note() {},
8383 msg() {},
8484 };
8585 const room = createRoom(page);
@@ -127,7 +127,7 @@ describe("a deliberate reopen", () => {
127127 const page = {
128128 $: (id: string) => nodes.get(id) ?? (nodes.set(id, n()), nodes.get(id)),
129129 el: (tag: string, props: object = {}) => Object.assign(n(), { tag }, props),
130 relayed: true, tab: () => "chat", showTab() {}, applyLock() {}, applyStatus() {}, noStatus: () => calls.push("noStatus"), words() {}, admin() {}, msg() {},
130 relayed: true, tab: () => "chat", showTab() {}, applyLock() {}, applyStatus() {}, noStatus: () => calls.push("noStatus"), words() {}, admin() {}, note() {}, msg() {},
131131 };
132132 const room = createRoom(page);
133133 room.lobbyConnect();
@@ -162,7 +162,7 @@ describe("the chat's scroll", () => {
162162 const page = {
163163 $: (id: string) => nodes.get(id) ?? (nodes.set(id, n()), nodes.get(id)),
164164 el: (tag: string, props: object = {}) => Object.assign(n(), { tag }, props),
165 relayed: true, tab: () => "chat", showTab() {}, applyLock() {}, applyStatus() {}, noStatus() {}, words() {}, admin() {}, msg() {},
165 relayed: true, tab: () => "chat", showTab() {}, applyLock() {}, applyStatus() {}, noStatus() {}, words() {}, admin() {}, note() {}, msg() {},
166166 };
167167 const room = createRoom(page);
168168 room.lobbyConnect();
Software/so101/src/ui/notes.css added +2
@@ -0,0 +1,2 @@
1 #notesList { position: fixed; z-index: 9; left: 8px; right: 8px; bottom: calc(8px + var(--safe-b)); max-height: 40vh; overflow: auto; margin: 0 auto; max-width: 480px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
2 .note { display: flex; gap: 8px; padding: 8px; border-left: 3px solid var(--blue); font-size: 14px; overflow-wrap: anywhere; } .note span { flex: 1; } .note button { flex: none; min-height: 44px; min-width: 44px; }
Software/so101/src/ui/notes.js added +70
@@ -0,0 +1,70 @@
1 // @ts-check
2 /**
3 * The page's notices (the room's #notice, the boundary warnings) as one count and one list, so none of them takes
4 * room over the camera or the model: the status strip shows "2 notes", a tap opens the list, each can be dismissed.
5 * A dismissed note stays gone until its text changes or it clears and comes back. Text only; the page uses textContent.
6 */
7
8 const MAX = 240;
9
10 export function createNotes() {
11 /** @type {Map<string, string>} */ const items = new Map();
12 /** @type {Map<string, string>} */ const dismissed = new Map();
13 return {
14 /** Set a note by key; an empty or missing text clears it (and forgets a dismissal, so it can come back). */
15 set(/** @type {string} */ key, /** @type {unknown} */ text) {
16 // eslint-disable-next-line no-control-regex
17 const t = typeof text === "string" ? text.replace(/[\u0000-\u001f\u007f]+/g, " ").trim().slice(0, MAX) : "";
18 if (t) items.set(key, t); else { items.delete(key); dismissed.delete(key); }
19 },
20 /** @returns {Array<{ key: string, text: string }>} the notes not dismissed, in the order they were first set */
21 list() { return [...items].filter(([k, t]) => dismissed.get(k) !== t).map(([key, text]) => ({ key, text })); },
22 dismiss(/** @type {string} */ key) { const t = items.get(key); if (t !== undefined) dismissed.set(key, t); },
23 };
24 }
25
26 /**
27 * Mount the pill and the list on the page; returns set(key, text). Loaded on the first note, so a quiet page never pays for it.
28 * @param {(id: string) => HTMLElement} $ @param {(tag: string, props?: object, ...kids: any[]) => HTMLElement} el
29 */
30 export function mountNotes($, el) {
31 document.head.append(el("link", { rel: "stylesheet", href: import.meta.url.replace(/\.js$/, ".css") }));
32 const notes = createNotes();
33 const pill = el("button", { id: "notesPill", type: "button", hidden: true }), box = el("div", { id: "notesList", hidden: true });
34 pill.setAttribute("aria-controls", "notesList"); pill.setAttribute("aria-expanded", "false");
35 const live = el("span", { id: "notesLive" }); // announces a new or changed note; the pill's own count is not enough
36 live.setAttribute("role", "status"); live.setAttribute("style", "position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap");
37 box.setAttribute("role", "region"); box.setAttribute("aria-label", "Notes"); box.setAttribute("tabindex", "-1");
38 $("turnActions").after(pill, live); document.body.append(box);
39 /** @param {number} [focusAt] after a Dismiss: the index to move focus to */
40 function render(focusAt) {
41 const list = notes.list();
42 pill.hidden = !list.length; pill.textContent = pillText(list.length);
43 if (!list.length) { const had = !box.hidden; box.hidden = true; pill.setAttribute("aria-expanded", "false"); if (had && focusAt !== undefined) pill.focus(); }
44 if (box.hidden) return;
45 box.replaceChildren(...list.map((n, i) => {
46 const b = el("button", { type: "button", textContent: "Dismiss", onclick: () => { notes.dismiss(n.key); render(i); } });
47 b.setAttribute("aria-label", `Dismiss: ${n.text}`);
48 return el("div", { className: "note" }, el("span", { textContent: n.text }), b);
49 }));
50 if (focusAt !== undefined) /** @type {HTMLElement} */ (box.querySelectorAll("button")[Math.min(focusAt, list.length - 1)]).focus();
51 }
52 const toggle = (/** @type {boolean} */ open) => {
53 box.hidden = !open; pill.setAttribute("aria-expanded", String(open)); render();
54 if (open) /** @type {HTMLElement | undefined} */ (box.querySelectorAll("button")[0])?.focus();
55 };
56 pill.addEventListener("click", () => toggle(box.hidden));
57 addEventListener("keydown", (e) => { if (e.key === "Escape" && !box.hidden) { toggle(false); pill.focus(); } });
58 return {
59 set(/** @type {string} */ key, /** @type {unknown} */ text) {
60 const before = notes.list().find((n) => n.key === key)?.text;
61 notes.set(key, text);
62 const now = notes.list().find((n) => n.key === key)?.text;
63 if (now && now !== before) live.textContent = now;
64 render();
65 },
66 };
67 }
68
69 /** @param {number} n @returns {string} the pill's words */
70 export const pillText = (n) => `${n} note${n === 1 ? "" : "s"}`;
Software/so101/src/ui/notes.test.ts added +98
@@ -0,0 +1,98 @@
1 import { describe, expect, test } from "bun:test";
2 import { createNotes, pillText } from "./notes.js";
3
4 describe("notes", () => {
5 test("two notices count to one pill", () => {
6 const n = createNotes();
7 n.set("notice", "Back at 5"); n.set("zone", "the arm is near the table");
8 expect(n.list().length).toBe(2);
9 expect(pillText(2)).toBe("2 notes");
10 expect(pillText(1)).toBe("1 note");
11 });
12 test("dismissed stays gone until the text changes or it clears", () => {
13 const n = createNotes();
14 n.set("zone", "a"); n.dismiss("zone"); n.set("zone", "a");
15 expect(n.list()).toEqual([]);
16 n.set("zone", "b");
17 expect(n.list().map((x) => x.text)).toEqual(["b"]);
18 n.dismiss("zone"); n.set("zone", null); n.set("zone", "b");
19 expect(n.list().length).toBe(1);
20 });
21 test("text is bounded and clean; non-strings clear", () => {
22 const n = createNotes();
23 n.set("a", "x\ny" + "z".repeat(500));
24 expect(n.list()[0]!.text.length).toBe(240);
25 expect(n.list()[0]!.text).not.toContain("\n");
26 n.set("a", 5);
27 expect(n.list()).toEqual([]);
28 });
29 });
30
31 describe("mountNotes on a fake page", () => {
32 function setup() {
33 const g = globalThis as any, saved = { document: g.document, addEventListener: g.addEventListener };
34 const node = (tag: string, props: any = {}): any => {
35 const n: any = { tag, children: [], attrs: {} as Record<string, string>, listeners: {} as Record<string, any>, hidden: false, focused: false, ...props };
36 n.setAttribute = (k: string, v: string) => { n.attrs[k] = v; };
37 n.addEventListener = (t: string, f: any) => { n.listeners[t] = f; };
38 n.append = (...k: any[]) => { n.children.push(...k); };
39 n.replaceChildren = (...k: any[]) => { n.children = k; };
40 n.after = () => {};
41 n.querySelectorAll = (sel: string) => { const out: any[] = []; const walk = (x: any) => { for (const c of x.children ?? []) { if (typeof c === "object") { if (c.tag === sel) out.push(c); walk(c); } } }; walk(n); return out; };
42 n.focus = () => { g.focused = n; };
43 n.click = () => (n.onclick ?? n.listeners.click)?.();
44 return n;
45 };
46 const keys: any[] = [];
47 g.document = { head: node("head"), body: node("body") };
48 g.addEventListener = (_: string, f: any) => keys.push(f);
49 const els = new Map<string, any>([["turnActions", node("div")]]);
50 const el = (tag: string, props: any = {}, ...kids: any[]) => { const n = node(tag, props); n.children = kids; if (props.id) els.set(props.id, n); return n; };
51 const text = (n: any): string => (typeof n === "string" ? n : n.textContent ?? n.children.map(text).join(""));
52 return { els, el, keys, text, $: (id: string) => els.get(id), body: g.document.body, restore: () => Object.assign(g, saved) };
53 }
54 test("hidden when empty; opens, toggles aria-expanded, dismisses, and Escape returns focus to the pill", async () => {
55 const t = setup();
56 try {
57 const { mountNotes } = await import("./notes.js");
58 const m = mountNotes(t.$, t.el), pill = t.els.get("notesPill"), box = t.els.get("notesList");
59 expect(pill.hidden).toBe(true);
60 expect(pill.type).toBe("button");
61 m.set("notice", "Back at 5"); m.set("zone", "warning: table");
62 expect(pill.hidden).toBe(false);
63 expect(pill.textContent).toBe("2 notes");
64 pill.click();
65 expect(pill.attrs["aria-expanded"]).toBe("true");
66 expect(box.hidden).toBe(false);
67 expect(box.children.length).toBe(2);
68 box.children[0].children[1].click(); // Dismiss the first
69 expect(box.children.length).toBe(1);
70 expect(pill.textContent).toBe("1 note");
71 t.keys[0]({ key: "Escape" });
72 expect(box.hidden).toBe(true);
73 expect(pill.attrs["aria-expanded"]).toBe("false");
74 expect((globalThis as any).focused).toBe(pill);
75 pill.click(); box.children[0].children[1].click();
76 expect(pill.hidden).toBe(true); // none left: the pill goes
77 m.set("notice", "Back at 6");
78 expect(pill.hidden).toBe(false); // changed text returns
79 } finally { t.restore(); }
80 });
81 test("focus moves into the list on open, to the next Dismiss after one, and to the pill when none are left; a change is announced", async () => {
82 const t = setup(), g = globalThis as any;
83 try {
84 const { mountNotes } = await import("./notes.js");
85 const m = mountNotes(t.$, t.el), pill = t.els.get("notesPill"), box = t.els.get("notesList"), live = t.els.get("notesLive");
86 expect(box.attrs.role).toBe("region");
87 expect(live.attrs.role).toBe("status");
88 m.set("notice", "Back at 5"); m.set("zone", "warning: table");
89 expect(live.textContent).toBe("warning: table");
90 pill.click();
91 expect(g.focused).toBe(box.children[0].children[1]); // first Dismiss
92 box.children[0].children[1].click();
93 expect(g.focused).toBe(box.children[0].children[1]); // the next one, now first
94 box.children[0].children[1].click();
95 expect(g.focused).toBe(pill);
96 } finally { t.restore(); }
97 });
98 });
Software/so101/src/ui/zone-notes.js added +9
@@ -0,0 +1,9 @@
1 /** note(key, text): loads the pill on the first text; a failed load is not cached and the text goes to `fallback(key, text)`. */
2 export function noteSink(load, fallback) {
3 let mod = null;
4 return (key, text = "") => {
5 if (!mod) { if (!text) return; mod = load(); }
6 const m = mod;
7 m.then((n) => n.set(key, text), () => { if (mod === m) mod = null; if (text) fallback(key, text); });
8 };
9 }
Software/so101/src/ui/zone-notes.test.ts added +24
@@ -0,0 +1,24 @@
1 import { describe, expect, test } from "bun:test";
2 import { noteSink } from "./zone-notes.js";
3
4 describe("noteSink", () => {
5 const tick = () => new Promise((r) => setTimeout(r, 0));
6 test("mounts on the first text only, then reuses the mount", async () => {
7 let loads = 0; const seen: unknown[][] = [];
8 const note = noteSink(async () => { loads++; return { set: (k: string, t: unknown) => void seen.push([k, t]) }; }, () => {});
9 note("zone", ""); await tick();
10 expect(loads).toBe(0);
11 note("zone", "a"); note("notice", "b"); await tick();
12 expect(loads).toBe(1);
13 expect(seen).toEqual([["zone", "a"], ["notice", "b"]]);
14 });
15 test("a failed load is not cached: the text is shown by the fallback and the next note loads again", async () => {
16 let loads = 0; const shown: string[] = [], seen: unknown[][] = [];
17 const note = noteSink(async () => { if (++loads === 1) throw new Error("offline"); return { set: (k: string, t: unknown) => void seen.push([k, t]) }; }, (_k, t) => shown.push(t));
18 note("zone", "held"); await tick();
19 expect(shown).toEqual(["held"]);
20 note("zone", "again"); await tick();
21 expect(loads).toBe(2);
22 expect(seen).toEqual([["zone", "again"]]);
23 });
24 });
Software/so101/src/viewer.html +8 −9
@@ -79,7 +79,6 @@
7979 #link { color: #9aa4ae; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: min(36ch, 46vw); } #link.on { color: #3fb950; } #link.warn { color: #d29922; } #link.bad { color: #f85149; font-weight: 700; }
8080 .dot { width: 8px; height: 8px; border-radius: 50%; background: #f85149; display: inline-block; flex: none; } .dot.on { background: #3fb950; } .dot.warn { background: #d29922; }
8181 #banner { position: absolute; top: 50px; left: 50%; transform: translateX(-50%); z-index: 5; width: max-content; max-width: min(640px, calc(100% - 16px)); padding: 8px 12px; border-radius: 8px; font-size: 13px; background: rgba(0,0,0,.8); border: 1px solid #30363d; display: none; }
82 #banner.bad { display: block; border-color: #f85149; color: #ffb3ad; } #banner.warn { display: block; border-color: #d29922; color: #f2cc60; }
8382 #msg { position: absolute; left: calc(8px + var(--safe-l)); right: calc(8px + var(--safe-r)); bottom: 8px; z-index: 6; margin: 0 auto; width: max-content; max-width: calc(100% - 16px); padding: 8px 12px; border-radius: 8px; font-size: 13px; background: rgba(13,17,23,.9); color: #e8eaed; border: 1px solid #30363d; }
8483 #refusal { position: absolute; left: 8px; right: 8px; bottom: 52px; z-index: 6; margin: 0 auto; width: max-content; max-width: calc(100% - 16px); padding: 6px 12px; border-radius: 8px; font-size: 13px; background: rgba(13,17,23,.9); border: 1px solid #f85149; color: #ffb3ad; } #refusal:empty { display: none; }
8584 #msg:empty { display: none; } #msg.bad { border-color: #f85149; color: #ffb3ad; }
@@ -132,7 +131,7 @@
132131 #tabs .badge { display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 5px; border-radius: 9px; background: var(--blue); color: var(--on-blue); font-size: 11px; line-height: 18px; }
133132 #tabs .badge:empty { display: none; }
134133
135 #notice { flex: none; padding: 10px calc(12px + var(--safe-r)) 10px calc(12px + var(--safe-l)); border-bottom: 1px solid var(--line); border-left: 3px solid var(--blue); background: var(--blue-soft); font-size: 14px; overflow-wrap: anywhere; }
134 #notesPill { flex: none; min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 22px; background: var(--blue-soft); }
136135
137136 /* chat */
138137 #tab-chat { padding: 0; gap: 0; }
@@ -296,7 +295,6 @@
296295 </section>
297296
298297 <section id="sheet" aria-label="Chat, queue and controls">
299 <div id="notice" role="status" hidden></div>
300298 <div class="tab" id="tab-chat" role="tabpanel" aria-labelledby="t-chat">
301299 <div id="chat" role="log" aria-label="Chat"></div>
302300 <button type="button" id="newMsgs" hidden>New messages ↓</button>
@@ -375,7 +373,7 @@
375373 </div>
376374 <div class="card" id="zoneCard">
377375 <h3>Safe zone</h3>
378 <p>The server runs every target through the arm's own geometry: the URDF and its meshes. A pose that puts any part below the table, or into the base, is a violation. <b>enforce</b> refuses such moves and holds a stream at the boundary until the leader backs off. <b>warn</b> only reports them, in the banner and the metrics. <b>off</b> skips the check.</p>
376 <p>The server runs every target through the arm's own geometry: the URDF and its meshes. A pose that puts any part below the table, or into the base, is a violation. <b>enforce</b> refuses such moves and holds a stream at the boundary until the leader backs off. <b>warn</b> only reports them, as a note and in the metrics. <b>off</b> skips the check.</p>
379377 <div class="row" id="zoneRow">
380378 <label class="inline">mode <select id="zone"><option value="enforce">enforce</option><option value="warn">warn</option><option value="off">off</option></select></label>
381379 <label class="inline">table margin <input type="number" id="floorMargin" min="0" max="100" step="1" inputmode="numeric"> mm</label>
@@ -485,6 +483,7 @@
485483 import { bindSurface, canDrive, Driver, shape, UP } from "/ui/__VERSION__/drive.js";
486484 import { Frames } from "/ui/__VERSION__/frames.js";
487485 import { holdText, warnText } from "/ui/__VERSION__/hold-line.js";
486 import { noteSink } from "/ui/__VERSION__/zone-notes.js";
488487 import { createRoom } from "/ui/__VERSION__/lobby-panel.js";
489488
490489 const $ = (id) => document.getElementById(id);
@@ -1381,8 +1380,10 @@
13811380 // The page follows suit: the Controls tab appears on your turn. Everything here arrives on one socket.
13821381 let wordsSent = false;
13831382 $("wordsForm").addEventListener("submit", (e) => { e.preventDefault(); wordsSent = true; say({ type: "words", words: $("wordsForm").elements.words.value.split(",").map((w) => w.trim()).filter(Boolean) }); });
1383 const fallback = {}; // the last text per key, shown on the hold line when the notes module will not load
1384 const note = noteSink(() => import("/ui/__VERSION__/notes.js").then((m) => m.mountNotes($, el)), (k, t) => { fallback[k] = t; $("holdLine").textContent = Object.values(fallback).join(" "); });
13841385 const room = createRoom({
1385 $, el, relayed, msg, tab: () => tab, showTab, applyLock: () => applyLock(), applyStatus: (s) => applyStatus(s), noStatus: () => noStatus(),
1386 $, el, relayed, msg, note, tab: () => tab, showTab, applyLock: () => applyLock(), applyStatus: (s) => applyStatus(s), noStatus: () => noStatus(),
13861387 words(m) { const f = $("wordsForm"); if (document.activeElement !== f.elements.words) f.elements.words.value = m.words.join(", "); if (wordsSent) { wordsSent = false; msg(`Word filter saved: ${m.words.length} word${m.words.length === 1 ? "" : "s"}.`); } },
13871388 admin: (saved) => fillAdmin(saved),
13881389 });
@@ -1529,10 +1530,8 @@
15291530 const hold = holdText(d, say, NAMES);
15301531 const h = $("holdLine");
15311532 h.textContent = hold?.text ?? ""; h.className = hold?.bad ? "bad" : "";
1532 if (hold) { b.className = ""; return; }
1533 const warn = warnText(d, say);
1534 b.className = warn ? "warn" : "";
1535 if (warn) b.textContent = warn;
1533 b.className = "";
1534 note("zone", hold ? "" : warnText(d, say));
15361535 }
15371536 /** The arm's status, from /live (pushed when it changes) or, without it, from polling /status. */
15381537 // Until the limits, the settings and the model are in, a status is kept aside, not drawn; then it is applied whole,

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs