feat(cast): wire casting into the TUI (P key) - #77
Open
susamn wants to merge 1 commit into
Open
Conversation
susamn
force-pushed
the
feature/cast-ui
branch
from
August 28, 2026 02:54
7f382bc to
aea1cad
Compare
susamn
force-pushed
the
feature/cast-chromecast-channel
branch
from
August 28, 2026 02:54
d29edd9 to
8044e1a
Compare
susamn
force-pushed
the
feature/cast-ui
branch
from
August 28, 2026 03:06
aea1cad to
e47d658
Compare
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
force-pushed
the
feature/cast-chromecast-channel
branch
from
August 28, 2026 03:47
8044e1a to
a546e20
Compare
susamn
force-pushed
the
feature/cast-ui
branch
from
August 28, 2026 03:47
e47d658 to
aaa408f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Top of the stack (on #76). Makes casting usable from the TUI.
What
All cast logic stays in
internal/cast;internal/uigets one new file + small hooks:internal/ui/cast.go—castControllerinterface (satisfied by*cast.Manager), thePcast-picker overlay (modeled onmarkPicker: j/k/g/G, Enter, Esc; background discovery repaints the list), the Now Playing▶ cast <device>indicator, startup re-attachapp.go—cast+castPickerfields; one newRunparam;{"P","cast"}hint;reattachCast()callkeys.go—case 'P'; picker added to the overlay list that keeps q-quit + transport keys livenowplaying.go— one line:line2 += a.castStatusLine()overlays.go— help paragraphcmd/mpdtui/main.go— buildcast.NewManager(...), pass toui.RunSelection/stop run through
App.runAsyncso the keypress never blocks on a device round-trip.castis nil-guarded everywhere (same asmetaDB).Tests
internal/ui/cast_test.go—Popens / 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-stopCLI flags, config-template doc lines, README, then HA + DLNA providers.No new dependencies in the whole stack.