Skip to content

Commit

Permalink
Merge branch 'main' into cnwankwo/together_mode_bugbash_fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cn0151 authored Jan 31, 2025
2 parents 1ddb1a4 + d9f22aa commit 7f34a80
Show file tree
Hide file tree
Showing 22 changed files with 87 additions and 241 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "patch",
"area": "fix",
"workstream": "",
"comment": "Hide read by in chat action flyout when participants is 20 or more, as read count is not supported.",
"packageName": "@azure/communication-react",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "patch",
"area": "improvement",
"workstream": "Hard mute",
"comment": "Remove hard mute conditional compile - part 3",
"packageName": "@azure/communication-react",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "patch",
"area": "fix",
"workstream": "",
"comment": "Hide read by in chat action flyout when participants is 20 or more, as read count is not supported.",
"packageName": "@azure/communication-react",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"type": "patch",
"area": "improvement",
"workstream": "Hard mute",
"comment": "Remove hard mute conditional compile - part 3",
"packageName": "@azure/communication-react",
"email": "[email protected]",
"dependentChangeType": "patch"
}
25 changes: 2 additions & 23 deletions common/config/webpack/sampleapp.webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
const CopyPlugin = require("copy-webpack-plugin");
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
const ReactRefreshTypeScript = require('react-refresh-typescript');

// Detect if running in GitHub Codespaces environment through environment variable set by codespace.
// More details: https://docs.github.com/en/codespaces/developing-in-a-codespace/default-environment-variables-for-your-codespace#list-of-default-environment-variables
const RUNNING_IN_GH_CODESPACES = !!process.env.CODESPACES;

