-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Conversation
Force pushed to resolve conflicts. |
@@ -8,6 +8,8 @@ | |||
display: flex; | |||
flex-direction: column-reverse; | |||
height: 100%; | |||
position: fixed; | |||
z-index: $tooltipsZ; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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); | ||
} |
There was a problem hiding this comment.
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'; |
There was a problem hiding this comment.
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.
modules/UI/videolayout/LocalVideo.js
Outdated
@@ -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'; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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(); | ||
} | ||
} |
There was a problem hiding this comment.
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.
I can override the AtlasKit styling to reduce the padding. |
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 }> |
There was a problem hiding this comment.
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
Related jitsi-meet-torture changes: jitsi/jitsi-meet-torture#93
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.