Commit ee1362d
feat: redesign cast UX with unified Connect drawer (#14357)
## Summary
Replaces the AirPlay/Chromecast settings toggle and the grayed-out cast
icon with a Spotify-style "Connect" picker behind a single cast button
on **both mobile and web**.
### Mobile (now-playing drawer)
- New `IconCast` button opens a `ConnectDrawer` listing:
1. **This Device** — ends any active chromecast session
2. **AirPlay & Bluetooth** on iOS (`openAirplayDialog`) / **Bluetooth**
on Android (`Linking.sendIntent('android.settings.BLUETOOTH_SETTINGS')`
with `openSettings` fallback)
3. Each chromecast device discovered via `useDevices()` — tap starts a
session via `SessionManager.startSession(deviceId)`
- Cast button is grayed/disabled only when offline AND no chromecast
devices discovered
- The active device gets a primary tint + checkmark; the same goes for
"This Device" when nothing is casting
### Web (desktop play bar)
- New cast button placed next to the queue button
- "Connect" popup with **This web browser** + **Google Cast devices**
rows
- "Google Cast devices" calls `audio.remote.prompt()` to surface
**Chrome's built-in cast picker** — no Cast Web Sender receiver needed
- Hidden entirely when `RemotePlayback` isn't supported (non-Chromium
browsers)
### Settings
- Removed `CastSettingsRow` (the AirPlay/Chromecast segmented control).
The user no longer chooses a method up-front — they pick a target each
time from the drawer.
### Harmony
- New `IconCast` (Spotify-style laptop + speaker) and `IconCastSpeaker`
(standalone speaker for device rows). Existing `IconCastAirplay` /
`IconCastChromecast` left untouched.
### Redux (`@audius/common/store/cast`)
- Dropped `method`, `updateMethod`, `CastMethod` type, `CAST_METHOD`
storage key, and both persistence sagas
- Kept `isCasting` and added an optional `deviceName` so the drawer can
mark the active device. `GoogleCast.tsx` resolves
`castSession.getCastDevice().friendlyName` and `Airplay.tsx` passes the
audio route's `portName`
## Test plan
- [ ] **Mobile iOS**: tap cast icon on the now-playing drawer → drawer
shows This Device + AirPlay & Bluetooth + chromecast devices. AirPlay
row opens the system picker. Selecting a chromecast device starts a
session and the icon turns active.
- [ ] **Mobile Android**: same flow but second row is labeled
"Bluetooth" and opens `android.settings.BLUETOOTH_SETTINGS`.
- [ ] **Mobile offline**: cast icon is grayed/disabled.
- [ ] **Mobile**: "This Device" row ends an active chromecast session
and the audio resumes locally.
- [x] **Web (Chrome)**: cast icon appears between volume and queue.
Popup shows This web browser + Google Cast devices. Clicking the
cast-devices row opens Chrome's native picker.
- [ ] **Web (Safari/Firefox)**: cast button is hidden (no
`RemotePlayback`).
- [ ] **Settings**: the AirPlay/Chromecast segmented control is gone
from the iOS settings screen.
## Notes
- No native iOS / Android code changes — existing Bonjour entries
(`Info.plist`) and the cast receiver `222B31C8` (`AndroidManifest.xml`)
are untouched.
- Mobile typecheck/lint baseline is broken in the worktree environment
(missing `@react-native/typescript-config/tsconfig.json` in
node_modules; ~13k pre-existing errors), so a clean baseline-vs-after
comparison wasn't possible locally. The one real type issue surfaced —
narrowing `isCasting && ...` in the drawer — is fixed with
`Boolean(...)`.
- Web `cast-button/` + `PlayBar.tsx` pass ESLint cleanly.
- Web dev server couldn't be started in the worktree
(`packages/web/env/` missing), so no browser screenshot of the new
button.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>1 parent d7d7b51 commit ee1362d
23 files changed
Lines changed: 799 additions & 281 deletions
File tree
- packages
- common/src/store/cast
- harmony/src
- assets/icons
- icons
- individual
- mobile/src
- app
- components
- audio
- connect-drawer
- now-playing-drawer
- harmony-native
- screens/settings-screen
- store/drawers
- web/src/components
- cast-button
- play-bar
- desktop
- queue-button
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | 5 | | |
8 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
| 3 | + | |
9 | 4 | | |
10 | 5 | | |
11 | | - | |
12 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
13 | 9 | | |
14 | 10 | | |
15 | 11 | | |
16 | 12 | | |
17 | 13 | | |
18 | 14 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | 15 | | |
28 | 16 | | |
29 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
30 | 24 | | |
31 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
32 | 39 | | |
33 | 40 | | |
34 | 41 | | |
35 | 42 | | |
36 | | - | |
| 43 | + | |
37 | 44 | | |
38 | 45 | | |
39 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | 1 | | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
Loading
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
173 | 174 | | |
174 | 175 | | |
175 | 176 | | |
| 177 | + | |
176 | 178 | | |
177 | 179 | | |
178 | 180 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
58 | 59 | | |
59 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
60 | 66 | | |
61 | 67 | | |
62 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| 44 | + | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
| |||
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
92 | 93 | | |
93 | | - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
94 | 111 | | |
95 | 112 | | |
96 | 113 | | |
| |||
0 commit comments