const webpackConfig = (sampleAppDir, env, babelConfig) => {
const config = {
Expand Down Expand Up @@ -52,12 +46,7 @@ const webpackConfig = (sampleAppDir, env, babelConfig) => {
test: /\.tsx?$/,
loader: 'ts-loader',
options: {
transpileOnly: true,

// Enable HRML for GH codespaces devlopment (this was found to not work on MacOS so enabling for GH Codespaces only)
getCustomTransformers: () => ({
before: [!env.production && RUNNING_IN_GH_CODESPACES && ReactRefreshTypeScript()].filter(Boolean),
})
transpileOnly: true
},
exclude: /dist/,
sideEffects: false
Expand All @@ -77,9 +66,6 @@ const webpackConfig = (sampleAppDir, env, babelConfig) => {
]
},
plugins: [
// Enable HRML for GH codespaces devlopment (this was found to not work on MacOS so enabling for GH Codespaces only)
!env.production && RUNNING_IN_GH_CODESPACES && new ReactRefreshWebpackPlugin(),

new HtmlWebpackPlugin({ template: './public/index.html' }),
new webpack.DefinePlugin({
'process.env.PRODUCTION': env.production || !env.development,
Expand All @@ -100,19 +86,12 @@ const webpackConfig = (sampleAppDir, env, babelConfig) => {
{ from: path.resolve(sampleAppDir, "public/assets"), to: "assets", noErrorOnMissing: true },
]
})
].filter(Boolean),
],
devServer: {
port: 3000,
hot: true,
open: true,
static: { directory: path.resolve(sampleAppDir, 'public') },
// To support hot reloading in GitHub Codespaces, we need to use the secure websocket URL
// For more details: https://github.com/orgs/community/discussions/11524#discussioncomment-2176952
client: RUNNING_IN_GH_CODESPACES ? {
webSocketURL: {
port: '443'
}
} : undefined,
proxy: [
{
path: '/token',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3220,7 +3220,13 @@ export const DEFAULT_COMPOSITE_ICONS: {
CaptionsSettingsIcon: React_2.JSX.Element;
ChangeSpokenLanguageIcon: React_2.JSX.Element;
ChangeCaptionLanguageIcon: React_2.JSX.Element;
ContextMenuCameraIcon: React_2.JSX.Element;
ContextMenuCameraIcon: React_2.JSX.Element; /**
* Icons that can be overridden in one of the composites exported by this library.
*
* See {@link ChatCompositeIcons}, {@link CallCompositeIcons} and {@link CallWithChatCompositeIcons} for more targeted types.
*
* @public
*/
ContextMenuMicIcon: React_2.JSX.Element;
ContextMenuSpeakerIcon: React_2.JSX.Element;
ContextMenuRemoveParticipant: React_2.JSX.Element;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,14 @@ export const ChatMessageActionFlyout = (props: ChatMessageActionFlyoutProps): JS
onClick: props.onRemoveClick
}
];
// only show read by x of x if more than 3 participants in total including myself
// only show read by x of y if more than 3 participants in total including myself
// only show read by x of y if less than 20 participants in total including myself. This is because read by is not supported for 20 or more participants.
// TODO: change strings.messageReadCount to be required if we can fallback to our own en-us strings for anything that Contoso doesn't provide
if (
props.remoteParticipantsCount &&
messageReadByCount !== undefined &&
props.remoteParticipantsCount >= 2 &&
props.remoteParticipantsCount < 19 &&
props.showMessageStatus &&
props.strings.messageReadCount &&
props.messageStatus !== 'failed'
Expand Down
6 changes: 1 addition & 5 deletions packages/react-components/src/components/LocalVideoTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ export const _LocalVideoTile = React.memo(
reactionResources?: ReactionResources;
participantsCount?: number;
isScreenSharingOn?: boolean;
/* @conditional-compile-remove(media-access) */
mediaAccess?: MediaAccess;
}) => {
const {
Expand Down Expand Up @@ -104,7 +103,6 @@ export const _LocalVideoTile = React.memo(
strings,
reactionResources,
isScreenSharingOn,
/* @conditional-compile-remove(media-access) */
mediaAccess
} = props;

Expand All @@ -118,7 +116,6 @@ export const _LocalVideoTile = React.memo(
onDisposeLocalStreamView,
renderElementExists: !!renderElement,
scalingMode: localVideoViewOptions?.scalingMode,
/* @conditional-compile-remove(media-access) */
isVideoPermitted: mediaAccess ? mediaAccess.isVideoPermitted : true
}),
[
Expand All @@ -128,7 +125,6 @@ export const _LocalVideoTile = React.memo(
onCreateLocalStreamView,
onDisposeLocalStreamView,
renderElement,
/* @conditional-compile-remove(media-access) */
mediaAccess
]
);
Expand Down Expand Up @@ -278,7 +274,7 @@ export const _LocalVideoTile = React.memo(
)
}
overlay={videoTileOverlay}
/* @conditional-compile-remove(media-access) */ mediaAccess={mediaAccess}
mediaAccess={mediaAccess}
>
{drawerMenuItemProps.length > 0 && (
<Layer hostId={props.drawerMenuHostId}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,26 +268,18 @@ export interface NotificationStackStrings {
* Message shown in notification when breakout room is closing soon
*/
breakoutRoomClosingSoon?: NotificationStrings;

/* @conditional-compile-remove(media-access) */
/**
* Message shown in notification when capability turnVideoOn is present
*/
capabilityTurnVideoOnPresent?: NotificationStrings;

/* @conditional-compile-remove(media-access) */
/**
* Message shown in notification when capability turnVideoOn is absent
*/
capabilityTurnVideoOnAbsent?: NotificationStrings;

/* @conditional-compile-remove(media-access) */
/**
* Message shown in notification when capability unMuteMic is present
*/
capabilityUnmuteMicPresent?: NotificationStrings;

/* @conditional-compile-remove(media-access) */
/**
* Message shown in notification when capability unMuteMic is absent
*/
Expand Down
2 changes: 0 additions & 2 deletions packages/react-components/src/components/ParticipantItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,8 @@ export interface ParticipantItemStrings {
participantItemWithMoreOptionsAriaLabel?: string;
/** String for the attendee role */
attendeeRole: string;
/* @conditional-compile-remove(media-access) */
/** Label for the disabled microphone icon in participant state stack */
micDisabledIconLabel: string;
/* @conditional-compile-remove(media-access) */
/** Label for the disabled camera icon in participant state stack */
cameraDisabledIconLabel: string;
}
Expand Down
63 changes: 18 additions & 45 deletions packages/react-components/src/components/ParticipantList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,29 +151,17 @@ const onRenderParticipantDefault = (
const displayName = formatDisplayName(participant.displayName);

const callingPalette = (theme as unknown as CallingTheme).callingPalette;

const isPinned = pinnedParticipants && pinnedParticipants?.includes(participant.userId);
const isScreenSharing = callingParticipant?.isScreenSharing;
const isMuted = callingParticipant?.isMuted;
const hasRaisedHand = callingParticipant?.raisedHand;
const isAudioPermitted = callingParticipant?.mediaAccess ? callingParticipant.mediaAccess.isAudioPermitted : true;
const isVideoPermitted = callingParticipant?.mediaAccess ? callingParticipant.mediaAccess.isVideoPermitted : true;

const showRenderIconTrampoline = (): boolean => {
/* @conditional-compile-remove(media-access) */
return !!(
callingParticipant?.isScreenSharing ||
callingParticipant?.isMuted ||
callingParticipant?.raisedHand ||
isPinned ||
!(callingParticipant?.mediaAccess ? callingParticipant.mediaAccess.isAudioPermitted : true) ||
!(callingParticipant?.mediaAccess ? callingParticipant.mediaAccess.isVideoPermitted : true)
);

return !!(
callingParticipant?.isScreenSharing ||
callingParticipant?.isMuted ||
callingParticipant?.raisedHand ||
isPinned
);
};
const shouldRenderParticipantIcon =
isScreenSharing || isMuted || hasRaisedHand || isPinned || !isAudioPermitted || !isVideoPermitted;

const onRenderIcon = showRenderIconTrampoline()
const onRenderIcon = shouldRenderParticipantIcon
? () => (
<Stack horizontal={true} tokens={{ childrenGap: '0.5rem' }}>
{callingParticipant.raisedHand && (
Expand Down Expand Up @@ -206,29 +194,16 @@ const onRenderParticipantDefault = (
)}
{callingParticipant.spotlight && <Icon iconName="ParticipantItemSpotlighted" className={iconStyles} />}
{isPinned && <Icon iconName="ParticipantItemPinned" className={iconStyles} />}
{
/* @conditional-compile-remove(media-access) */ callingParticipant.mediaAccess &&
!callingParticipant.mediaAccess.isVideoPermitted ? (
<Icon
iconName="ControlButtonCameraProhibited"
className={iconStyles}
ariaLabel={strings.mutedIconLabel}
/>
) : undefined
}
{
/* @conditional-compile-remove(media-access) */ callingParticipant.mediaAccess &&
!callingParticipant.mediaAccess?.isAudioPermitted ? (
<Icon iconName="ControlButtonMicProhibited" className={iconStyles} ariaLabel={strings.mutedIconLabel} />
) : undefined
}
{
/* @conditional-compile-remove(media-access) */ (callingParticipant.mediaAccess
? callingParticipant.mediaAccess.isAudioPermitted
: true) && callingParticipant.isMuted ? (
<Icon iconName="ParticipantItemMicOff" className={iconStyles} ariaLabel={strings.mutedIconLabel} />
) : undefined
}
{callingParticipant.mediaAccess && !callingParticipant.mediaAccess.isVideoPermitted ? (
<Icon iconName="ControlButtonCameraProhibited" className={iconStyles} ariaLabel={strings.mutedIconLabel} />
) : undefined}
{callingParticipant.mediaAccess && !callingParticipant.mediaAccess?.isAudioPermitted ? (
<Icon iconName="ControlButtonMicProhibited" className={iconStyles} ariaLabel={strings.mutedIconLabel} />
) : undefined}
{(callingParticipant.mediaAccess ? callingParticipant.mediaAccess.isAudioPermitted : true) &&
callingParticipant.isMuted ? (
<Icon iconName="ParticipantItemMicOff" className={iconStyles} ariaLabel={strings.mutedIconLabel} />
) : undefined}
</Stack>
)
: () => null;
Expand All @@ -254,10 +229,8 @@ const onRenderParticipantDefault = (
displayName: displayName ?? '',
connectionState: formatParticipantStateString(callingParticipant, strings) ?? '',
mutedState: (callingParticipant.isMuted ? strings?.mutedIconLabel : undefined) ?? '',
/* @conditional-compile-remove(media-access) */
micDisabledState:
(callingParticipant.mediaAccess?.isAudioPermitted === false ? strings?.micDisabledIconLabel : undefined) ?? '',
/* @conditional-compile-remove(media-access) */
cameraDisabledState:
(callingParticipant.mediaAccess?.isVideoPermitted === false ? strings?.cameraDisabledIconLabel : undefined) ?? '',
sharingState: (callingParticipant.isScreenSharing ? strings?.sharingIconLabel : undefined) ?? '',
Expand Down
19 changes: 4 additions & 15 deletions packages/react-components/src/components/RemoteVideoTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,9 @@ export const _RemoteVideoTile = React.memo(
toggleAnnouncerString?: (announcerString: string) => void;
reactionResources?: ReactionResources;
onLongTouch?: (() => void) | undefined;
/* @conditional-compile-remove(media-access) */
onForbidAudio?: (userIds: string[]) => Promise<void>;
/* @conditional-compile-remove(media-access) */
onPermitAudio?: (userIds: string[]) => Promise<void>;
/* @conditional-compile-remove(media-access) */
onForbidVideo?: (userIds: string[]) => Promise<void>;
/* @conditional-compile-remove(media-access) */
onPermitVideo?: (userIds: string[]) => Promise<void>;
}) => {
const {
Expand Down Expand Up @@ -109,13 +105,9 @@ export const _RemoteVideoTile = React.memo(
strings,
reactionResources,
streamId,
/* @conditional-compile-remove(media-access) */
onForbidAudio,
/* @conditional-compile-remove(media-access) */
onPermitAudio,
/* @conditional-compile-remove(media-access) */
onForbidVideo,
/* @conditional-compile-remove(media-access) */
onPermitVideo
} = props;

Expand All @@ -131,7 +123,6 @@ export const _RemoteVideoTile = React.memo(
renderElementExists: !!renderElement,
scalingMode: remoteVideoViewOptions?.scalingMode,
streamId,
/* @conditional-compile-remove(media-access) */
isVideoPermitted: remoteParticipant.mediaAccess ? remoteParticipant.mediaAccess.isVideoPermitted : true
}),
[
Expand All @@ -145,7 +136,6 @@ export const _RemoteVideoTile = React.memo(
renderElement,
userId,
streamId,
/* @conditional-compile-remove(media-access) */
remoteParticipant.mediaAccess
]
);
Expand All @@ -168,10 +158,10 @@ export const _RemoteVideoTile = React.memo(
onStopSpotlight,
maxParticipantsToSpotlight,
onMuteParticipant,
/* @conditional-compile-remove(media-access) */ onForbidAudio,
/* @conditional-compile-remove(media-access) */ onPermitAudio,
/* @conditional-compile-remove(media-access) */ onForbidVideo,
/* @conditional-compile-remove(media-access) */ onPermitVideo
onForbidAudio,
onPermitAudio,
onForbidVideo,
onPermitVideo
});

const videoTileContextualMenuProps = useMemo(() => {
Expand Down Expand Up @@ -277,7 +267,6 @@ export const _RemoteVideoTile = React.memo(
}
isSpotlighted={isSpotlighted}
overlay={reactionOverlay}
/* @conditional-compile-remove(media-access) */
mediaAccess={remoteParticipant.mediaAccess}
/>
{drawerMenuItemProps.length > 0 && (
Expand Down
Loading

0 comments on commit 7f34a80

Please sign in to comment.