Skip to content
Merged
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
f120216
update logic to cap gallery participants
dmceachernmsft Sep 8, 2023
73bbe10
put leftovers into overflow
dmceachernmsft Sep 8, 2023
963ef7a
fix indexing issue
dmceachernmsft Sep 8, 2023
c545f87
Change files
dmceachernmsft Sep 8, 2023
01f8cb5
Duplicate change files for beta release
dmceachernmsft Sep 8, 2023
92b692a
Merge branch 'main' into dmceachernmsft/largeGalleryCap
dmceachernmsft Sep 8, 2023
5b21df8
build files
dmceachernmsft Sep 8, 2023
daadaec
Merge branch 'dmceachernmsft/largeGalleryCap' of https://github.com/A…
dmceachernmsft Sep 8, 2023
98d6734
Update packages/react-composites CallComposite browser test snapshots
github-actions[bot] Sep 8, 2023
5988098
Merge branch 'dmceachernmsft/largeGalleryCap' of https://github.com/A…
github-actions[bot] Sep 8, 2023
7ca5ce6
update tests for new tile caps
dmceachernmsft Sep 11, 2023
b485021
Merge branch 'main' into dmceachernmsft/largeGalleryCap
dmceachernmsft Sep 13, 2023
31bc415
add new layout
dmceachernmsft Sep 18, 2023
a761308
add large gallery dropdown
dmceachernmsft Sep 18, 2023
900114c
add internal component to video gallery
dmceachernmsft Sep 18, 2023
400d148
add logic for large gallery
dmceachernmsft Sep 18, 2023
ccf6fc4
Change files
dmceachernmsft Sep 18, 2023
087452b
Duplicate change files for beta release
dmceachernmsft Sep 18, 2023
794b1ea
add tile count maxing at 48 less if no room
dmceachernmsft Sep 19, 2023
24fbc85
build fixes
dmceachernmsft Sep 19, 2023
3b907c0
Merge branch 'main' into dmceachernmsft/largeGalleryCap
dmceachernmsft Sep 19, 2023
3ab2a46
cleanup per comments
dmceachernmsft Sep 19, 2023
ce8b0b2
Merge branch 'dmceachernmsft/largeGalleryCap' of https://github.com/A…
dmceachernmsft Sep 19, 2023
36e8d9a
fix cc
dmceachernmsft Sep 19, 2023
3b31c7b
add test
dmceachernmsft Sep 19, 2023
c194b02
Update packages/react-composites CallComposite browser test snapshots
github-actions[bot] Sep 19, 2023
e2dee57
fix cc
dmceachernmsft Sep 19, 2023
9c28a13
Merge branch 'main' into dmceachernmsft/largeGalleryCap
dmceachernmsft Sep 19, 2023
3f6803c
Merge branch 'dmceachernmsft/largeGalleryCap' of https://github.com/A…
dmceachernmsft Sep 19, 2023
e925a77
fix cc
dmceachernmsft Sep 19, 2023
bdde758
remove test.only
dmceachernmsft Sep 19, 2023
8ec6903
Change files
dmceachernmsft Sep 19, 2023
43fc9c2
Duplicate change files for beta release
dmceachernmsft Sep 19, 2023
1edcea4
Update packages/react-composites CallComposite browser test snapshots
github-actions[bot] Sep 19, 2023
6085189
Merge branch 'dmceachernmsft/large-gallery' of https://github.com/Azu…
dmceachernmsft Sep 19, 2023
effb42e
add options to drop down
dmceachernmsft Sep 19, 2023
b2ba9e8
remove largeGallery from Mobile
dmceachernmsft Sep 20, 2023
3aa040a
fix scrollable gallery
dmceachernmsft Sep 20, 2023
2ea33bc
Change files
dmceachernmsft Sep 20, 2023
a474f00
Duplicate change files for beta release
dmceachernmsft Sep 20, 2023
84e3f4f
add show label in default view always
dmceachernmsft Sep 20, 2023
1bcfe23
fix lint
dmceachernmsft Sep 20, 2023
8b6e874
fix build
dmceachernmsft Sep 20, 2023
c6c77f8
fix cc
dmceachernmsft Sep 21, 2023
2220672
Update packages/react-composites CallWithChatComposite browser test s…
github-actions[bot] Sep 21, 2023
1d40891
Merge branch 'main' of https://github.com/Azure/communication-ui-libr…
dmceachernmsft Sep 21, 2023
d03127b
rebuild API
dmceachernmsft Sep 21, 2023
f7dec1b
Merge branch 'dmceachernmsft/mobile-gallery-options' of https://githu…
dmceachernmsft Sep 21, 2023
27a7c96
Update packages/react-composites CallComposite browser test snapshots
github-actions[bot] Sep 21, 2023
c0f19a4
Merge branch 'dmceachernmsft/mobile-gallery-options' of https://githu…
github-actions[bot] Sep 21, 2023
65f8635
fix double large button
dmceachernmsft Sep 21, 2023
30217bc
Merge branch 'dmceachernmsft/mobile-gallery-options' of https://githu…
dmceachernmsft Sep 21, 2023
7b23822
update cc
dmceachernmsft Sep 21, 2023
6e1e20a
build API
dmceachernmsft Sep 21, 2023
915e09e
Update packages/react-composites CallComposite browser test snapshots
github-actions[bot] Sep 21, 2023
8813cbf
Merge branch 'main' into dmceachernmsft/mobile-gallery-options
dmceachernmsft Sep 21, 2023
5d8b4fd
add auto dismiss on selection
dmceachernmsft Sep 22, 2023
6c7b0d4
Merge branch 'dmceachernmsft/mobile-gallery-options' of https://githu…
dmceachernmsft Sep 22, 2023
01a3dba
Merge branch 'main' into dmceachernmsft/mobile-gallery-options
dmceachernmsft Sep 25, 2023
af47e57
Merge branch 'main' into dmceachernmsft/mobile-gallery-options
dmceachernmsft Sep 25, 2023
c69f927
add focused content to mobile
dmceachernmsft Sep 25, 2023
000b25b
add icons representing selected mode
dmceachernmsft Sep 25, 2023
dba3f2e
disable for hold screen
dmceachernmsft Sep 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "prerelease",
"area": "feature",
"workstream": "Gallery Layouts",
"comment": "Introduce gallery controls to mobile for default and dynamic views",
"packageName": "@azure/communication-react",
"email": "94866715+dmceachernmsft@users.noreply.github.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "prerelease",
"area": "feature",
"workstream": "Gallery Layouts",
"comment": "Introduce gallery controls to mobile for default and dynamic views",
"packageName": "@azure/communication-react",
"email": "94866715+dmceachernmsft@users.noreply.github.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -1212,6 +1212,7 @@ export interface CallWithChatCompositeStrings {
moreDrawerButtonTooltip: string;
moreDrawerCaptionLanguageMenuTitle: string;
moreDrawerCaptionsMenuTitle: string;
moreDrawerGalleryOptionsMenuTitle: string;
moreDrawerMicrophoneMenuTitle: string;
moreDrawerSpeakerMenuTitle: string;
moreDrawerSpokenLanguageMenuTitle: string;
Expand Down
16 changes: 12 additions & 4 deletions packages/react-components/src/components/VideoGallery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import { VerticalGalleryStyles } from './VerticalGallery';
import { SpeakerVideoLayout } from './VideoGallery/SpeakerVideoLayout';
/* @conditional-compile-remove(gallery-layouts) */
import { FocusedContentLayout } from './VideoGallery/FocusContentLayout';
/* @conditional-compile-remove(gallery-layouts) */
/* @conditional-compile-remove(large-gallery) */
import { LargeGalleryLayout } from './VideoGallery/LargeGalleryLayout';

