diff --git a/app/static/app.js b/app/static/app.js index fc6b4b4..900f5b3 100644 --- a/app/static/app.js +++ b/app/static/app.js @@ -41,14 +41,11 @@ async function setEq(uid, control, value, input) { } } function option(value, text) { const item = el('option', null, text); item.value = value; return item; } -function stateName(state) { return ({PLAYING:'WIEDERGABE', PAUSED_PLAYBACK:'PAUSIERT', STOPPED:'GESTOPPT', TRANSITIONING:'WECHSEL', UNAVAILABLE:'NICHT ERREICHBAR'})[state] || state; } - function render() { const root = $('#zones'); root.replaceChildren(); for (const zone of zones) { - const card = el('article', 'zone'), head = el('div', 'zone-head'), names = el('div'); - names.append(el('h2', null, zone.name)); - head.append(names, el('span', 'state', stateName(zone.state))); + const card = el('article', 'zone'); + const name = el('h2', null, zone.name); const track = el('p', 'track', zone.error || (zone.track.title ? `${zone.track.title}${zone.track.artist ? ' · ' + zone.track.artist : ''}` : 'Kein aktueller Titel')); const controls = el('div', 'controls'); for (const [icon, label, action] of [['▶','Play','play'], ['Ⅱ','Pause','pause'], ['■','Stopp','stop']]) { @@ -77,7 +74,7 @@ function render() { const leave = el('button', 'danger', 'Aus Gruppe lösen'); leave.hidden = zone.memberUids.length < 2; leave.onclick = () => act(`/api/groups/${encodeURIComponent(zone.uid)}`, 'DELETE'); const zoneActions = el('div', 'zone-actions'); zoneActions.append(loudness, leave); - card.append(head, track, controls, volume, eq, zoneActions); root.append(card); + card.append(name, track, controls, volume, eq, zoneActions); root.append(card); } renderSelects(); loadMusic(); } diff --git a/app/static/style.css b/app/static/style.css index 8c8d599..33d71ad 100644 --- a/app/static/style.css +++ b/app/static/style.css @@ -72,17 +72,6 @@ h2 { box-shadow: 0 8px 28px #0005; } -.zone-head { - display: flex; - justify-content: space-between; - gap: 9px; -} - -.state { - color: #d8b4fe; - font-size: .68rem; -} - .track { min-height: 32px; margin: 8px 0; diff --git a/tests/test_app.py b/tests/test_app.py index 20eed4b..0306596 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -246,3 +246,14 @@ def test_frontend_serializes_eq_writes_and_reloads_confirmed_values(): assert source.count("await load(false)") >= 3 assert "loudness.dataset.value !== 'true'" in source assert "value:!zone.loudness" not in source + + +def test_zone_cards_render_name_directly_without_transport_status(): + source = Path("app/static/app.js").read_text(encoding="utf-8") + styles = Path("app/static/style.css").read_text(encoding="utf-8") + assert "stateName" not in source + assert "el('span', 'state'" not in source + assert "WIEDERGABE" not in source + assert "zone-head" not in source + assert ".zone-head" not in styles + assert "card.append(name, track, controls, volume, eq, zoneActions)" in source