From 11ead89354eb0899f8aeb8fb5738dbf0fde6735b Mon Sep 17 00:00:00 2001 From: 7w1 Date: Sat, 27 Jun 2026 21:28:46 -0500 Subject: [PATCH] resolve lint/typecheck/knip issues --- src/app/features/call/CallControls.tsx | 231 ------------------ src/app/features/call/CallView.tsx | 7 +- .../features/call/callMembershipState.test.ts | 5 +- src/app/features/call/callSignalingDecrypt.ts | 2 +- .../call/callSignalingFallback.test.ts | 10 +- .../general/CallSoundSettings.test.tsx | 16 +- src/app/plugins/call/CallEmbed.ts | 185 +++++++------- 7 files changed, 110 insertions(+), 346 deletions(-) delete mode 100644 src/app/features/call/CallControls.tsx diff --git a/src/app/features/call/CallControls.tsx b/src/app/features/call/CallControls.tsx deleted file mode 100644 index 664a222c4..000000000 --- a/src/app/features/call/CallControls.tsx +++ /dev/null @@ -1,231 +0,0 @@ -import type { MouseEventHandler } from 'react'; -import { useCallback, useEffect, useRef, useState } from 'react'; -import type { RectCords } from 'folds'; -import { - Box, - Button, - config, - IconButton, - Menu, - MenuItem, - PopOut, - Spinner, - Text, - toRem, -} from 'folds'; -import { - DotsThreeOutlineVerticalIcon, - sizedIcon, - PhoneDisconnect, -} from '$components/icons/phosphor'; -import FocusTrap from 'focus-trap-react'; -import { SequenceCard } from '$components/sequence-card'; -import type { CallEmbed } from '$plugins/call'; -import { useCallControlState } from '$plugins/call'; -import { stopPropagation } from '$utils/keyboard'; -import { AsyncStatus, useAsyncCallback } from '$hooks/useAsyncCallback'; -import { useRoom } from '$hooks/useRoom'; -import { ScreenSize, useScreenSizeContext } from '$hooks/useScreenSize'; -import { useCallPreferences } from '$state/hooks/callPreferences'; -import * as css from './styles.css'; -import { - ChatButton, - ControlDivider, - LayoutButton, - MicrophoneButton, - ScreenShareButton, - SoundButton, - VideoButton, -} from './Controls'; - -type CallControlsProps = { - callEmbed: CallEmbed; -}; -export function CallControls({ callEmbed }: CallControlsProps) { - const room = useRoom(); - const controlRef = useRef(null); - - const screenSize = useScreenSizeContext(); - const compact = screenSize === ScreenSize.Mobile; - - const { microphone, video, sound, screenshare, spotlight } = useCallControlState( - callEmbed.control - ); - - const { setPreferences } = useCallPreferences(); - - useEffect(() => { - setPreferences({ microphone, video, sound }); - }, [microphone, video, sound, setPreferences]); - - const [cords, setCords] = useState(); - - const handleOpenMenu: MouseEventHandler = (evt) => { - setCords(evt.currentTarget.getBoundingClientRect()); - }; - - const handleSpotlightClick = () => { - callEmbed.control.toggleSpotlight(); - setCords(undefined); - }; - - const handleReactionsClick = () => { - callEmbed.control.toggleReactions(); - setCords(undefined); - }; - - const handleSettingsClick = () => { - callEmbed.control.toggleSettings(); - setCords(undefined); - }; - - const [hangupState, hangup] = useAsyncCallback( - useCallback(() => callEmbed.hangup(), [callEmbed]) - ); - const exiting = - hangupState.status === AsyncStatus.Loading || hangupState.status === AsyncStatus.Success; - - return ( - - - - callEmbed.control.toggleMicrophone()} - /> - callEmbed.control.toggleSound()} /> - - - {!compact && } - - - callEmbed.control.toggleVideo()} /> - callEmbed.control.toggleScreenshare()} - /> - - {!compact && } - - {room?.isCallRoom() && } - - callEmbed.control.toggleSpotlight()} - /> - - setCords(undefined), - clickOutsideDeactivates: true, - isKeyForward: (evt: KeyboardEvent) => evt.key === 'ArrowDown', - isKeyBackward: (evt: KeyboardEvent) => evt.key === 'ArrowUp', - escapeDeactivates: stopPropagation, - }} - > - - - - - Reactions - - - - - Settings - - - - - - } - > - - {sizedIcon(DotsThreeOutlineVerticalIcon, '300', { filled: !!cords })} - - - - - - - - ); -} diff --git a/src/app/features/call/CallView.tsx b/src/app/features/call/CallView.tsx index a0b5dbe73..b89e1c7f2 100644 --- a/src/app/features/call/CallView.tsx +++ b/src/app/features/call/CallView.tsx @@ -142,12 +142,9 @@ function CallPrescreen() { type CallJoinedProps = { containerRef: RefObject; - joined: boolean; }; -function CallJoined({ joined, containerRef }: CallJoinedProps) { - const callEmbed = useCallEmbed(); - +function CallJoined({ containerRef }: CallJoinedProps) { return ( @@ -269,7 +266,7 @@ export function CallView({ resizable }: CallViewProps) { )} {!currentJoined && } - + {resizable && (