Skip to content

Commit 9dec947

Browse files
Fix side pane content being clipped on a small screen at 200% zoom (#3937)
* Fix side pane content being clipped on a small screen at 200% zoom * Change files * Duplicate change files for beta release
1 parent 242aa5f commit 9dec947

8 files changed

Lines changed: 52 additions & 11 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "patch",
3+
"area": "fix",
4+
"workstream": "",
5+
"comment": "Fix side pane content being clipped on a small screen at 200% zoom",
6+
"packageName": "@azure/communication-react",
7+
"email": "2684369+JamesBurnside@users.noreply.github.com",
8+
"dependentChangeType": "patch"
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "patch",
3+
"area": "fix",
4+
"workstream": "",
5+
"comment": "Fix side pane content being clipped on a small screen at 200% zoom",
6+
"packageName": "@azure/communication-react",
7+
"email": "2684369+JamesBurnside@users.noreply.github.com",
8+
"dependentChangeType": "patch"
9+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,7 @@ export const CallArrangement = (props: CallArrangementProps): JSX.Element => {
453453
mobileView={props.mobileView}
454454
/* @conditional-compile-remove(video-background-effects) */
455455
maxWidth={isVideoPaneOpen ? `${VIDEO_EFFECTS_SIDE_PANE_WIDTH_REM}rem` : undefined}
456+
minWidth={isVideoPaneOpen ? `${VIDEO_EFFECTS_SIDE_PANE_WIDTH_REM}rem` : undefined}
456457
updateSidePaneRenderer={props.updateSidePaneRenderer}
457458
onPeopleButtonClicked={
458459
props.mobileView && !shouldShowPeopleTabHeaderButton(props.callControlProps.options)

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export interface SidePaneProps {
1919
updateSidePaneRenderer: (renderer: SidePaneRenderer | undefined) => void;
2020
mobileView?: boolean;
2121
maxWidth?: string;
22+
minWidth?: string;
2223

2324
// legacy arguments to be removed in breaking change
2425
disablePeopleButton?: boolean;
@@ -36,12 +37,15 @@ export const SidePane = (props: SidePaneProps): JSX.Element => {
3637
!overrideSidePane.isActive;
3738
const renderingOnlyHiddenContent = renderingHiddenOverrideContent && !sidePaneRenderer;
3839

39-
const maxWidthStyles = useMemo(() => sidePaneStyles(props.maxWidth), [props.maxWidth]);
40+
const widthConstrainedStyles = useMemo(
41+
() => sidePaneStyles(props.maxWidth, props.minWidth),
42+
[props.maxWidth, props.minWidth]
43+
);
4044
const paneStyles = renderingOnlyHiddenContent
4145
? hiddenStyles
4246
: props.mobileView
4347
? availableSpaceStyles
44-
: maxWidthStyles;
48+
: widthConstrainedStyles;
4549

4650
const Header =
4751
(overrideSidePane?.isActive ? overrideSidePane.renderer.headerRenderer : sidePaneRenderer?.headerRenderer) ??

packages/react-composites/src/composites/CallComposite/pages/ConfigurationPage.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,12 @@ export const ConfigurationPage = (props: ConfigurationPageProps): JSX.Element =>
410410
/* @conditional-compile-remove(video-background-effects) */
411411
customWidth={`${VIDEO_EFFECTS_SIDE_PANE_WIDTH_REM}rem`}
412412
>
413-
<SidePane mobileView={props.mobileView} updateSidePaneRenderer={props.updateSidePaneRenderer} />
413+
<SidePane
414+
mobileView={props.mobileView}
415+
updateSidePaneRenderer={props.updateSidePaneRenderer}
416+
maxWidth={`${VIDEO_EFFECTS_SIDE_PANE_WIDTH_REM}rem`}
417+
minWidth={`${VIDEO_EFFECTS_SIDE_PANE_WIDTH_REM}rem`}
418+
/>
414419
</Panel>
415420
</Stack>
416421
</Stack>

packages/react-composites/src/composites/ChatComposite/styles/Chat.styles.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33

44
import { IStyle, memoizeFunction, mergeStyles } from '@fluentui/react';
55
import { MessageThreadStyles } from '@internal/react-components';
6+
import { CHAT_CONTAINER_MIN_WIDTH_REM } from '../../common/constants';
67

7-
const MESSAGE_THREAD_WIDTH = '41.25rem';
8+
const CHAT_CONTAINER_MAX_WIDTH_REM = 41.25;
9+
const CHAT_CONTAINER_MIN_HEIGHT_REM = 13;
810

911
/**
1012
* @private
@@ -18,8 +20,8 @@ export const CHAT_CONTAINER_ZINDEX = 1;
1820
export const chatScreenContainerStyle = mergeStyles({
1921
height: '100%',
2022
width: '100%',
21-
minHeight: '13rem',
22-
minWidth: '17.5rem'
23+
minHeight: `${CHAT_CONTAINER_MIN_HEIGHT_REM}rem`,
24+
minWidth: `${CHAT_CONTAINER_MIN_WIDTH_REM}rem`
2325
});
2426

2527
/**
@@ -95,7 +97,7 @@ export const topicNameLabelStyle = mergeStyles({
9597
*/
9698
export const messageThreadChatCompositeStyles = memoizeFunction(
9799
(background: string): MessageThreadStyles => ({
98-
root: { maxWidth: MESSAGE_THREAD_WIDTH },
100+
root: { maxWidth: `${CHAT_CONTAINER_MAX_WIDTH_REM}rem` },
99101
chatContainer: { background: background }
100102
})
101103
);
@@ -111,7 +113,7 @@ export const typingIndicatorContainerStyles: IStyle = {
111113
* @private
112114
*/
113115
export const sendboxContainerStyles: IStyle = {
114-
maxWidth: MESSAGE_THREAD_WIDTH,
116+
maxWidth: `${CHAT_CONTAINER_MAX_WIDTH_REM}rem`,
115117
width: '100%',
116118
alignSelf: 'center'
117119
};

packages/react-composites/src/composites/common/constants.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,10 @@ export const UNSUPPORTED_CHAT_THREAD_TYPE = ['@thread.tacv2', '@thread.skype'];
1111
*/
1212
export const TEAMS_LIMITATION_LEARN_MORE =
1313
'https://learn.microsoft.com/en-us/azure/communication-services/concepts/join-teams-meeting#limitations-and-known-issues';
14+
15+
/**
16+
* @remarks
17+
* This value is publicly documented in the ChatComposite API documentation.
18+
* Changing this value will require updating the API documentation.
19+
*/
20+
export const CHAT_CONTAINER_MIN_WIDTH_REM = 17.5;

packages/react-composites/src/composites/common/styles/Pane.styles.ts

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

44
import { concatStyleSets, IButtonStyles, IStackStyles, IStackTokens } from '@fluentui/react';
5+
import { CHAT_CONTAINER_MIN_WIDTH_REM } from '../constants';
6+
7+
const SIDE_PANE_PADDING_LR_REM = 0.25;
58

69
/**
710
* @private
@@ -72,12 +75,13 @@ export const hiddenStyles: IStackStyles = {
7275
/**
7376
* @private
7477
*/
75-
export const sidePaneStyles = (maxWidth?: string): IStackStyles => ({
78+
export const sidePaneStyles = (maxWidth?: string, minWidth?: string): IStackStyles => ({
7679
root: {
7780
height: 'auto',
7881
width: '100%',
79-
padding: '0.5rem 0.25rem',
80-
maxWidth: maxWidth ?? '21.5rem'
82+
padding: `0.5rem ${SIDE_PANE_PADDING_LR_REM}rem`,
83+
maxWidth: maxWidth ?? '21.5rem',
84+
minWidth: minWidth ?? `${CHAT_CONTAINER_MIN_WIDTH_REM + SIDE_PANE_PADDING_LR_REM * 2}rem`
8185
}
8286
});
8387

0 commit comments

Comments
 (0)