From 936d7f64a98d123978d9b874fdc19de122b40126 Mon Sep 17 00:00:00 2001 From: Givou Date: Mon, 2 Nov 2026 17:34:40 +0100 Subject: [PATCH] Dashboard levels: link groups as a thin line with a small name Co-Authored-By: Claude Opus 5.5 --- static/dashboard.js | 17 ++++++++++++++++- static/style.css | 10 +++------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/static/dashboard.js b/static/dashboard.js index b7f1345..db066e2 100644 --- a/static/dashboard.js +++ b/static/dashboard.js @@ -55,6 +55,21 @@ function dashChannelNav(m, d, s) { h("button", { class: "small", "data-view-ok": "", "aria-label": t("Next channel"), onclick: () => go(1) }, "›")); } +// link groups in the level meters: a thin line with a small name (the mixer has the big brackets) +function dashGroups(d, kind) { + const out = []; + linkedGroups(d, kind).forEach(g => { + const color = custColor(d, kind, g[0]) || linkInfo(d, kind, g[0]).color, name = linkName(d, kind, g); + g.forEach((j, n) => { + if (n && g[n - 1] === j - 1) return; + let len = 1; + while (g.includes(j + len)) len++; + out.push(h("div", { class: "dgrp", style: `--lc:${color};grid-column:${j + 1} / span ${len}`, title: (name ? name + " · " : "") + g.map(i => chLabel(kind, i)).join(" + ") }, name)); + }); + }); + return out; +} + const DASH_MODULES = { status: { title: () => t("DSP overview"), w: 4, min: [3, 3], max: [12, 14], h: () => 2 + Math.ceil(dashDevs().length * 1.2), global: true, @@ -75,7 +90,7 @@ const DASH_MODULES = { body(m, d) { const col = (k, i) => h("div", { class: "dm" + (chans(d, k)[i].mute ? " muted" : ""), title: chTitle(d, k, i), style: `${ccStyle(d, k, i)};grid-column:${i + 1}` }, ledMeter(d.id, k, i), k === "out" ? limLed(d.id, i) : h("span", { class: "limled ph", "aria-hidden": "true" }), h("small", {}, chLabel(k, i).replace("Out ", "").replace("In ", ""))); - const group = (k, label) => h("div", { class: "dmgroup", style: `flex-grow:${chans(d, k).length}` }, h("div", { class: "sub" }, label), h("div", { class: "dms", style: `--n:${chans(d, k).length}` }, linkBands(d, k), chans(d, k).map((_, i) => col(k, i)))); + const group = (k, label) => h("div", { class: "dmgroup", style: `flex-grow:${chans(d, k).length}` }, h("div", { class: "sub" }, label), h("div", { class: "dms", style: `--n:${chans(d, k).length}` }, dashGroups(d, k), chans(d, k).map((_, i) => col(k, i)))); const bands = linkedGroups(d, "in").length + linkedGroups(d, "out").length > 0; return h("div", { class: "dmeters" + (bands ? " hasbands" : "") }, group("in", t("Inputs")), group("out", t("Outputs"))); }, diff --git a/static/style.css b/static/style.css index 30b9b34..1e1fad8 100644 --- a/static/style.css +++ b/static/style.css @@ -832,14 +832,10 @@ body.ddragging { user-select: none; -webkit-user-select: none; cursor: grabbing; .dmgroup { flex: 1 1 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; } .dmgroup .sub { flex: none !important; margin: 0; } .dms { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); grid-template-rows: 0 minmax(0, 1fr); gap: 0 4px; } -.dmeters.hasbands .dms { grid-template-rows: 22px minmax(0, 1fr); } +.dmeters.hasbands .dms { grid-template-rows: 18px minmax(0, 1fr); } .dms > .dm { grid-row: 2; } -.dms .lkband { height: 8px; margin: 0 5px 3px; border-width: 1.5px; border-radius: 7px 7px 0 0; } -.dms .lkband::before, .dms .lkband::after { width: 4px; height: 4px; bottom: -2px; } -.dms .lkband::before { left: -3px; } .dms .lkband::after { right: -3px; } -.dms .lkband .lkname { padding: 0 5px; font-size: 9px; letter-spacing: .04em; gap: 3px; max-width: calc(100% + 6px); } -.dms .lkband .lkname svg { width: 9px; height: 9px; } -.dms .lkband.single { margin: 0 3px 3px; } +.dgrp { grid-row: 1; align-self: end; min-width: 0; margin-bottom: 4px; padding-bottom: 1px; border-bottom: 2px solid var(--lc); color: var(--lc); + font-size: 9px; line-height: 11px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .dm { --cc: var(--warn); display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; min-height: 0; } .dm .led { flex: 1 1 0; height: auto; min-height: 0; padding: 0; } .dm small { color: var(--cc); font-size: 11px; font-weight: 700; }