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":