style: hide inactive track placeholder #10

Merged
tom merged 1 commits from style/hide-empty-track into main 2026-09-11 22:23:25 +00:00
2 changed files with 6 additions and 1 deletions

No files matched your search

+4 -1
View File
@@ -46,7 +46,10 @@ function render() {
for (const zone of zones) {
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 trackText = zone.state === 'PLAYING' && zone.track.title
? `${zone.track.title}${zone.track.artist ? ' · ' + zone.track.artist : ''}`
: '';
const track = el('p', 'track', zone.error || trackText);
const controls = el('div', 'controls');
for (const [icon, label, action] of [['▶','Play','play'], ['Ⅱ','Pause','pause'], ['■','Stopp','stop']]) {
const button = el('button', action === 'play' ? 'stacked-play' : null);
+2
View File
@@ -257,3 +257,5 @@ def test_zone_cards_render_name_directly_without_transport_status():
assert "zone-head" not in source
assert ".zone-head" not in styles
assert "card.append(name, track, controls, volume, eq, zoneActions)" in source
assert "Kein aktueller Titel" not in source
assert "zone.state === 'PLAYING' && zone.track.title" in source