From 3cf718e42cd88ac725958e27a93a5f7204d82c93 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Thu, 26 Nov 2026 11:14:35 +0000 Subject: [PATCH] fix(hub): the radio Channel select never clips its widest option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit At 768x1024 in Chromium the composer showed Pos instead of Post: both composer labels flex as 1 1 0 with min-width 0, so the Channel select shrank below its content. The Channel label now carries composer-channel with min-width max-content. The six-state radio layout probe measures the select against a hidden max-content twin in every state: on the old CSS 36 subtests fail (60 of 104 px at 768x1024 with a voice note, also 800x976 and 820x1180), with the fix the Chromium test is green and the select holds 104 of 104 px. The Firefox radio layout tests did not run on this change. 🎯 Fix: 97 % 💥 Break: 4 % 💸 Tokens: – ⏱️ Velocity: – 🛡️ Security: 100 % 🏆 Score: 93 🚦 Gate: ✅ 90/5, tokens and velocity <= 100, security 100 % Created-with: https://s.veen.world/skills Co-Authored-By: Claude Opus 5.5 --- orchestrator/templates/page-composer.js | 2 +- orchestrator/templates/style-ui.css | 1 + tests/e2e/radio_layout_probes.py | 9 +++++++++ tests/e2e/test_radio_layout_e2e.py | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/orchestrator/templates/page-composer.js b/orchestrator/templates/page-composer.js index 55312cb..19e38aa 100644 --- a/orchestrator/templates/page-composer.js +++ b/orchestrator/templates/page-composer.js @@ -244,7 +244,7 @@ channel.addEventListener("change", sync); sync(); const frame = micFrame(text, [record, status]); - frame.prepend(h("div", {class: "composer-grid"}, h("label", {}, "Channel", channel), toField)); + frame.prepend(h("div", {class: "composer-grid"}, h("label", {class: "composer-channel"}, "Channel", channel), toField)); frame.querySelector(".mic-foot").append(h("div", {class: "ptt-split", role: "group", "aria-label": "Send"}, submit, testMenu(text, channel)), mayday); const form = h("form", {class: "composer"}, frame, replay); const empty = () => { diff --git a/orchestrator/templates/style-ui.css b/orchestrator/templates/style-ui.css index b26f3a3..c40ad52 100644 --- a/orchestrator/templates/style-ui.css +++ b/orchestrator/templates/style-ui.css @@ -86,6 +86,7 @@ body.fit .spot-host { flex: none; } .composer-grid { display: flex; min-width: 0; border-bottom: 1px solid var(--line); } .composer-grid label { display: flex; flex: 1 1 0; align-items: center; gap: 6px; min-width: 0; padding-inline-start: 12px; color: var(--muted); font-size: var(--fs-sm); } .composer-grid label + label { border-inline-start: 1px solid var(--line); } +.composer-grid .composer-channel { min-width: max-content; } .composer-grid .field { flex: 1 1 auto; width: 100%; min-width: 0; border: 0; border-radius: 0; background: transparent; } .composer textarea { min-height: 64px; } .composer [hidden] { display: none; } diff --git a/tests/e2e/radio_layout_probes.py b/tests/e2e/radio_layout_probes.py index f10704b..f817531 100644 --- a/tests/e2e/radio_layout_probes.py +++ b/tests/e2e/radio_layout_probes.py @@ -276,6 +276,15 @@ SPOT = """(async () => {@HELPERS@@PROBES@@SPEAKING@ const hit = document.elementFromPoint(edge.left + edge.width / 2, edge.top + edge.height / 2); return {height: Math.round(box(node).height), title: words.title, full: words.textContent, cut: words.scrollWidth > words.clientWidth + 1, cancel: Boolean(hit && cancel.contains(hit))}; })(), + channel: (() => { + const select = form.querySelector(".composer-grid select"); + const twin = select.cloneNode(true); + twin.style.cssText = "position: absolute; visibility: hidden; width: max-content; min-width: 0;"; + select.after(twin); + const need = box(twin).width; + twin.remove(); + return [Math.round(box(select).width), Math.round(need)]; + })(), play: [note.querySelector(".voice-play"), note.querySelector("audio")].filter((node) => node && shown(node) && box(node).width > 0).map((node) => [node.tagName, Math.round(box(node).width), Math.round(box(node).height)]), line: (() => { const node = display.querySelector(".caption-line"); diff --git a/tests/e2e/test_radio_layout_e2e.py b/tests/e2e/test_radio_layout_e2e.py index fc3f6ad..123d84b 100644 --- a/tests/e2e/test_radio_layout_e2e.py +++ b/tests/e2e/test_radio_layout_e2e.py @@ -194,6 +194,7 @@ class TestRadioLayout(kit.RadioLayoutCase): self.assertEqual((found["banner"]["title"], found["banner"]["cut"], found["banner"]["cancel"]), (found["banner"]["full"], state == "mayday-long", True), found) self.assertTrue(found["banner"]["full"].endswith(ALARMS[state]), found) self.assertEqual(found["blocked"], [], found) + self.assertGreaterEqual(found["channel"][0], found["channel"][1] - 1, found) if state == "stations": self.assertEqual(found["closed"], [False, True], found) if state == "voice":