Skip to content

Support color@v1 role in the TUI for dynamic color themes based on the musics artwork#254

Merged
maximmaxim345 merged 4 commits into
mainfrom
feat/color-role
May 21, 2026
Merged

Support color@v1 role in the TUI for dynamic color themes based on the musics artwork#254
maximmaxim345 merged 4 commits into
mainfrom
feat/color-role

Conversation

@maximmaxim345
Copy link
Copy Markdown
Member

Subscribes to the color@v1 role and tints panel backgrounds, borders, text, and the visualizer gradient from server-pushed artwork palettes. Adds a t shortcut to toggle dark/light theme, persisted across runs, with fallback to the previous unthemed rendering when no palette is present.

When connected to Music Assistant, the colors will be extracted from the album artwork.

Subscribes to `color@v1` so server-pushed artwork palettes tint panel
backgrounds, borders, text, and the visualizer gradient. A `t` shortcut
toggles dark/light theme, persisted across runs, with fallback to
unthemed rendering when no palette is present.
Copilot AI review requested due to automatic review settings May 21, 2026 09:48
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds server-driven artwork palette theming support to the Sendspin TUI by subscribing to the color@v1 role and applying palette-derived colors to panels and the spectrum visualizer, plus a persisted dark/light toggle.

Changes:

  • Bump aiosendspin to ~=5.3 to access color@v1 support.
  • Subscribe to the color role (Roles.COLOR) and forward palette updates into the TUI, resetting palette on disconnect.
  • Extend the visualizer renderer and TUI layout/panels to support palette-based backgrounds and gradients, and add a t keybinding to toggle theme mode (persisted).

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
uv.lock Updates lockfile to aiosendspin 5.3.0 and associated metadata.
pyproject.toml Bumps runtime dependency to aiosendspin[server]~=5.3.
sendspin/tui/visualizer.py Adds palette anchors/background and configurable peak-marker color for spectrum rendering.
sendspin/tui/ui.py Introduces palette state, theme mode toggle/persistence hook, and palette-tinted panels/layout.
sendspin/tui/keyboard.py Adds t shortcut mapped to toggling the UI color mode.
sendspin/tui/app.py Requests Roles.COLOR, attaches color listener, persists theme choice, resets palette on detach.
sendspin/settings.py Persists color_mode across runs in client settings.
Comments suppressed due to low confidence (1)

sendspin/tui/ui.py:618

  • In palette mode, name_style/url_style force hard-coded foreground colors (e.g. white, cyan) which can break contrast in LIGHT mode (panel fg becomes black, but these spans override to white/cyan). Consider passing these through _themed(...) (or omitting explicit fg colors so they inherit the panel’s palette fg).
                # Server name
                name_style = "bold white" if is_selected else "white"
                line.append(server.name, style=name_style)

                # Current server indicator
                if is_current:
                    line.append(" (current)", style=self._themed("dim green"))

                content.add_row(line)

                # Show URL below name
                url_line = Text()
                url_line.append("   ")
                url_style = "cyan" if is_selected else "dim"
                url_line.append(f"   {server.host}:{server.port}", style=url_style)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread sendspin/tui/ui.py
Comment thread sendspin/tui/ui.py
Comment thread sendspin/tui/visualizer.py
@maximmaxim345 maximmaxim345 merged commit addff75 into main May 21, 2026
1 check passed
@maximmaxim345 maximmaxim345 deleted the feat/color-role branch May 21, 2026 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants