🚚(frontend) move participant list code into a feature folder

Reorganize all participant list related code elements into a
dedicated feature folder, so related components, hooks and helpers
are grouped together and easier to locate.
This commit is contained in:
lebaudantoine
2026-07-17 17:52:55 +02:00
committed by aleb_the_flash
parent 64b4200fc3
commit d1dde71bea
22 changed files with 20 additions and 20 deletions
@@ -7,8 +7,8 @@ import { RiInfinityLine } from '@remixicon/react'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { useEffect, useRef, useState } from 'react' import { useEffect, useRef, useState } from 'react'
import { usePrevious } from '@/hooks/usePrevious' import { usePrevious } from '@/hooks/usePrevious'
import { WaitingParticipant } from '@/features/rooms/api/listWaitingParticipants' import type { WaitingParticipant } from '@/features/participants/api/listWaitingParticipants'
import { useWaitingParticipants } from '@/features/rooms/hooks/useWaitingParticipants' import { useWaitingParticipants } from '@/features/participants/hooks/useWaitingParticipants'
import { useSidePanel } from '@/features/rooms/livekit/hooks/useSidePanel' import { useSidePanel } from '@/features/rooms/livekit/hooks/useSidePanel'
import { useNotificationSound } from '../hooks/useSoundNotification' import { useNotificationSound } from '../hooks/useSoundNotification'
import { NotificationType } from '@/features/notifications' import { NotificationType } from '@/features/notifications'
@@ -4,7 +4,7 @@ import { HStack } from '@/styled-system/jsx'
import { Text } from '@/primitives/Text' import { Text } from '@/primitives/Text'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { Avatar } from '@/components/Avatar' import { Avatar } from '@/components/Avatar'
import { useLowerHandParticipant } from '@/features/rooms/api/lowerHandParticipant' import { useLowerHandParticipant } from '../api/lowerHandParticipant'
import { getParticipantColor } from '@/features/rooms/utils/getParticipantColor' import { getParticipantColor } from '@/features/rooms/utils/getParticipantColor'
import { useIsAdminOrOwner } from '@/features/rooms/livekit/hooks/useIsAdminOrOwner' import { useIsAdminOrOwner } from '@/features/rooms/livekit/hooks/useIsAdminOrOwner'
import type { Participant } from 'livekit-client' import type { Participant } from 'livekit-client'
@@ -1,7 +1,7 @@
import { Button } from '@/primitives' import { Button } from '@/primitives'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import type { Participant } from 'livekit-client' import type { Participant } from 'livekit-client'
import { useLowerHandParticipants } from '@/features/rooms/api/lowerHandParticipants' import { useLowerHandParticipants } from '../api/lowerHandParticipants'
import { useIsAdminOrOwner } from '@/features/rooms/livekit/hooks/useIsAdminOrOwner' import { useIsAdminOrOwner } from '@/features/rooms/livekit/hooks/useIsAdminOrOwner'
import { css } from '@/styled-system/css' import { css } from '@/styled-system/css'
import { RiHand } from '@remixicon/react' import { RiHand } from '@remixicon/react'
@@ -16,11 +16,11 @@ import Source = Track.Source
import { RiMicFill, RiMicOffFill } from '@remixicon/react' import { RiMicFill, RiMicOffFill } from '@remixicon/react'
import { Button } from '@/primitives' import { Button } from '@/primitives'
import { useState } from 'react' import { useState } from 'react'
import { MuteAlertDialog } from '../../MuteAlertDialog'
import { useMuteParticipant } from '@/features/rooms/api/muteParticipant' import { useMuteParticipant } from '@/features/rooms/api/muteParticipant'
import { useCanMute } from '@/features/rooms/livekit/hooks/useCanMute' import { useCanMute } from '@/features/rooms/livekit/hooks/useCanMute'
import { ParticipantMenuButton } from '../../ParticipantMenu/ParticipantMenuButton' import { ParticipantMenuButton } from './menu/ParticipantMenuButton'
import { PinBadge } from './PinBadge' import { PinBadge } from './PinBadge'
import { MuteAlertDialog } from '@/features/rooms/livekit/components/MuteAlertDialog'
type MicIndicatorProps = { type MicIndicatorProps = {
participant: Participant participant: Participant
@@ -3,14 +3,14 @@ import { useParticipants } from '@livekit/components-react'
import { Div, H } from '@/primitives' import { Div, H } from '@/primitives'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { ParticipantListItem } from '../../controls/Participants/ParticipantListItem' import { ParticipantListItem } from './ParticipantListItem'
import { ParticipantsCollapsableList } from '../../controls/Participants/ParticipantsCollapsableList' import { ParticipantsCollapsableList } from './ParticipantsCollapsableList'
import { HandRaisedListItem } from '../../controls/Participants/HandRaisedListItem' import { HandRaisedListItem } from './HandRaisedListItem'
import { LowerAllHandsButton } from '../../controls/Participants/LowerAllHandsButton' import { LowerAllHandsButton } from './LowerAllHandsButton'
import { WaitingParticipantListItem } from './WaitingParticipantListItem' import { WaitingParticipantListItem } from './WaitingParticipantListItem'
import { useWaitingParticipants } from '@/features/rooms/hooks/useWaitingParticipants' import { useWaitingParticipants } from '@/features/participants/hooks/useWaitingParticipants'
import type { Participant } from 'livekit-client' import type { Participant } from 'livekit-client'
import { WaitingParticipant } from '@/features/rooms/api/listWaitingParticipants' import { WaitingParticipant } from '@/features/participants/api/listWaitingParticipants'
import { MuteEveryoneButton } from './MuteEveryoneButton' import { MuteEveryoneButton } from './MuteEveryoneButton'
// TODO: Optimize rendering performance, especially for longer participant lists, even though they are generally short. // TODO: Optimize rendering performance, especially for longer participant lists, even though they are generally short.
@@ -3,7 +3,7 @@ import { HStack } from '@/styled-system/jsx'
import { css } from '@/styled-system/css' import { css } from '@/styled-system/css'
import { Avatar } from '@/components/Avatar' import { Avatar } from '@/components/Avatar'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { WaitingParticipant } from '@/features/rooms/api/listWaitingParticipants' import { WaitingParticipant } from '../api/listWaitingParticipants'
import { RiCloseLine } from '@remixicon/react' import { RiCloseLine } from '@remixicon/react'
export const WaitingParticipantListItem = ({ export const WaitingParticipantListItem = ({
@@ -1,8 +1,8 @@
import { Menu as RACMenu } from 'react-aria-components' import { Menu as RACMenu } from 'react-aria-components'
import type { Participant } from 'livekit-client' import type { Participant } from 'livekit-client'
import { useIsAdminOrOwner } from '@/features/rooms/livekit/hooks/useIsAdminOrOwner' import { useIsAdminOrOwner } from '@/features/rooms/livekit/hooks/useIsAdminOrOwner'
import { PinMenuItem } from './PinMenuItem' import { PinMenuItem } from './items/PinMenuItem'
import { RemoveMenuItem } from './RemoveMenuItem' import { RemoveMenuItem } from './items/RemoveMenuItem'
export const ParticipantMenu = ({ export const ParticipantMenu = ({
participant, participant,
@@ -7,7 +7,7 @@ import { useEnterRoom } from '../api/enterRoom'
import { import {
useListWaitingParticipants, useListWaitingParticipants,
type WaitingParticipant, type WaitingParticipant,
} from '../api/listWaitingParticipants' } from '../../participants/api/listWaitingParticipants'
import { decodeNotificationDataReceived } from '@/features/notifications/utils' import { decodeNotificationDataReceived } from '@/features/notifications/utils'
import { NotificationType } from '@/features/notifications/NotificationType' import { NotificationType } from '@/features/notifications/NotificationType'
@@ -5,7 +5,7 @@ import { text } from '@/primitives/Text'
import { Button, Div } from '@/primitives' import { Button, Div } from '@/primitives'
import { RiArrowLeftLine, RiCloseLine } from '@remixicon/react' import { RiArrowLeftLine, RiCloseLine } from '@remixicon/react'
import { useTranslation } from 'react-i18next' import { useTranslation } from 'react-i18next'
import { ParticipantsList } from './controls/Participants/ParticipantsList' import { ParticipantsList } from '@/features/participants/components/ParticipantsList'
import { PanelId, useSidePanel } from '../hooks/useSidePanel' import { PanelId, useSidePanel } from '../hooks/useSidePanel'
import React, { ReactNode, useCallback, useRef } from 'react' import React, { ReactNode, useCallback, useRef } from 'react'
import { Chat } from '@/features/chat/components/Chat' import { Chat } from '@/features/chat/components/Chat'
@@ -4,10 +4,10 @@ import { ToggleButton } from '@/primitives'
import { VisualOnlyTooltip } from '@/primitives/VisualOnlyTooltip' import { VisualOnlyTooltip } from '@/primitives/VisualOnlyTooltip'
import { css } from '@/styled-system/css' import { css } from '@/styled-system/css'
import { useRemoteParticipants } from '@livekit/components-react' import { useRemoteParticipants } from '@livekit/components-react'
import { useSidePanel } from '../../../hooks/useSidePanel'
import { ToggleButtonProps } from '@/primitives/ToggleButton' import { ToggleButtonProps } from '@/primitives/ToggleButton'
import { useRegisterKeyboardShortcut } from '@/features/shortcuts/useRegisterKeyboardShortcut' import { useRegisterKeyboardShortcut } from '@/features/shortcuts/useRegisterKeyboardShortcut'
import { RoomEvent } from 'livekit-client' import { RoomEvent } from 'livekit-client'
import { useSidePanel } from '@/features/rooms/livekit/hooks/useSidePanel'
export const ParticipantsToggle = ({ export const ParticipantsToggle = ({
onPress, onPress,
@@ -15,7 +15,7 @@ import {
} from '@remixicon/react' } from '@remixicon/react'
import { ScreenShareToggle } from '../../components/controls/ScreenShareToggle' import { ScreenShareToggle } from '../../components/controls/ScreenShareToggle'
import { ChatToggle } from '../../components/controls/ChatToggle' import { ChatToggle } from '../../components/controls/ChatToggle'
import { ParticipantsToggle } from '../../components/controls/Participants/ParticipantsToggle' import { ParticipantsToggle } from '../../components/controls/ParticipantsToggle'
import { useSidePanel } from '../../hooks/useSidePanel' import { useSidePanel } from '../../hooks/useSidePanel'
import { LinkButton } from '@/primitives' import { LinkButton } from '@/primitives'
import { ResponsiveMenu } from './ResponsiveMenu' import { ResponsiveMenu } from './ResponsiveMenu'
@@ -1,6 +1,6 @@
import { css } from '@/styled-system/css' import { css } from '@/styled-system/css'
import { ChatToggle } from '../../components/controls/ChatToggle' import { ChatToggle } from '../../components/controls/ChatToggle'
import { ParticipantsToggle } from '../../components/controls/Participants/ParticipantsToggle' import { ParticipantsToggle } from '../../components/controls/ParticipantsToggle'
import { ToolsToggle } from '../../components/controls/ToolsToggle' import { ToolsToggle } from '../../components/controls/ToolsToggle'
import { InfoToggle } from '../../components/controls/InfoToggle' import { InfoToggle } from '../../components/controls/InfoToggle'
import { AdminToggle } from '../../components/AdminToggle' import { AdminToggle } from '../../components/AdminToggle'