From fb048df885ec4c559912bc6da8a3ea339d3e2812 Mon Sep 17 00:00:00 2001 From: jim kolpack Date: Tue, 29 Sep 2026 19:34:44 -0400 Subject: [PATCH] Always render the show/host and time rows, even when empty Previously these rows were only added when the underlying data was present, so the layout would shift depending on what SUB/WAVE happened to report at the moment -- e.g. the time row would jump up a line whenever there was no active show. Now both rows always render (with blank text where needed) so they hold a fixed vertical position regardless of what data is available. --- subwave_nowplaying.star | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/subwave_nowplaying.star b/subwave_nowplaying.star index 9315c76..a3ed250 100644 --- a/subwave_nowplaying.star +++ b/subwave_nowplaying.star @@ -121,18 +121,21 @@ def main(config): art = _fetch_cover(station_url, now["subsonic_id"]) progress = _track_progress(now["subsonic_id"], now["duration"]) + # The show/host and time/temp rows always render, even when empty, so + # they hold a fixed vertical position regardless of which fields a given + # track/moment actually has data for -- rather than the layout shifting + # up when e.g. there's a show but no DJ credited, or no show at all. + show_host_row = [render.Text(now["show"], font = "tom-thumb", color = colors["text"])] + if now["host"]: + show_host_row.append(render.Text(" " + now["host"], font = "tom-thumb", color = colors["accent"])) + top_lines = [ render.Marquee(width = 32, child = render.Text(now["title"], color = colors["text"])), render.Marquee(width = 32, child = render.Text(now["artist"], color = colors["text"])), + render.Box(width = 32, height = 1, color = colors["separator"]), + render.Marquee(width = 32, child = render.Row(children = show_host_row)), + render.Marquee(width = 32, child = render.Text(now["time_temp"], font = "tom-thumb", color = colors["meta"])), ] - if now["show"]: - top_lines.append(render.Box(width = 32, height = 1, color = colors["separator"])) - show_host_row = [render.Text(now["show"], font = "tom-thumb", color = colors["text"])] - if now["host"]: - show_host_row.append(render.Text(" " + now["host"], font = "tom-thumb", color = colors["accent"])) - top_lines.append(render.Marquee(width = 32, child = render.Row(children = show_host_row))) - if now["time_temp"]: - top_lines.append(render.Marquee(width = 32, child = render.Text(now["time_temp"], font = "tom-thumb", color = colors["meta"]))) children = [render.Column(children = top_lines)] if progress != None: