Skip to content

Commit af139f9

Browse files
mgamis-msftgithub-actions[bot]dmceachernmsft
committed
Fix side pane when composite is narrow (#2864)
* set min width of composite content to 30rem * Change files * Duplicate change files for beta release * fix incorrect file header * Add comment to variable and simplified variable name * include minWidth styling for stable * Update packages/react-composites CallWithChatComposite browser test snapshots * Update packages/react-composites CallWithChatComposite browser test snapshots * Update packages/react-composites CallComposite browser test snapshots * Update packages/react-composites CallComposite browser test snapshots * apply minwidth only when not mobile * cond-comp import * cond-comp fix * Update packages/react-composites CallWithChatComposite browser test snapshots * Update packages/react-composites CallWithChatComposite browser test snapshots * Update packages/react-composites CallComposite browser test snapshots * Update packages/react-composites CallComposite browser test snapshots * revert all snapshot updates --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Donald McEachern <94866715+dmceachernmsft@users.noreply.github.com>
1 parent b094e2a commit af139f9

16 files changed

Lines changed: 36 additions & 6 deletions
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Fix side pane overlapping with composite when window is narrow",
4+
"packageName": "@azure/communication-react",
5+
"email": "79475487+mgamis-msft@users.noreply.github.com",
6+
"dependentChangeType": "patch"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "Fix side pane overlapping with composite when window is narrow",
4+
"packageName": "@azure/communication-react",
5+
"email": "79475487+mgamis-msft@users.noreply.github.com",
6+
"dependentChangeType": "patch"
7+
}

packages/react-composites/src/composites/CallComposite/components/CallArrangement.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { useCallback } from 'react';
2121
import { AvatarPersonaDataCallback } from '../../common/AvatarPersona';
2222
import { containerDivStyles } from '../../common/ContainerRectProps';
2323
/* @conditional-compile-remove(one-to-n-calling) @conditional-compile-remove(PSTN-calls) */
24+
import { compositeMinWidthRem } from '../../common/styles/Composite.styles';
2425
import { useAdapter } from '../adapter/CallAdapterProvider';
2526
import { CallControls, CallControlsProps } from '../components/CallControls';
2627
/* @conditional-compile-remove(one-to-n-calling) @conditional-compile-remove(PSTN-calls) */
@@ -87,8 +88,13 @@ export const CallArrangement = (props: CallArrangementProps): JSX.Element => {
8788

8889
/* @conditional-compile-remove(one-to-n-calling) @conditional-compile-remove(PSTN-calls) */
8990
const callCompositeContainerCSS = useMemo(() => {
90-
return { display: isMobileWithActivePane ? 'none' : 'flex', minWidth: 0, width: '100%', height: '100%' };
91-
}, [isMobileWithActivePane]);
91+
return {
92+
display: isMobileWithActivePane ? 'none' : 'flex',
93+
minWidth: props.mobileView ? 'unset' : `${compositeMinWidthRem}rem`,
94+
width: '100%',
95+
height: '100%'
96+
};
97+
}, [isMobileWithActivePane, props.mobileView]);
9298

9399
// To be removed once feature is out of beta, replace with callCompositeContainerCSS
94100
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type

packages/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ const CallWithChatScreen = (props: CallWithChatScreenProps): JSX.Element => {
420420
<Stack horizontal grow>
421421
<Stack.Item
422422
grow
423-
styles={callCompositeContainerStyles}
423+
styles={callCompositeContainerStyles(mobileView)}
424424
// Perf: Instead of removing the video gallery from DOM, we hide it to prevent re-renders.
425425
style={callCompositeContainerCSS}
426426
>

packages/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Licensed under the MIT license.
33

44
import { IStackStyles } from '@fluentui/react';
5+
import { compositeMinWidthRem } from '../../common/styles/Composite.styles';
56

67
/**
78
* @private
@@ -16,15 +17,15 @@ export const compositeOuterContainerStyles: IStackStyles = {
1617
};
1718

1819
/** @private */
19-
export const callCompositeContainerStyles: IStackStyles = {
20+
export const callCompositeContainerStyles = (isMobile: boolean): IStackStyles => ({
2021
root: {
2122
// Start a new stacking context so that any `position:absolute` elements
2223
// inside the call composite do not compete with its siblings.
2324
position: 'relative',
2425
width: '100%',
25-
minWidth: 0
26+
minWidth: isMobile ? 'unset' : `${compositeMinWidthRem}rem`
2627
}
27-
};
28+
});
2829

2930
/** @private */
3031
export const controlBarContainerStyles: IStackStyles = {
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT license.
3+
4+
/**
5+
* This minimum width is to make sure the side pane does not overlap with the composite when the screen is narrow.
6+
*
7+
* @private
8+
*/
9+
export const compositeMinWidthRem = 30;
Loading
Loading

0 commit comments

Comments
 (0)