Skip to content

feat(cast): wire casting into the TUI (P key) - #77

Open
susamn wants to merge 1 commit into
feature/cast-chromecast-channelfrom
feature/cast-ui
Open

feat(cast): wire casting into the TUI (P key)#77
susamn wants to merge 1 commit into
feature/cast-chromecast-channelfrom
feature/cast-ui

Conversation

@susamn

@susamn susamn commented Aug 27, 2026

Copy link
Copy Markdown
Owner

Top of the stack (on #76). Makes casting usable from the TUI.

What

All cast logic stays in internal/cast; internal/ui gets one new file + small hooks:

  • internal/ui/cast.gocastController interface (satisfied by *cast.Manager), the P cast-picker overlay (modeled on markPicker: j/k/g/G, Enter, Esc; background discovery repaints the list), the Now Playing ▶ cast <device> indicator, startup re-attach
  • app.gocast + castPicker fields; one new Run param; {"P","cast"} hint; reattachCast() call
  • keys.gocase 'P'; picker added to the overlay list that keeps q-quit + transport keys live
  • nowplaying.go — one line: line2 += a.castStatusLine()
  • overlays.go — help paragraph
  • cmd/mpdtui/main.go — build cast.NewManager(...), pass to ui.Run

Selection/stop run through App.runAsync so the keypress never blocks on a device round-trip. cast is nil-guarded everywhere (same as metaDB).

Tests

internal/ui/cast_test.goP opens / needs-controller, status line, picker apply starts+stops.

After this

Chromecast casting works end-to-end from the TUI. Remaining: -stop/-cast-list/-cast-to/-cast-stop CLI flags, config-template doc lines, README, then HA + DLNA providers.

No new dependencies in the whole stack.

Adds the interactive casting surface. All cast logic stays in
internal/cast; internal/ui gets one new file plus small hooks.

- internal/ui/cast.go: castController interface (satisfied by
  *cast.Manager), the 'P' cast-picker overlay (modeled on markPicker --
  j/k/g/G, Enter, Esc; background discovery repaints the list), the Now
  Playing "> cast <device>" indicator, and startup re-attach
- app.go: `cast castController` + `castPicker` fields; one new Run param;
  {"P","cast"} hint; reattachCast() call
- keys.go: `case 'P'`; cast picker added to the overlay list that keeps
  q-quit and transport keys live
- nowplaying.go: one line appending castStatusLine()
- overlays.go: help text paragraph
- cmd/mpdtui/main.go: build cast.NewManager(cast.LoadConfig(host), client)
  and pass it to ui.Run

Device selection / stop run through App.runAsync so the keypress never
blocks on a device round-trip. cast controller is nil-guarded everywhere
(tests, or if unavailable), same convention as metaDB.

internal/ui/cast_test.go: 'P' opens/needs-controller, status line,
picker apply starts/stops. No new dependencies.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JBJdG8Qenand5i16WT6BHG
@susamn
susamn force-pushed the feature/cast-chromecast-channel branch from 8044e1a to a546e20 Compare August 28, 2026 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant