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

feat(jitsipopover): convert to InlineDialog #1804

Merged
merged 7 commits into from
Aug 14, 2017
Merged

feat(jitsipopover): convert to InlineDialog #1804

merged 7 commits into from
Aug 14, 2017

Conversation

virtuacoplenny
Copy link
Contributor

@virtuacoplenny virtuacoplenny commented Jul 19, 2017

Related jitsi-meet-torture changes: jitsi/jitsi-meet-torture#93

  • Remove JitsiPopover and use InlineDialog instead.
  • Bring the remote menu icon into react.
  • Make vertical filmstrip position:fixed so popper (AtlasKit
    dependency) sets InlineDialogs and eventually tooltips to
    position:fixed.

Future refactoring will likely be needed, such as having the Remote Video Menu Button take in an arbitrary prop/child to display in its InlineDialog, but the current changes were easier to work with for now and should not put future refactoring in a tougher position.

@virtuacoplenny
Copy link
Contributor Author

Force pushed to resolve conflicts.

@@ -8,6 +8,8 @@
display: flex;
flex-direction: column-reverse;
height: 100%;
position: fixed;
z-index: $tooltipsZ;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

popper will set itself as position:fixed if any of its parents are position:fixed. This is necessary to get the InlineDialogs to pop out of the scrolling filmstrip.

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 add this as a comment in the code. It will help people that aren't that familiar with css to understand the importance of this particular property here.

.raisehandindicator,
#dominantspeakerindicator {
transform: translate3d(0, 0, 0);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

position:fixed inline dialog will position itself relative to a parent that has translate3d. The icons are inside __toolbar and __toptoolbar, so leaving translate3d on them would cause the inline dialogs to look position:absolute. So, move the hardware acceleration closer to the icons that need them so none of the parents have position:fixed.

@@ -49,7 +49,6 @@
@import 'recording';
@import 'login_menu';
@import 'popover';
@import 'jitsi_popover';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All JitsiPopover references should be removed at this point as it has been replaced with InlineDialog.

@@ -24,6 +24,9 @@ function LocalVideo(VideoLayout, emitter) {
this._buildContextMenu();
this.isLocal = true;
this.emitter = emitter;
this.statsPopoverLocation = interfaceConfig.VERTICAL_FILMSTRIP
? 'left bottom' : 'top right';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

InlineDialog/popper does not ensure it displays itself fully in the viewport. With the local video on the bottom right, it is possible for stats to them display cut off on the bottom when fully expanded. To make up for this, nudge it up (which is "bottom" due to other css tricks in play).


const ignoreClick = clickedOnDisplayName
|| clickedOnPopoverTrigger
|| clickedOnPopover;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Prevent clicks on InlineDialog, which is not a child of the LocalVideo component, from causing focus.

);
</I18nextProvider>
</Provider>,
remoteVideoMenuContainer);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The piece of dom that used to be hovered over to display the remote menu was not in react yet. It was necessary to put that into react for InlineDialog. That piece of dom was moved into RemoteVideoMenuTriggerButton.

this.VideoLayout.handleVideoThumbClicked(this.id);
}

// On IE we need to populate this handler on video <object>
// and it does not give event instance as an argument,
// so we check here for methods.
if (event.stopPropagation && event.preventDefault) {
if (event.stopPropagation && event.preventDefault && !ignoreClick) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as LocalVideo, InlineDialog is not a child dom element of RemoteVideo so prevent InlineDialog clicks from causing focus.

*/
showMoreLink: React.PropTypes.bool,
statsPopoverPosition: React.PropTypes.string,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

enableStatsDisplay is to prevent clicks from causing the stats popover to display in filmstrip only mode. The statsPopoverPosition is necessary for nudging the stats display for local video in vertical filmstrip mode.

The better design here is for ConnectionIndicator to take in children to pass into the InlineDialog for display, so that a parent can better control stats display instead of relying on ConnectionIndicator. However, this design follows existing, pre-react logic and was just easier to implement at this current moment. Future reactification work (that I will do) will revisit this.

@@ -27,7 +27,7 @@ class BaseIndicator extends Component {
iconClassName: React.PropTypes.string,

/**
* The front size for the icon.
* The font size for the icon.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

typo I found while fixing other stuff. Unrelated but trivial so I'm trying to "sneak it in."

if (onClick) {
onClick();
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

MuteButton and KickButton hookup into redux is not necessary but was done to help clean up what needs to get passed into RemoteVideoMenuTriggerButton/RemoteVideoMenu. In general the remote menu buttons should be smart buttons that know how to dispatch actions that affect a participant.

- Remove JitsiPopover and use InlineDialog instead.
- Bring the remote menu icon into react.
- Make vertical filmstrip position:fixed so popper (AtlasKit
  dependency) sets InlineDialogs and eventually tooltips to
  position:fixed.
@yanas
Copy link
Member

yanas commented Aug 9, 2017

Some general observations and questions:

  • When clicking on the remote video thumbnail menu, the menu appears, but if I click again on the 3 dot button it doesn't disappear
  • Question: is there a way to have less indentation/padding inside the inline dialog:

screenshot 2017-08-09 15 25 23

@virtuacoplenny
Copy link
Contributor Author

I can override the AtlasKit styling to reduce the padding.

@yanas
Copy link
Member

yanas commented Aug 9, 2017

There's some positioning weirdness with the inline dialogs and just want to check what the constraints are there. So I have those different menus:
screenshot 2017-08-09 17 15 55
screenshot 2017-08-09 17 15 47
screenshot 2017-08-09 17 15 36

  • The first one seems aligned to the trigger vertically, which kind of shifts it from the top of the thumbnail and is very close to the thumbnail to the right.
  • The second one is centered vertically to the trigger it seems, which is fine. It also has more space to the right, which is also fine. Just mentioning the differences.
  • The third one appears weirdly compared to the trigger. I remember that there was some constraint there, but can you remind me what exactly?

@virtuacoplenny
Copy link
Contributor Author

For the third one: "I can't get the inline dialog not to be cut off by the bottom of the screen for local stats, so I moved it up."

content = { this._renderStatisticsTable() }
isOpen = { this.state.showStats }
onClose = { this._onStatsClose }
position = { this.props.statsPopoverPosition }>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yanas, you can directly play with positioning on this line. Maybe you want to try another position other than on the left? Maybe bottom/top? You might encounter z-indexing issues but those should be fixable. What you seem to be expecting is the old jitsipopover behavior that uses jquery to nudge the position to where you want and nudge the view to make it fit in the viewport. However, I can't get that behavior with AtlasKit but maybe you can figure out a way and I'm overlooking it. https://atlaskit.atlassian.com/components/inline-dialog

@yanas yanas merged commit 725d39d into jitsi:master Aug 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants