feat(react): display loading indicator while participant audio is connecting#2167
feat(react): display loading indicator while participant audio is connecting#2167
Conversation
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughDetects "audio connecting" by tracking a participant's audio track mute/unmute state via a new hook and conditionally renders a LoadingIndicator in the participant view; adds SCSS to size the indicator and a new English translation string. Changes
Sequence Diagram(s)sequenceDiagram
participant UI as ParticipantView UI
participant Hook as useIsTrackUnmuted Hook
participant Track as Audio Track
participant Indicator as LoadingIndicator
UI->>Hook: mount with participant
Hook->>Track: read first audio track (if present)
Hook->>Track: subscribe to mute/unmute events
Track-->>Hook: emit "mute"/"unmute"
Hook-->>UI: update unmuted state
alt hasAudio && not unmuted && indicatorsVisible
UI->>Indicator: render "Audio is connecting..." indicator
else
UI->>Indicator: do not render / remove
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
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: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@packages/react-sdk/src/core/components/ParticipantView/DefaultParticipantViewUI.tsx`:
- Around line 148-152: The participant name container uses a span (class
"str-video__participant-details__name") but conditionally renders
LoadingIndicator (a div) inside it, creating invalid DOM nesting; update the
markup in DefaultParticipantViewUI so the name container is a div instead of a
span (or alternatively render the LoadingIndicator outside the span or convert
it to an inline element) to ensure the LoadingIndicator (component name
LoadingIndicator) is not a block-level div nested inside a span; keep the same
className and styling when switching to a div to preserve layout.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: cbcb42a9-8768-458e-81df-b9a7c6175711
📒 Files selected for processing (2)
packages/react-sdk/src/core/components/ParticipantView/DefaultParticipantViewUI.tsxpackages/styling/src/ParticipantView/ParticipantView-layout.scss
packages/react-sdk/src/core/components/ParticipantView/DefaultParticipantViewUI.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@packages/react-sdk/src/core/components/ParticipantView/DefaultParticipantViewUI.tsx`:
- Around line 150-152: The loading indicator is currently shown for both local
and remote users; restrict it to remote participants only by adding a check for
the participant's locality when rendering in DefaultParticipantViewUI: only
render LoadingIndicator when indicatorsVisible && isAudioConnecting &&
!participant.isLocal (or the equivalent isLocal flag used in this
component/state), so the indicator appears only for remote participants with an
audio track but no audio data yet.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: ad54767c-a066-4132-891d-ae676f1b3f54
📒 Files selected for processing (1)
packages/react-sdk/src/core/components/ParticipantView/DefaultParticipantViewUI.tsx
packages/react-sdk/src/core/components/ParticipantView/DefaultParticipantViewUI.tsx
Show resolved
Hide resolved
packages/react-sdk/src/core/components/ParticipantView/DefaultParticipantViewUI.tsx
Show resolved
Hide resolved
…necting - add tooltip
💡 Overview
This PR adds a visual indicator that audio is still connecting for remote participants when an audio track exists but no data is flowing yet. It introduces a useIsTrackUnmuted hook that listens to mute/unmute events to detect when audio starts or stops, and integrates this into ParticipantDetails to show a loading indicator while the audio is still connecting.
🎫 Ticket: https://linear.app/stream/issue/REACT-906/loading-indicator-while-participant-audio-is-connecting
📑 Docs: https://github.com/GetStream/docs-content/pull/1091
Summary by CodeRabbit
New Features
Style
Documentation