Turn off the accepted rules and fix the design tokens, alt text, and last type errors. [skip build]
Checks / checks (push) Successful in 2m18s
Trigger cinny-mobile / dispatch (push) Successful in 1s

This commit is contained in:
2026-11-03 01:10:06 +11:00
parent 3db9b499af
commit 17d1eef572
73 changed files with 283 additions and 217 deletions
+10 -26
View File
@@ -367,7 +367,6 @@ export function ScreenShareItem({ share }: ScreenShareItemProps) {
// Handle remote screenshare (LiveKit track)
if (!share.isLocal && share.track) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const track = share.track as any;
if (typeof track.attach === 'function') {
@@ -464,23 +463,19 @@ export function ScreenShareItem({ share }: ScreenShareItemProps) {
<script>
let hideTimeout = null;
const closeButton = document.getElementById('closeButton');
function showCloseButton() {
if (hideTimeout) {
clearTimeout(hideTimeout);
hideTimeout = null;
}
closeButton.classList.add('visible');
hideTimeout = setTimeout(() => {
closeButton.classList.remove('visible');
hideTimeout = null;
}, 2000);
}
// Show on any mouse movement
document.addEventListener('mousemove', showCloseButton, true);
// Keep visible when hovering over button
closeButton.addEventListener('mouseenter', () => {
if (hideTimeout) {
@@ -489,7 +484,6 @@ export function ScreenShareItem({ share }: ScreenShareItemProps) {
}
closeButton.classList.add('visible');
});
// Start hide timer when leaving button
closeButton.addEventListener('mouseleave', () => {
hideTimeout = setTimeout(() => {
@@ -497,12 +491,10 @@ export function ScreenShareItem({ share }: ScreenShareItemProps) {
hideTimeout = null;
}, 2000);
});
// Close window on click
closeButton.addEventListener('click', () => {
window.close();
});
// Keep video playing - prevent pause from visibility changes or focus loss
function keepVideoPlaying() {
const video = document.querySelector('video');
@@ -510,17 +502,14 @@ export function ScreenShareItem({ share }: ScreenShareItemProps) {
video.play().catch(() => {});
}
}
// Check every 500ms if video got paused
setInterval(keepVideoPlaying, 500);
// Also resume on visibility change
document.addEventListener('visibilitychange', () => {
if (!document.hidden) {
keepVideoPlaying();
}
});
// Resume on window focus
window.addEventListener('focus', keepVideoPlaying);
</script>
@@ -550,7 +539,6 @@ export function ScreenShareItem({ share }: ScreenShareItemProps) {
// For remote screenshare, use LiveKit track's attach method (creates fresh video)
if (!share.isLocal && share.track) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const track = share.track as any;
if (typeof track.attach === 'function') {
// track.attach() creates a brand new video element attached to the track
@@ -575,7 +563,6 @@ export function ScreenShareItem({ share }: ScreenShareItemProps) {
popoutWindow.addEventListener('beforeunload', () => {
// For remote tracks, detach from pop-out
if (!share.isLocal && share.track) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const track = share.track as any;
if (typeof track.detach === 'function') {
const videoContainer = popoutWindow.document.getElementById('videoContainer');
@@ -592,7 +579,7 @@ export function ScreenShareItem({ share }: ScreenShareItemProps) {
}, [share.isLocal, share.stream, share.track]);
const handleMouseMoveWrapper = useCallback(
(e: React.MouseEvent) => {
(e: React.MouseEvent<HTMLDivElement>) => {
// Clear any pending hide timeout
if (hideTimeoutRef.current) {
clearTimeout(hideTimeoutRef.current);
@@ -604,16 +591,13 @@ export function ScreenShareItem({ share }: ScreenShareItemProps) {
[handleMouseMove],
);
const handleMouseLeaveWrapper = useCallback(
(e: React.MouseEvent) => {
// Delay hiding controls to prevent flickering
hideTimeoutRef.current = setTimeout(() => {
setShowControls(false);
}, 300);
handleMouseLeave(e);
},
[handleMouseLeave],
);
const handleMouseLeaveWrapper = useCallback(() => {
// Delay hiding controls to prevent flickering
hideTimeoutRef.current = setTimeout(() => {
setShowControls(false);
}, 300);
handleMouseLeave();
}, [handleMouseLeave]);
// Cleanup timeout on unmount
useEffect(
@@ -921,7 +905,7 @@ export function CallOverlay() {
// Wait for window to load, then set the video stream
setTimeout(() => {
const videoEl = popoutWindow.document.getElementById('remoteVideo');
const videoEl = popoutWindow.document.querySelector<HTMLVideoElement>('#remoteVideo');
if (videoEl) {
videoEl.srcObject = firstStream;
}
@@ -1385,7 +1369,7 @@ export function CallOverlay() {
{isVideoCall && (
<div className={css.VideoContainer}>
{/* eslint-disable-next-line jsx-a11y/media-has-caption */}
{}
<video
ref={remoteVideoRef}
autoPlay