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

Migrated from github.com/Trevato/SO-ARM100

workbenchthis machine

STOP is at least 56 px tall and red on touch, and the stopped banner spans the full width #141

Merged opened this

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

Merged

quill/arm:quill/128-stop-is-at-least-56-px-tall-and-red-on-t → main 3 commits fork 1 thread · 1 unresolved

  • Merged. quill/128-stop-is-at-least-56-px-tall-and-red-on-t was merged into main as cc9c7b5.

Review

Sign in to review this change.
2 files changed +24 −3
Software/so101/src/server.test.ts +21
@@ -213,6 +213,27 @@ describe("viewer page", () => {
213213 expect(page).toContain("Resume driving");
214214 expect(page.match(/>Stop</g)?.length).toBe(1);
215215 });
216
217 test("STOP is at least 56 px tall and red under a finger, and the stopped banner spans the full width", async () => {
218 const page = await (await fetch(`${base}/`)).text();
219 const rule = (sel: string) => [...page.matchAll(new RegExp(`(?:^|[\\s}])${sel.replace(/[.#:]/g, "\\$&")} \\{([^}]*)\\}`, "g"))].map((m) => m[1]).join(";");
220 const px = Number(/min-height: (\d+)px/.exec(rule(".estop"))?.[1]);
221 expect(px).toBeGreaterThanOrEqual(56);
222 for (const sel of [".estop", ".estop:hover", ".estop:active"]) {
223 const bg = /background: #([0-9a-f]{6})/.exec(rule(sel))?.[1];
224 expect(bg).toBeDefined();
225 const [r, g, b] = [0, 2, 4].map((i) => parseInt(bg!.slice(i, i + 2), 16));
226 expect(r).toBeGreaterThan(150); // red, not a grey or a dark pressed state
227 expect(r).toBeGreaterThan(3 * Math.max(g!, b!));
228 }
229 const stop = rule("#banner.stop");
230 expect(stop).toContain("position: fixed");
231 expect(stop).toMatch(/left: 0;/);
232 expect(stop).toMatch(/right: 0;/);
233 expect(stop).toContain("transform: none");
234 expect(stop).toContain("max-width: none");
235 expect(stop).toContain("width: auto");
236 });
216237 });
217238
218239 describe("moves over HTTP", () => {
Software/so101/src/viewer.html +3 −3
@@ -61,7 +61,7 @@
6161 #stage { position: absolute; inset: 0; display: flex; gap: 2px; }
6262 /* the emergency stop's held state, and the banner that says who pressed it */
6363 .estop:disabled { opacity: .5; cursor: not-allowed; } .estop.on { background: #7d1410; box-shadow: 0 0 0 3px var(--bad); }
64 #banner.stop { display: block; border: 2px solid var(--bad); background: rgba(80,10,8,.92); color: #fff; font-weight: 600; }
64 #banner.stop { display: block; position: fixed; left: 0; right: 0; transform: none; width: auto; max-width: none; z-index: 8; border-radius: 0; border-width: 2px 0; border-style: solid; border-color: var(--bad); padding: 10px calc(12px + var(--safe-r)) 10px calc(12px + var(--safe-l)); background: rgba(80,10,8,.92); color: #fff; font-weight: 600; } /* stopped: edge to edge, over the sheet, not a centred box */
6565 #banner button { margin-left: 10px; min-height: 32px; padding: 2px 10px; }
6666 .pane { flex: 1; min-width: 0; position: relative; background: #000; display: none; }
6767 .pane.on { display: block; }
@@ -88,8 +88,8 @@
8888 #capLine { color: var(--dim); font-size: 12px; } #capLine:empty { display: none; }
8989 #driverLine.paused { color: var(--warn); }
9090 #turnActions { display: flex; gap: 6px; } #turnActions:empty { display: none; }
91 .estop { flex: none; min-width: 72px; min-height: 52px; border: 0; border-radius: 12px; background: #d1242f; color: #fff; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; box-shadow: 0 0 0 3px rgba(209,36,47,.25), 0 2px 8px rgba(0,0,0,.35); }
92 .estop:hover { background: #e5323d; } .estop:active { transform: scale(.97); }
91 .estop { flex: none; min-width: 72px; min-height: 56px; border: 0; border-radius: 12px; background: #d1242f; color: #fff; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; box-shadow: 0 0 0 3px rgba(209,36,47,.25), 0 2px 8px rgba(0,0,0,.35); }
92 .estop:hover { background: #e5323d; } .estop:active { background: #b81d27; transform: scale(.97); } /* red under a finger too: a touch is hover then active */

Specificity ties with .estop.on at line 63, and this rule comes later, so hover/active repaint the Stopped state. Add .estop.on:hover,.estop.on:active keeping #7d1410, or use :not(.on).

9393 #sheetToggle { flex: none; }
9494 /* the turn ring: time left as a sweep around the seconds; the driver's name over the video for everyone */
9595 #ring { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--blue) var(--p, 0%), var(--line) 0); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; position: relative; }

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs