Conversation
📝 WalkthroughWalkthroughAdds previousView state for bottom-sheet navigation, broadens device filtering for microphones/speakers, changes audio stream stop behavior to optionally preserve state, and introduces platform-aware audio routing tied to selected audio devices. Changes
Sequence Diagram(s)sequenceDiagram
participant DeviceStore as Device Store\n(selectedAudioDevices)
participant LiveKitStore as LiveKit Store
participant Room as LiveKit Room
participant AudioAPI as Expo Audio API
DeviceStore->>LiveKitStore: selectedAudioDevices changes
activate LiveKitStore
LiveKitStore->>LiveKitStore: setupAudioRouting(room) invoked
LiveKitStore->>LiveKitStore: log selected speaker/mic info
alt Platform is Android/iOS
LiveKitStore->>AudioAPI: Audio.setAudioModeAsync(mode)
AudioAPI-->>LiveKitStore: mode applied
end
LiveKitStore->>Room: apply routing (speaker vs earpiece)
Room-->>LiveKitStore: routing confirmed
deactivate LiveKitStore
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/components/settings/audio-device-selection.tsx (1)
25-32: Align analytics counts with updated device filters.
The mic/speaker lists now include wired/default and excludedefault-micfor speakers, but the analytics counts still use the old criteria, so event payloads can drift from what users see. Consider updating the counts to match the new filters.🔧 Update analytics counts to match the new filters
- availableMicrophonesCount: availableAudioDevices.filter((device) => (device.type === 'bluetooth' ? device.isAvailable : true)).length, - availableSpeakersCount: availableAudioDevices.filter((device) => device.isAvailable).length, + availableMicrophonesCount: availableAudioDevices.filter( + (device) => + (device.type === 'bluetooth' || device.type === 'wired' || device.type === 'default') && + (device.type !== 'bluetooth' || device.isAvailable) + ).length, + availableSpeakersCount: availableAudioDevices.filter( + (device) => + (device.type === 'bluetooth' || device.type === 'wired' || device.type === 'speaker' || device.type === 'default') && + device.id !== 'default-mic' && + (device.type !== 'bluetooth' || device.isAvailable) + ).length,
🧹 Nitpick comments (2)
src/stores/app/livekit-store.ts (2)
16-17: Remove duplicated comment line.
Two identical comment lines are stacked; keep just one.🧹 Suggested cleanup
-// Helper function to setup audio routing based on selected devices -// Helper function to setup audio routing based on selected devices +// Helper function to setup audio routing based on selected devices
34-43: Avoidanyin audioModeConfig typing.
Use expo-av’s AudioMode type (or the equivalent in your version) to keep type safety. Please confirm the exact type name in your expo-av version (e.g., AudioMode vs AudioModeOptions). As per coding guidelines, avoid usingany; use precise types.✅ Type-safe config
-import { Audio } from 'expo-av'; +import { Audio, type AudioMode } from 'expo-av'; @@ - const audioModeConfig: any = { + const audioModeConfig: AudioMode = {
|
Approve |
Summary by CodeRabbit
New Features
Improvements
✏️ Tip: You can customize this high-level summary in your review settings.