Skip to content

Commit 4f35307

Browse files
authored
Fix leaving with screenshare error and off center tiles in vertical gallery (#2863)
* Revert "Video gallery show local tile and horizontal/vertical gallery when screensharing with no participant (#2822)" * Change files * Duplicate change files for beta release * Revert VideoGalleryResponsiveVerticalGallery.styles.ts
1 parent cddd48e commit 4f35307

5 files changed

Lines changed: 23 additions & 16 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "none",
3+
"comment": "Revert bug fix \"Video gallery show local tile and horizontal/vertical gallery when screensharing with no participant (#2822)\"",
4+
"packageName": "@azure/communication-react",
5+
"email": "79475487+mgamis-msft@users.noreply.github.com",
6+
"dependentChangeType": "none"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "none",
3+
"comment": "Revert bug fix \"Video gallery show local tile and horizontal/vertical gallery when screensharing with no participant (#2822)\"",
4+
"packageName": "@azure/communication-react",
5+
"email": "79475487+mgamis-msft@users.noreply.github.com",
6+
"dependentChangeType": "none"
7+
}

packages/react-components/src/components/VideoGallery.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,7 @@ export const VideoGallery = (props: VideoGalleryProps): JSX.Element => {
325325
/* @conditional-compile-remove(pinned-participants) */
326326
const drawerMenuHostId = useId('drawerMenuHost', drawerMenuHostIdFromProp);
327327

328-
const shouldFloatLocalVideo = !!(
329-
(layout === 'floatingLocalVideo' && remoteParticipants.length > 0) ||
330-
localParticipant.isScreenSharingOn
331-
);
328+
const shouldFloatLocalVideo = !!(layout === 'floatingLocalVideo' && remoteParticipants.length > 0);
332329

333330
const containerRef = useRef<HTMLDivElement>(null);
334331
const containerWidth = _useContainerWidth(containerRef);

packages/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export const FloatingLocalVideoLayout = (props: FloatingLocalVideoLayoutProps):
9898
);
9999
});
100100

101-
const shouldFloatLocalVideo = remoteParticipants.length > 0 || !!screenShareComponent;
101+
const shouldFloatLocalVideo = remoteParticipants.length > 0;
102102

103103
if (!shouldFloatLocalVideo && localVideoComponent) {
104104
gridTiles.push(localVideoComponent);
@@ -131,7 +131,7 @@ export const FloatingLocalVideoLayout = (props: FloatingLocalVideoLayoutProps):
131131
return SMALL_FLOATING_MODAL_SIZE_REM;
132132
}
133133
/* @conditional-compile-remove(vertical-gallery) */
134-
if ((overflowGalleryTiles.length > 0 || !!screenShareComponent) && overflowGalleryPosition === 'VerticalRight') {
134+
if (overflowGalleryTiles.length > 0 && overflowGalleryPosition === 'VerticalRight') {
135135
return isNarrow
136136
? SMALL_FLOATING_MODAL_SIZE_REM
137137
: isShort
@@ -143,8 +143,7 @@ export const FloatingLocalVideoLayout = (props: FloatingLocalVideoLayoutProps):
143143
overflowGalleryTiles.length,
144144
isNarrow,
145145
/* @conditional-compile-remove(vertical-gallery) */ isShort,
146-
/* @conditional-compile-remove(vertical-gallery) */ overflowGalleryPosition,
147-
/* @conditional-compile-remove(vertical-gallery) */ screenShareComponent
146+
/* @conditional-compile-remove(vertical-gallery) */ overflowGalleryPosition
148147
]);
149148

150149
const wrappedLocalVideoComponent =
@@ -159,7 +158,7 @@ export const FloatingLocalVideoLayout = (props: FloatingLocalVideoLayoutProps):
159158
>
160159
{localVideoComponent}
161160
</Stack>
162-
) : overflowGalleryTiles.length > 0 || !!screenShareComponent ? (
161+
) : overflowGalleryTiles.length > 0 ? (
163162
<Stack className={mergeStyles(localVideoTileContainerStyle(theme, localVideoSizeRem))}>
164163
{localVideoComponent}
165164
</Stack>
@@ -175,7 +174,7 @@ export const FloatingLocalVideoLayout = (props: FloatingLocalVideoLayoutProps):
175174
) : undefined;
176175

177176
const overflowGallery = useMemo(() => {
178-
if (overflowGalleryTiles.length === 0 && !screenShareComponent) {
177+
if (overflowGalleryTiles.length === 0) {
179178
return null;
180179
}
181180
return (
@@ -203,7 +202,6 @@ export const FloatingLocalVideoLayout = (props: FloatingLocalVideoLayoutProps):
203202
styles?.horizontalGallery,
204203
/* @conditional-compile-remove(vertical-gallery) */ overflowGalleryPosition,
205204
setIndexesToRender,
206-
screenShareComponent,
207205
/* @conditional-compile-remove(vertical-gallery) */ styles?.verticalGallery
208206
]);
209207

packages/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveVerticalGallery.styles.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ export const VERTICAL_GALLERY_TILE_SIZE_REM = { minHeight: 6.75, maxHeight: 11,
3535
*
3636
* width is being increased by 1rem to account for the gap width desired for the VerticalGallery.
3737
*
38-
* Add 1.5 rem on width to account for horizontal padding
39-
*
4038
* @param shouldFloatLocalVideo whether rendered in floating layout or not
4139
* @returns Style set for VerticalGallery container.
4240
*/
@@ -47,20 +45,20 @@ export const verticalGalleryContainerStyle = (
4745
): IStyle => {
4846
return isNarrow && isShort
4947
? {
50-
width: `${SHORT_VERTICAL_GALLERY_TILE_SIZE_REM.width + 1.5}rem`,
48+
width: `${SHORT_VERTICAL_GALLERY_TILE_SIZE_REM.width}rem`,
5149
height: shouldFloatLocalVideo ? `calc(100% - ${SMALL_FLOATING_MODAL_SIZE_REM.height}rem)` : '100%',
5250
paddingBottom: '0.5rem'
5351
}
5452
: !isNarrow && isShort
5553
? {
56-
width: `${SHORT_VERTICAL_GALLERY_TILE_SIZE_REM.width + 1.5}rem`,
54+
width: `${SHORT_VERTICAL_GALLERY_TILE_SIZE_REM.width}rem`,
5755
height: shouldFloatLocalVideo
5856
? `calc(100% - ${SHORT_VERTICAL_GALLERY_FLOATING_MODAL_SIZE_REM.height}rem)`
5957
: '100%',
6058
paddingBottom: '0.5rem'
6159
}
6260
: {
63-
width: `${VERTICAL_GALLERY_TILE_SIZE_REM.width + 1.5}rem`,
61+
width: `${VERTICAL_GALLERY_TILE_SIZE_REM.width}rem`,
6462
height: shouldFloatLocalVideo ? `calc(100% - ${VERTICAL_GALLERY_FLOATING_MODAL_SIZE_REM.height}rem)` : '100%',
6563
paddingBottom: '0.5rem'
6664
};

0 commit comments

Comments
 (0)