/**
Expand Down Expand Up @@ -431,6 +431,12 @@ export const VideoGallery = (props: VideoGalleryProps): JSX.Element => {

const initialsName = !localParticipant.displayName ? '' : localParticipant.displayName;

const showDisplayNameTrampoline = (): string => {
/* @conditional-compile-remove(gallery-layouts) */
return layout === 'default' ? strings.localVideoLabel : isNarrow ? '' : strings.localVideoLabel;
return isNarrow ? '' : strings.localVideoLabel;
};

return (
<Stack
styles={localVideoTileContainerStyles}
Expand All @@ -446,7 +452,7 @@ export const VideoGallery = (props: VideoGalleryProps): JSX.Element => {
isAvailable={localParticipant?.videoStream?.isAvailable}
isMuted={localParticipant.isMuted}
renderElement={localParticipant?.videoStream?.renderElement}
displayName={isNarrow ? '' : strings.localVideoLabel}
displayName={showDisplayNameTrampoline()}
initialsName={initialsName}
localVideoViewOptions={localVideoViewOptions}
onRenderAvatar={onRenderAvatar}
Expand All @@ -455,7 +461,7 @@ export const VideoGallery = (props: VideoGalleryProps): JSX.Element => {
(localTileNotInGrid && isNarrow) ||
/*@conditional-compile-remove(click-to-call) */ /* @conditional-compile-remove(rooms) */ localVideoTileSize ===
'9:16'
)
) || /* @conditional-compile-remove(gallery-layouts) */ layout === 'default'
}
showMuteIndicator={showMuteIndicator}
showCameraSwitcherInLocalPreview={showCameraSwitcherInLocalPreview}
Expand Down Expand Up @@ -487,7 +493,9 @@ export const VideoGallery = (props: VideoGalleryProps): JSX.Element => {
styles?.localVideo,
theme.effects.roundedCorner4,
/*@conditional-compile-remove(click-to-call) */
localVideoTileSize
localVideoTileSize,
/* @conditional-compile-remove(gallery-layouts) */
layout
]);

