Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

together mode component #5517

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

together mode component #5517

wants to merge 7 commits into from

Conversation

cn0151
Copy link
Member

@cn0151 cn0151 commented Dec 20, 2024

What

This PR contains together mode component layout and styling

Why

Needed as part of together mode implementation

How Tested

locally

Process & policy checklist

  • I have updated the project documentation to reflect my changes if necessary.
  • I have read the CONTRIBUTING documentation.

Is this a breaking change?

  • This change causes current functionality to break.

Copy link
Contributor

Failed to pass the UI Test. If this PR is for UI change and the error is snapshot mismatch, please add "update_snapshots" label to the PR for updating the snapshot.

1 similar comment
Copy link
Contributor

Failed to pass the UI Test. If this PR is for UI change and the error is snapshot mismatch, please add "update_snapshots" label to the PR for updating the snapshot.

Copy link
Contributor

Copy link
Contributor

github-actions bot commented Dec 20, 2024

@azure/communication-react jest test coverage for stable.

Lines Statements Functions Branches
Base 27852 / 44245
62.94%
27852 / 44245
62.94%
780 / 1419
54.96%
2324 / 3685
63.06%
Current 27844 / 44293
62.86%
27844 / 44293
62.86%
780 / 1423
54.81%
2331 / 3691
63.15%
Diff -8 / 48
-0.08%
-8 / 48
-0.08%
0 / 4
-0.15%
7 / 6
0.09%

Copy link
Contributor

github-actions bot commented Dec 20, 2024

@azure/communication-react jest test coverage for beta.

Lines Statements Functions Branches
Base 56197 / 92193
60.95%
56197 / 92193
60.95%
1152 / 2656
43.37%
3461 / 5698
60.74%
Current 56596 / 93048
60.82%
56596 / 93048
60.82%
1152 / 2667
43.19%
3488 / 5716
61.02%
Diff 399 / 855
-0.13%
399 / 855
-0.13%
0 / 11
-0.18%
27 / 18
0.28%

Copy link
Contributor

Copy link
Contributor

Copy link
Contributor

CallWithChat bundle size is not changed.

  • Current size: 11767078
  • Base size: 11767078
  • Diff size: 0

Copy link
Contributor

Calling bundle size is not changed.

  • Current size: 11767065
  • Base size: 11767065
  • Diff size: 0

Copy link
Contributor

Chat bundle size is decreased✅.

  • Current size: 1767755
  • Base size: 1767756
  • Diff size: -1

Copy link
Contributor

Copy link
Contributor

*
* @returns {JSX.Element} An empty JSX element.
*/
export const TogetherModeOverlay = React.memo(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we import memo from React here? or do we need to use the keyword? we want to avoid this if we can to make sure we are using the ESM module

<div
style={moveAnimationStyles(
parseFloat(participantStatus.seatPositionStyle.seatPosition.height) * 0.5,
parseFloat(participantStatus.seatPositionStyle.seatPosition.height) * 0.35
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get some constants to define these numbers? just so we can know what they do in the future if we need to update them

width: `${emojiSize}`,
position: 'absolute',
left: `${
(100 -
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here with these numbers

parentWidth
]);

return screenShareComponent ? (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To cut down on duplicated code maybe the thing to do here when screenshare is active is to have the VideoGallery use another layout. at lease until we are wanting to support a different view for together mode?

screenShareComponent?: JSX.Element;
containerWidth?: number;
containerHeight?: number;
}): React.ReactNode => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a reason that this is a ReactNode and not a JSX element?

/**
* @private
*/
export const togetherModeParticipantStatusContainer = (
Copy link
Contributor

@edwardlee-msft edwardlee-msft Jan 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have a majority of these styles in a separate style.
And then just have a merge styles instead for specific background color, radius?

Same thing for the togetherModeParticipantDisplayName

Edit: On second thought, we can probably keep it like this if there is no reusuable code

* @returns The scaled size.
*/
export const calculateScaledSize = (width: number, height: number): number => {
const maxSize = 600;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do these numbers mean? What is maxSize and what is minSize?
Should these just be constants at the top of the page?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants