From 7932ef62c77c993a60cbf2ca66b01faa97835d10 Mon Sep 17 00:00:00 2001 From: Givou Date: Mon, 2 Nov 2026 18:56:08 +0100 Subject: [PATCH] UI pass: controls of one kind line up and have one size Remote access uses the same switch as demo mode and one column for its controls. Button rows in settings get equal widths, checkboxes one look, link grids even rows with their buttons aligned. No half-empty rows in the channel view. Co-Authored-By: Claude Opus 5.5 --- static/app.js | 20 +++++++++++--------- static/style.css | 20 +++++++++++++++++++- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/static/app.js b/static/app.js index 241aa74..9a21449 100644 --- a/static/app.js +++ b/static/app.js @@ -1474,11 +1474,11 @@ function viewChannel(d) { paramSlider("Release", k, i, "gate.release", "release"))); cards.push(dynCard(t("Compressor"), "comp", "thresh"), peqCard(d, k, i)); } else if (k === "in") { - cards.push(h("div", { class: "card" }, h("h3", {}, "Noise Gate"), + cards.push(h("div", { class: "card wide" }, h("h3", {}, "Noise Gate"), h("div", { class: "paramgrid" }, paramSlider("Threshold", k, i, "gate.threshold", "gthresh"), paramSlider("Attack", k, i, "gate.attack", "attack"), paramSlider("Hold", k, i, "gate.hold", "hold"), - paramSlider("Release", k, i, "gate.release", "release"))); + paramSlider("Release", k, i, "gate.release", "release")))); cards.push(peqCard(d, k, i), geqCard(d, i)); } else { cards.push(routingCard(d, i), peqCard(d, k, i)); @@ -1512,7 +1512,7 @@ function mixList(d, o) { } function routingCard(d, o) { - return h("div", { class: "card" }, h("h3", {}, t("Sources → ") + chLabel("out", o)), mixList(d, o)); + return h("div", { class: "card wide" }, h("h3", {}, t("Sources → ") + chLabel("out", o)), mixList(d, o)); } // ------------------------------------------------------------------ routing view @@ -2267,8 +2267,10 @@ function remoteCard() { try { S.remote = await api("PUT", "/api/remote", body); } catch (e) { toast(e.message); } render(); }; - const sw = h("button", { class: r.enabled ? "on" : "", "aria-pressed": String(r.enabled), onclick: () => put({ enabled: !r.enabled, port: +port.value || 8080 }) }, - r.enabled ? t("On") : t("Off")); + const sw = h("div", { class: "seg" }, [[false, t("Off")], [true, t("On")]].map(([v, label]) => { + const on = v === !!r.enabled; + return h("button", { class: on ? "on" : "", "aria-pressed": String(on), onclick: () => on || put({ enabled: v, port: +port.value || 8080 }) }, label); + })); let status; if (r.error) status = h("div", { class: "err" }, trMsg(r.error)); else if (r.running) status = h("div", { class: "remote-urls" }, h("div", { class: "info" }, t("Open on a phone in the same Wi-Fi:")), @@ -2276,9 +2278,9 @@ function remoteCard() { else status = h("p", { class: "info" }, t("Off – only this window has access.")); return h("div", { class: "card" }, h("h3", {}, h("span", { class: "dot " + (r.running ? "online" : r.error ? "error" : "disconnected") }), h("span", { class: "grow" }, t("Remote access (web server)"))), - h("div", { class: "row" }, h("span", { class: "grow" }, t("Allow phones & tablets")), sw), - h("div", { class: "row" }, h("span", { class: "grow" }, "Port"), port, - h("button", { class: "small", onclick: () => put({ port: +port.value || 8080 }) }, t("Apply"))), + h("div", { class: "kv" }, h("span", {}, t("Allow phones & tablets")), h("div", { class: "kvc" }, sw)), + h("div", { class: "kv" }, h("span", {}, "Port"), h("div", { class: "kvc" }, port, + h("button", { onclick: () => put({ port: +port.value || 8080 }) }, t("Apply")))), status, h("p", { class: "info" }, t("Other devices log in with the PIN (changeable below). Only runs while this app is open. "), r.platform === "darwin" @@ -2355,7 +2357,7 @@ function logoCard() { h("div", { class: "grow" }, h("p", { class: "info" }, t("Your own logo top left (and as the browser icon). PNG, JPG, WebP or SVG, ideally square, at least 64×64 pixels, transparent background recommended. It is scaled to 128×128 pixels; other shapes are centred without distortion.")))), h("div", { class: "actions" }, - h("button", { class: "on", onclick: async () => { + h("button", { onclick: async () => { try { const r = await logoFromFile(); if (!r) return; diff --git a/static/style.css b/static/style.css index 7bb5bcf..3c02b77 100644 --- a/static/style.css +++ b/static/style.css @@ -690,7 +690,7 @@ button.devitem.paused, button.devitem:disabled { opacity: .45; cursor: not-allow .setgrid > .card > p.info { margin: 0 0 12px; } .setgrid > .card > :last-child { margin-top: auto; } /* buttons and switches line up at the bottom of each row */ .setgrid > .card > .actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 14px; } -.setgrid > .card > .actions button { flex: 1 1 auto; } +.setgrid > .card > .actions button { flex: 1 1 0; min-width: max-content; } .setgrid > .card .devform { align-content: start; } .setgrid .seg { width: 100%; } .setgrid .seg button { min-height: 40px; } @@ -996,3 +996,21 @@ body.dashonly .dlink { cursor: default; } .djlim input[type=range] { width: 100%; margin: 8px 0 4px; } .row.djurl button.small { flex: 0 0 auto; width: auto; padding-inline: 14px; } .row.djurl code { flex: 1 1 auto; } +/* ---- UI pass: controls of one kind line up and have one size */ +.kv { display: flex; align-items: center; gap: 12px; margin-top: 8px; } +.kv > span { flex: 1; min-width: 0; } +.kvc { flex: 0 0 180px; display: flex; gap: 6px; align-items: stretch; } +.kvc button { flex: 1; } +.kvc input.short { flex: 0 0 76px !important; } +.setgrid > .card > div.info { margin: 0 2px 10px; } +.setgrid > .card > .remote-urls { margin-top: 10px; } +label.chk { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; } +label.chk input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); } +.paramgrid { display: grid; gap: 2px 24px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); } +.card:has(> .lkgrid) { display: flex; flex-direction: column; container-type: inline-size; } +.lkgrid { grid-template-columns: repeat(2, 1fr); } +@container (min-width: 280px) { .lkgrid { grid-template-columns: repeat(4, 1fr); } } +.lkch { min-width: 0; padding-inline: 4px; } +.lkactions { margin-top: auto; padding-top: 10px; } +.labcards .card > .row > button:only-child { flex: 1 1 100%; } +@media (max-width: 1150px) { .firsep { flex-basis: 100%; width: auto; height: 0; margin: 0; } }