/* @conditional-compile-remove(pinned-participants) */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ export const DefaultLayout = (props: DefaultLayoutProps): JSX.Element => {
onChildrenPerPageChange={(n: number) => {
childrenPerPage.current = n;
}}
/* @conditional-compile-remove(gallery-layouts) */
layout={'default'}
/>
);
}, [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const LargeGalleryLayout = (props: LargeGalleryProps): JSX.Element => {
? childrenPerPage.current - ((pinnedParticipantUserIds.length + 1) % childrenPerPage.current)
: childrenPerPage.current,
/* @conditional-compile-remove(pinned-participants) */ pinnedParticipantUserIds,
/* @conditional-compile-remove(gallery-layouts) */ layout: 'largeGallery'
/* @conditional-compile-remove(large-gallery) */ layout: 'largeGallery'
});
let activeVideoStreams = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { HORIZONTAL_GALLERY_BUTTON_WIDTH, HORIZONTAL_GALLERY_GAP } from '../styl
import { VerticalGalleryStyles } from '../VerticalGallery';
/* @conditional-compile-remove(vertical-gallery) */
import { OverflowGalleryPosition } from '../VideoGallery';
/* @conditional-compile-remove(gallery-layouts) */
import { VideoGalleryLayout } from '../VideoGallery';
import { ScrollableHorizontalGallery } from './ScrollableHorizontalGallery';
import {
horizontalGalleryContainerStyle,
Expand Down Expand Up @@ -41,6 +43,8 @@ export const OverflowGallery = (props: {
/* @conditional-compile-remove(vertical-gallery) */
overflowGalleryPosition?: OverflowGalleryPosition;
onChildrenPerPageChange?: (childrenPerPage: number) => void;
/* @conditional-compile-remove(gallery-layouts) */
layout?: VideoGalleryLayout;
}): JSX.Element => {
const {
shouldFloatLocalVideo = false,
Expand Down Expand Up @@ -110,6 +114,8 @@ export const OverflowGallery = (props: {
horizontalGalleryElements={overflowGalleryElements ? overflowGalleryElements : [<></>]}
onFetchTilesToRender={onFetchTilesToRender}
key="scrollable-horizontal-gallery"
/* @conditional-compile-remove(gallery-layouts) */
layout={props.layout}
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import {
scrollableHorizontalGalleryContainerStyles,
scrollableHorizontalGalleryStyles
} from './styles/ScrollableHorizontalGallery.style';
/* @conditional-compile-remove(gallery-layouts) */
import { VideoGalleryLayout } from '../VideoGallery';

/**
* Component to display elements horizontally in a scrollable container
Expand All @@ -16,8 +18,17 @@ import {
export const ScrollableHorizontalGallery = (props: {
horizontalGalleryElements?: JSX.Element[];
onFetchTilesToRender?: (indexes: number[]) => void;
/* @conditional-compile-remove(gallery-layouts) */
layout?: VideoGalleryLayout;
}): JSX.Element => {
const { horizontalGalleryElements, onFetchTilesToRender } = props;
const { horizontalGalleryElements, onFetchTilesToRender, /* @conditional-compile-remove(gallery-layouts) */ layout } =
props;

const useFullWidthTrampoline = (): boolean => {
/* @conditional-compile-remove(gallery-layouts) */
return layout === 'default' ? true : false;
return false;
};

useEffect(() => {
const indexesArray = [...Array(horizontalGalleryElements?.length).keys()];
Expand All @@ -30,7 +41,11 @@ export const ScrollableHorizontalGallery = (props: {
const { events: dragabbleEvents } = useDraggable(ref);

return (
<div ref={ref} {...dragabbleEvents} className={scrollableHorizontalGalleryContainerStyles}>
<div
ref={ref}
{...dragabbleEvents}
className={scrollableHorizontalGalleryContainerStyles(useFullWidthTrampoline())}
>
<Stack
data-ui-id="scrollable-horizontal-gallery"
horizontal={true}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ export const scrollableHorizontalGalleryStyles: IStackStyles = {
/**
* @private
*/
export const scrollableHorizontalGalleryContainerStyles = mergeStyles({
display: 'flex',
width: `calc(100% - ${SMALL_FLOATING_MODAL_SIZE_REM.width}rem)`,
minHeight: `${SMALL_HORIZONTAL_GALLERY_TILE_SIZE_REM.height}rem`,
overflow: 'scroll',
'-ms-overflow-style': 'none',
'scrollbar-width': 'none',
'::-webkit-scrollbar': { display: 'none' }
});
export const scrollableHorizontalGalleryContainerStyles = (fullWidth: boolean): string => {
return mergeStyles({
display: 'flex',
width: fullWidth ? '100%' : `calc(100% - ${SMALL_FLOATING_MODAL_SIZE_REM.width}rem)`,
minHeight: `${SMALL_HORIZONTAL_GALLERY_TILE_SIZE_REM.height}rem`,
overflow: 'scroll',
'-ms-overflow-style': 'none',
'scrollbar-width': 'none',
'::-webkit-scrollbar': { display: 'none' }
});
};
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,7 @@ export interface CallWithChatCompositeStrings {
moreDrawerButtonTooltip: string;
moreDrawerCaptionLanguageMenuTitle: string;
moreDrawerCaptionsMenuTitle: string;
moreDrawerGalleryOptionsMenuTitle: string;
moreDrawerMicrophoneMenuTitle: string;
moreDrawerSpeakerMenuTitle: string;
moreDrawerSpokenLanguageMenuTitle: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,10 @@ export const CallArrangement = (props: CallArrangementProps): JSX.Element => {
disableButtonsForHoldScreen={isInLocalHold}
/* @conditional-compile-remove(close-captions) */
isCaptionsSupported={isTeamsCall && hasJoinedCall}
/* @conditional-compile-remove(gallery-layouts) */
onUserSetGalleryLayout={props.onUserSetGalleryLayoutChange}
/* @conditional-compile-remove(gallery-layouts) */
userSetGalleryLayout={props.userSetGalleryLayout}
/>
</Stack>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@ export interface CallWithChatCompositeStrings {
* Only used with `mobileView` set to `true`.
*/
moreDrawerCaptionLanguageMenuTitle: string;
/* @conditional-compile-remove(gallery-layouts) */
/**
* Title for the gallery options sub-menu in the more button drawer.
*/
moreDrawerGalleryOptionsMenuTitle: string;
/**
* {@Link CallWithChatComposite} control bar More button label
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Licensed under the MIT License.

import { IContextualMenuItem } from '@fluentui/react';
/* @conditional-compile-remove(gallery-layouts) */
import { ContextualMenuItemType } from '@fluentui/react';
import { ControlBarButtonProps } from '@internal/react-components';
/* @conditional-compile-remove(gallery-layouts) */
import { VideoGalleryLayout } from '@internal/react-components';
Expand Down Expand Up @@ -293,32 +291,6 @@ export const DesktopMoreButton = (props: DesktopMoreButtonProps): JSX.Element =>
iconName: 'FocusedContentGalleryLayout',
styles: { root: { lineHeight: 0 } }
}
},
{ key: 'dividerLayoutsKey', itemType: ContextualMenuItemType.Divider },
{
key: 'topKey',
text: localeStrings.strings.call.moreButtonGalleryPositionToggleLabel,
canCheck: true,
topDivider: true,
itemProps: {
styles: buttonFlyoutIncreasedSizeStyles
},
iconProps: {
iconName: 'OverflowGalleryTop',
styles: { root: { lineHeight: 0 } }
},
isChecked: galleryPositionTop,
onClick: () => {
if (galleryPositionTop === false) {
props.onUserSetOverflowGalleryPositionChange &&
props.onUserSetOverflowGalleryPositionChange('HorizontalTop');
setGalleryPositionTop(true);
} else {
props.onUserSetOverflowGalleryPositionChange &&
props.onUserSetOverflowGalleryPositionChange('Responsive');
setGalleryPositionTop(false);
}
}
}
],
calloutProps: {
Expand All @@ -327,7 +299,7 @@ export const DesktopMoreButton = (props: DesktopMoreButtonProps): JSX.Element =>
}
};
/* @conditional-compile-remove(large-gallery) */
const largeGalleryOption = {
const largeGalleryOptions = {
key: 'largeGallerySelectionKey',
text: localeStrings.strings.call.moreButtonLargeGalleryDefaultLayoutLabel,
canCheck: true,
Expand All @@ -344,9 +316,37 @@ export const DesktopMoreButton = (props: DesktopMoreButtonProps): JSX.Element =>
styles: { root: { lineHeight: 0 } }
}
};

/* @conditional-compile-remove(gallery-layouts) */
const overflowGalleryOptions = {
key: 'topKey',
text: localeStrings.strings.call.moreButtonGalleryPositionToggleLabel,
canCheck: true,
topDivider: true,
itemProps: {
styles: buttonFlyoutIncreasedSizeStyles
},
iconProps: {
iconName: 'OverflowGalleryTop',
styles: { root: { lineHeight: 0 } }
},
isChecked: galleryPositionTop,
onClick: () => {
if (galleryPositionTop === false) {
props.onUserSetOverflowGalleryPositionChange && props.onUserSetOverflowGalleryPositionChange('HorizontalTop');
setGalleryPositionTop(true);
} else {
props.onUserSetOverflowGalleryPositionChange && props.onUserSetOverflowGalleryPositionChange('Responsive');
setGalleryPositionTop(false);
}
}
};
/* @conditional-compile-remove(large-gallery) */
galleryOptions.subMenuProps?.items?.push(largeGalleryOption);
galleryOptions.subMenuProps?.items?.push(largeGalleryOptions);
/* @conditional-compile-remove(gallery-layouts) */
galleryOptions.subMenuProps?.items?.push(overflowGalleryOptions);

/* @conditional-compile-remove(gallery-layouts) */
moreButtonContextualMenuItems.push(galleryOptions);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import {
_DrawerMenuItemProps as DrawerMenuItemProps,
_DrawerMenuStyles
} from '@internal/react-components';
/* @conditional-compile-remove(gallery-layouts) */
import { VideoGalleryLayout } from '@internal/react-components';
/* @conditional-compile-remove(close-captions) */
import { _StartCaptionsButton, _CaptionsSettingsModal } from '@internal/react-components';

Expand Down Expand Up @@ -98,6 +100,12 @@ export interface MoreDrawerStrings {
* @remarks Only displayed when in Teams call, disabled until captions is on
*/
captionLanguageMenuTitle: string;

/* @conditional-compile-remove(gallery-layouts) */
/**
* Label for gallery options drawerMenuItem
*/
galleryOptionsMenuTitle: string;
}

/** @private */
Expand Down Expand Up @@ -126,6 +134,13 @@ export interface MoreDrawerDevicesMenuProps {
* Callback when a microphone is selected
*/
onSelectMicrophone: (device: AudioDeviceInfo) => Promise<void>;
/* @conditional-compile-remove(gallery-layouts) */
userSetGalleryLayout?: VideoGalleryLayout;
/* @conditional-compile-remove(gallery-layouts) */
/**
* Callback for when the gallery layout is changed
*/
onUserSetGalleryLayout?: (layout: VideoGalleryLayout) => void;
}

/** @private */
Expand Down Expand Up @@ -242,6 +257,42 @@ export const MoreDrawer = (props: MoreDrawerProps): JSX.Element => {
secondaryText: props.selectedMicrophone?.name
});
}
/* @conditional-compile-remove(gallery-layouts) */
drawerMenuItems.push({
itemKey: 'overflowGalleryPositionKey',
iconProps: {
iconName: 'GalleryOptions',
styles: { root: { lineHeight: 0 } }
},
text: localeStrings.strings.call.moreButtonGalleryControlLabel,
subMenuProps: [
{
itemKey: 'dynamicSelectionKey',
text: localeStrings.strings.call.moreButtonGalleryFloatingLocalLayoutLabel,
onItemClick: () => {
props.onUserSetGalleryLayout && props.onUserSetGalleryLayout('floatingLocalVideo');
onLightDismiss();
},
iconProps: {
iconName: 'FloatingLocalVideoGalleryLayout',
styles: { root: { lineHeight: 0 } }
}
},
{
itemKey: 'defaultSelectionKey',
text: localeStrings.strings.call.moreButtonGalleryDefaultLayoutLabel,
onItemClick: () => {
props.onUserSetGalleryLayout && props.onUserSetGalleryLayout('default');
onLightDismiss();
},
iconProps: {
iconName: 'DefaultGalleryLayout',
styles: { root: { lineHeight: 0 } }
}
}
]
});

if (drawerSelectionOptions !== false && isEnabled(drawerSelectionOptions?.peopleButton)) {
drawerMenuItems.push({
itemKey: 'people',
Expand Down
Loading