diff --git a/docs/requirements/004-radio-set.md b/docs/requirements/004-radio-set.md index 2a4fea0..a51c3ec 100644 --- a/docs/requirements/004-radio-set.md +++ b/docs/requirements/004-radio-set.md @@ -160,8 +160,10 @@ flowchart TD ### Layout and history rows (operator 2026-11-14) - [ ] The radio shows a Device card on the left (display line, Auto, Quiet - and Silence, the six level sliders one per row with label, slider, - value and test button, the internet stations folded in a details) and, + and Silence, the six level sliders one per row with label, slider and + value, a test button on the four tone rows and on Squelch, which plays + the burst of a radio row, none on the speech threshold (operator + 2026-11-17), the internet stations folded in a details) and, on the right, the Speak card above the History card. - [ ] Every knob label starts at the same x position (one label column). - [ ] At 1920, 1366, 960 and 390 px the document's `scrollWidth` is at most diff --git a/orchestrator/templates/page-radioview.js b/orchestrator/templates/page-radioview.js index c611702..b211ed6 100644 --- a/orchestrator/templates/page-radioview.js +++ b/orchestrator/templates/page-radioview.js @@ -155,6 +155,7 @@ function knobs() { const tones = SOUND_KINDS.map(([id, label]) => toneKnob(id, label)); const squelch = knob("Squelch", "Squelch: scales every tone, the speech and the burst; 0 plays none", {min: 0, max: 1, step: 0.05}, (value) => keepRadio({squelch: value})); + squelch.row.append(iconBtn("bi-play-fill", "Test Squelch", "btn small ghost knob-test", () => say({steps: [{kind: "burst"}], voice: "", tone: "radio", cls: "post", who: HUMAN, sent: true, line: "squelch test"}), "Test: play the burst of a radio row, at the All radio volume times the squelch")); const threshold = knob("Threshold", "Speech threshold: the hub renders new speech only while the host CPU lies below it, always at 100 %, never at 0 %; your passkey signs each change", RadioSet.GATE, (value) => drawGate(threshold, value)); threshold.input.addEventListener("change", (event) => setThreshold(Number(event.target.value))); const check = iconBtn("bi-broadcast", "Radio check", "btn small ghost radio-check", () => say({steps: [{kind: "speech", text: state.speech.sample}], voice: state.speech.operator, tone: "direct", cls: "newsletter", who: HUMAN, sent: true, line: "radio check"}), "Radio check: hear the operator's voice once"); diff --git a/tests/e2e/radio_set_kit.py b/tests/e2e/radio_set_kit.py index 49eb7c2..ee96fd0 100644 --- a/tests/e2e/radio_set_kit.py +++ b/tests/e2e/radio_set_kit.py @@ -132,10 +132,16 @@ FACE = """(async () => {@HELPERS@@RADIO@ const label = row.querySelector(".knob-label"); return {text: text(label), title: label.title, whole: label.scrollWidth <= label.clientWidth + 1, row: row.scrollWidth <= row.clientWidth + 1}; }); + const testButtons = all(".radio-knobs .knob-row", spot).map((row) => (row.querySelector(".knob-test") ? name(row.querySelector(".knob-test")) : null)); + const atTest = mark(); + all(".radio-knobs .knob-test", spot).find((button) => name(button) === "Test Squelch").click(); + const squelchLit = Boolean(await until(() => lamp().dataset.lit === "true" && audio().filters.length > atTest.filters, 6000)); + const squelch = {lit: squelchLit, filters: since(atTest).filters.map(([type]) => type), tts: since(atTest).tts}; + await until(() => lamp().dataset.lit === "false", 6000); const gear = all(".spot-head button", spot).find((button) => name(button) === "Read aloud"); gear.click(); await sleep(200); - const groups = Object.fromEntries(all("#radio-gear .chips", spot).map((group) => [group.getAttribute("aria-label"), all(".chip", group).map((chipNode) => [text(chipNode), chipNode.getAttribute("aria-pressed"), chipNode.disabled])])); + const groups =Object.fromEntries(all("#radio-gear .chips", spot).map((group) => [group.getAttribute("aria-label"), all(".chip", group).map((chipNode) => [text(chipNode), chipNode.getAttribute("aria-pressed"), chipNode.disabled])])); const stationsHead = text(spot.querySelector(".radio-station .group-title")); const ptt = spot.querySelector('form.composer button[type="submit"]'); const pageFits = fits(); @@ -149,7 +155,7 @@ FACE = """(async () => {@HELPERS@@RADIO@ const stations = [document.querySelector("#sheet .sheet-box").getAttribute("aria-label"), all("#sheet .settings h3").map(text)]; all("#sheet .sheet-head button").find((button) => name(button) === "Close").click(); await sleep(200); - return {display, modes, knobs, toneToggles, labels, groups, stationsHead, ptt: [text(ptt), ptt.title], sections, stations, fits: pageFits, unlabelled: unlabelled(), palette: getComputedStyle(document.documentElement).getPropertyValue("--panel").trim(), violations: window.e2eViolations}; + return {display, modes, knobs, toneToggles, testButtons, squelch, labels, groups, stationsHead, ptt: [text(ptt), ptt.title], sections, stations, fits: pageFits, unlabelled: unlabelled(), palette: getComputedStyle(document.documentElement).getPropertyValue("--panel").trim(), violations: window.e2eViolations}; })()""" LOG = """(async () => {@HELPERS@@RADIO@ await until(() => rows().length, 8000); diff --git a/tests/e2e/test_radio_set_e2e.py b/tests/e2e/test_radio_set_e2e.py index 94d630c..1600838 100644 --- a/tests/e2e/test_radio_set_e2e.py +++ b/tests/e2e/test_radio_set_e2e.py @@ -142,6 +142,8 @@ class TestRadioSet(HubCase): shown = "50" if index == 0 or not signed else str(THRESHOLDS[base.WIDTHS[index - 1][0]]) self.assertEqual(face["knobs"][-1][1:], ["0", "100", "10", shown]) self.assertEqual(len(face["toneToggles"]), 4) + self.assertEqual(face["testButtons"], [*(f"Test {knob[0]}" for knob in face["knobs"][:-1]), None]) + self.assertEqual(face["squelch"], {"lit": True, "filters": ["bandpass"], "tts": []}, face) self.assertEqual([label["text"] for label in face["labels"]], [*(knob[0] for knob in face["knobs"][:-1]), f"speak while CPU < {shown} %"]) for label in face["labels"]: self.assertEqual((label["title"], label["row"]), (label["text"], True), label)