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(external-api) extend event to listen to system buttons and add config to prevent execution #13529

Merged
merged 2 commits into from
Jul 20, 2023

Conversation

mihhu
Copy link
Member

@mihhu mihhu commented Jul 5, 2023

#13446

@mihhu mihhu force-pushed the participant-menu-button-click branch 5 times, most recently from 70d776c to 6e816ca Compare July 5, 2023 10:25
@mihhu mihhu marked this pull request as ready for review July 5, 2023 11:16
@mihhu mihhu force-pushed the participant-menu-button-click branch from 6e816ca to 36b7777 Compare July 6, 2023 14:42
@mihhu mihhu force-pushed the participant-menu-button-click branch from 36b7777 to a4c97c7 Compare July 6, 2023 14:56
Copy link
Member

@saghul saghul left a comment

Choose a reason for hiding this comment

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

Left some comments, PTAL!

react/features/base/config/configType.ts Outdated Show resolved Hide resolved
react/features/base/config/functions.web.ts Outdated Show resolved Hide resolved
react/features/base/config/functions.web.ts Outdated Show resolved Hide resolved
react/features/base/config/functions.web.ts Outdated Show resolved Hide resolved
APP.API.notifyToolbarButtonClicked(
buttonKey, notifyMode === NOTIFY_CLICK_MODE.PREVENT_AND_NOTIFY
);
if (notifyClick) {
Copy link
Member

Choose a reason for hiding this comment

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

This reads weird. Why does one type of button notify one way and the other a different wat? Matybe we need some notifyType to discriminate?

Copy link
Member Author

Choose a reason for hiding this comment

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

There are only a handful of participant context menu buttons that extend AbstractButton. I thought the ideal implementation would be to refactor those and leave the toolbar buttons have their own notification system implemented here. The number of toolbar buttons and their instantiations is quite intimidating and I'm afraid I'd miss something for sure. I would've went for the ideal if the PR wasn't already so verbose 🥲, wdyt?

Copy link
Member

Choose a reason for hiding this comment

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

IMHO this makes things worse in the sense that there is more code to remove after we do things The Right Way (TM). So we are adding to the debt too.

AbstractButton should've been called AbstractToolbarButton but being part of the toolbox feature kind of explains that, oh well.

I'd say let's not have buttons derived from there unless they are toolbar buttons. There is where the complexity starts.

Copy link
Member

Choose a reason for hiding this comment

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

@robertpin Can you weigh in here too?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd say let's not have buttons derived from there unless they are toolbar buttons.

I noticed that the buttons that aren't extending the AbstractButton class on the web are extending it on the native side. Should I refactor everything? Or should I leave native for another PR?

react/features/video-menu/components/web/KickButton.tsx Outdated Show resolved Hide resolved
@saghul saghul requested a review from robertpin July 7, 2023 09:41
@saghul
Copy link
Member

saghul commented Jul 7, 2023

@robertpin I'd like your input on this one please.

@robertpin
Copy link
Contributor

@robertpin I'd like your input on this one please.

I think @horymury worked on this in the past so he is better suited for this one

@mihhu mihhu force-pushed the participant-menu-button-click branch from d30fe41 to 283aec5 Compare July 14, 2023 13:53
Copy link
Member

@saghul saghul left a comment

Choose a reason for hiding this comment

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

LGTM with a tiny nit, great work!

/**
* Participant context menu button keys.
*/
export const PARTICIPANT_MENU_BUTTONS = {
Copy link
Member

Choose a reason for hiding this comment

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

style nit: sort variables alphabetically

Copy link
Member

Choose a reason for hiding this comment

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

I mean PARTICIPANT_MENU_BUTTONS relative to VOLUME_SLIDER_SCALE

@saghul saghul merged commit 1b7a81a into jitsi:master Jul 20, 2023
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.

3 participants