diff --git a/app/components/ConnectionInformation.tsx b/app/components/ConnectionInformation.tsx
new file mode 100644
index 00000000..863b09e3
--- /dev/null
+++ b/app/components/ConnectionInformation.tsx
@@ -0,0 +1,61 @@
+import { useState } from 'react'
+import type { User } from '~/types/Messages'
+import { cn } from '~/utils/style'
+import { Icon } from './Icon/Icon'
+import { Tooltip } from './Tooltip'
+
+export function ConnectionInformation(props: { user: User }) {
+ const { inboundPacketLoss, outboundPacketLoss } =
+ props.user.connectionInformation
+ const [open, setOpen] = useState(false)
+
+ const inbound = (inboundPacketLoss * 100).toFixed(2)
+ const outbound = (outboundPacketLoss * 100).toFixed(2)
+
+ const connectionGood = inboundPacketLoss <= 0.01 && outboundPacketLoss <= 0.01
+ const connectionUnstable =
+ (inboundPacketLoss > 0.01 && inboundPacketLoss <= 0.03) ||
+ (outboundPacketLoss > 0.01 && outboundPacketLoss <= 0.03)
+ const connectionBad = inboundPacketLoss > 0.03 || outboundPacketLoss > 0.03
+
+ return (
+
+ Packet Loss
+
+
+
Outbound
+
+
{outbound}%
+
+
+
Inbound
+
+
{inbound}%
+
+
+
+ }
+ >
+
+
+ )
+}
diff --git a/app/components/Dialog.tsx b/app/components/Dialog.tsx
index 68978979..a56120fa 100644
--- a/app/components/Dialog.tsx
+++ b/app/components/Dialog.tsx
@@ -31,8 +31,8 @@ export const DialogContent = forwardRef<
'dark:shadow-none'
)}
>
- {props.children}
+ {props.children}
))
diff --git a/app/components/HighPacketLossWarningsToast.tsx b/app/components/HighPacketLossWarningsToast.tsx
index ba7dfd19..3d88396d 100644
--- a/app/components/HighPacketLossWarningsToast.tsx
+++ b/app/components/HighPacketLossWarningsToast.tsx
@@ -1,28 +1,15 @@
-import { useMemo } from 'react'
import Toast, { Root } from '~/components/Toast'
-import { useSubscribedState } from '~/hooks/rxjsHooks'
import { useConditionForAtLeast } from '~/hooks/useConditionForAtLeast'
-import { getPacketLossStats$ } from '~/utils/rxjs/getPacketLossStats$'
-import { useRoomContext } from '../hooks/useRoomContext'
+import { useRoomContext } from '~/hooks/useRoomContext'
import { Icon } from './Icon/Icon'
-function useStats() {
- const { peer } = useRoomContext()
- const stats$ = useMemo(
- () => getPacketLossStats$(peer.peerConnection$),
- [peer.peerConnection$]
- )
- const stats = useSubscribedState(stats$, {
- inboundPacketLossPercentage: 0,
- outboundPacketLossPercentage: 0,
- })
-
- return stats
-}
-
export function HighPacketLossWarningsToast() {
- const { inboundPacketLossPercentage, outboundPacketLossPercentage } =
- useStats()
+ const {
+ connectionStats: {
+ inboundPacketLossPercentage,
+ outboundPacketLossPercentage,
+ },
+ } = useRoomContext()
const hasIssues = useConditionForAtLeast(
inboundPacketLossPercentage !== undefined &&
diff --git a/app/components/Icon/Icon.tsx b/app/components/Icon/Icon.tsx
index eee949b7..d15e1bff 100644
--- a/app/components/Icon/Icon.tsx
+++ b/app/components/Icon/Icon.tsx
@@ -19,6 +19,7 @@ import {
PhoneXMarkIcon,
PlusIcon,
ServerStackIcon,
+ SignalIcon,
SignalSlashIcon,
UserGroupIcon,
VideoCameraIcon,
@@ -52,6 +53,7 @@ const iconMap = {
EllipsisVerticalIcon,
ClipboardDocumentCheckIcon,
ClipboardDocumentIcon,
+ SignalIcon,
SignalSlashIcon,
ExclamationCircleIcon,
ServerStackIcon,
diff --git a/app/components/Participant.tsx b/app/components/Participant.tsx
index 074726ce..f4b5f385 100644
--- a/app/components/Participant.tsx
+++ b/app/components/Participant.tsx
@@ -10,6 +10,7 @@ import { cn } from '~/utils/style'
import { AudioGlow } from './AudioGlow'
import { AudioIndicator } from './AudioIndicator'
import { Button } from './Button'
+import { ConnectionInformation } from './ConnectionInformation'
import { HoverFade } from './HoverFade'
import { Icon } from './Icon/Icon'
import { MuteUserButton } from './MuteUserButton'
@@ -169,16 +170,19 @@ export const Participant = forwardRef<
)}
)}
- {data?.displayName && user.transceiverSessionId && (
-
- {data.displayName}
-
- )}
+
+
+ {data?.displayName && user.transceiverSessionId && (
+
+ {data.displayName}
+
+ )}
+
{user.raisedHand && (
diff --git a/app/components/ParticipantsMenu.tsx b/app/components/ParticipantsMenu.tsx
index 336e1950..9deff634 100644
--- a/app/components/ParticipantsMenu.tsx
+++ b/app/components/ParticipantsMenu.tsx
@@ -6,6 +6,7 @@ import populateTraceLink from '~/utils/populateTraceLink'
import { cn } from '~/utils/style'
import { AudioIndicator } from './AudioIndicator'
import { Button } from './Button'
+import { ConnectionInformation } from './ConnectionInformation'
import { Dialog, DialogContent, DialogOverlay, Portal, Trigger } from './Dialog'
import { Icon } from './Icon/Icon'
import { MuteUserButton } from './MuteUserButton'
@@ -40,6 +41,7 @@ const UserListItem: FC<{
)}
+
)
@@ -93,7 +95,6 @@ export const ParticipantsDialog: FC = ({
return (