feat(orchestrator): add a Squelch test button to the radio device card
Test Squelch plays the burst of a radio row at the All radio volume times the squelch, like the test buttons of the four tone rows; the threshold row has none (operator 2026-11-17). The radio set e2e asserts the test buttons per knob row and that the burst lights the lamp through the bandpass filter without speech; 004 names the rule. 🎯 Fix: 95 % 💥 Break: 2 % 💸 Tokens: 100 % ⏱️ Velocity: 100 % 🛡️ Security: 100 % 🏆 Score: 93 🚦 Gate: ✅ 90/5, tokens and velocity <= 100, security 100 % Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
53a69daeaf
commit
e9cd1aeda5
4 files changed
+15
-4
No files matched your search
@@ -160,8 +160,10 @@ flowchart TD
|
|||||||
### Layout and history rows (operator 2026-11-14)
|
### Layout and history rows (operator 2026-11-14)
|
||||||
|
|
||||||
- [ ] The radio shows a Device card on the left (display line, Auto, Quiet
|
- [ ] 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,
|
and Silence, the six level sliders one per row with label, slider and
|
||||||
value and test button, the internet stations folded in a details) 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.
|
on the right, the Speak card above the History card.
|
||||||
- [ ] Every knob label starts at the same x position (one label column).
|
- [ ] 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
|
- [ ] At 1920, 1366, 960 and 390 px the document's `scrollWidth` is at most
|
||||||
|
|||||||
@@ -155,6 +155,7 @@
|
|||||||
function knobs() {
|
function knobs() {
|
||||||
const tones = SOUND_KINDS.map(([id, label]) => toneKnob(id, label));
|
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}));
|
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));
|
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)));
|
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");
|
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");
|
||||||
|
|||||||
@@ -132,10 +132,16 @@ FACE = """(async () => {@HELPERS@@RADIO@
|
|||||||
const label = row.querySelector(".knob-label");
|
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};
|
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");
|
const gear = all(".spot-head button", spot).find((button) => name(button) === "Read aloud");
|
||||||
gear.click();
|
gear.click();
|
||||||
await sleep(200);
|
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 stationsHead = text(spot.querySelector(".radio-station .group-title"));
|
||||||
const ptt = spot.querySelector('form.composer button[type="submit"]');
|
const ptt = spot.querySelector('form.composer button[type="submit"]');
|
||||||
const pageFits = fits();
|
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)];
|
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();
|
all("#sheet .sheet-head button").find((button) => name(button) === "Close").click();
|
||||||
await sleep(200);
|
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@
|
LOG = """(async () => {@HELPERS@@RADIO@
|
||||||
await until(() => rows().length, 8000);
|
await until(() => rows().length, 8000);
|
||||||
|
|||||||
@@ -142,6 +142,8 @@ class TestRadioSet(HubCase):
|
|||||||
shown = "50" if index == 0 or not signed else str(THRESHOLDS[base.WIDTHS[index - 1][0]])
|
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(face["knobs"][-1][1:], ["0", "100", "10", shown])
|
||||||
self.assertEqual(len(face["toneToggles"]), 4)
|
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} %"])
|
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"]:
|
for label in face["labels"]:
|
||||||
self.assertEqual((label["title"], label["row"]), (label["text"], True), label)
|
self.assertEqual((label["title"], label["row"]), (label["text"], True), label)
|
||||||
|
|||||||
Reference in new issue
Block a user