Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Refactor element call lobby + skip lobby - #12057

Merged
toger5 merged 58 commits into
developfrom
toger5/skip_lobby
Jan 29, 2024
Merged

Refactor element call lobby + skip lobby#12057
toger5 merged 58 commits into
developfrom
toger5/skip_lobby

Conversation

@toger5

@toger5 toger5 commented Dec 14, 2023

Copy link
Copy Markdown
Contributor

This PR can be reviewed per commit:

  • The first commit updates the embedding to use the lobby that is supported by Element Call (instead of the custom EW lobby). We also update the EC url generation to use template variables. (this allows to store the configuration in widget.data which makes it easy to parse the current widget configuration.
  • The second commit hooks up various places where one can join/start a call so that shiftKey+click will skip the lobby.
  • The last commit removes all the code that is not needed anymore. (Lobby UI)

All the following commits refactor and add a lot of testing changes.
Signed-off-by: Timo K toger5@hotmail.de
Requires: element-hq/element-web#26879

Alert

In its current state this breaks Jitsi (because its removing the lobby code entirely)

Checklist

  • Tests written for new code (and old code if feasible)
  • Linter and other CI checks pass
  • Sign-off given on the changes (see CONTRIBUTING.md)

Here's what your changelog entry will look like:

✨ Features

  • Refactor element call lobby + skip lobby (#12057). Contributed by @toger5.

 - expose skip lobby
 - use the widget.data to build the widget url

Signed-off-by: Timo K <toger5@hotmail.de>
Signed-off-by: Timo K <toger5@hotmail.de>
@toger5
toger5 requested a review from a team as a code owner December 14, 2023 18:37
@toger5 toger5 added the T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements label Dec 14, 2023
@toger5
toger5 force-pushed the toger5/skip_lobby branch 2 times, most recently from f984491 to 9d1a3f4 Compare December 14, 2023 18:43
Signed-off-by: Timo K <toger5@hotmail.de>
Signed-off-by: Timo K <toger5@hotmail.de>
Signed-off-by: Timo K <toger5@hotmail.de>
Signed-off-by: Timo K <toger5@hotmail.de>
Signed-off-by: Timo K <toger5@hotmail.de>
Signed-off-by: Timo K <toger5@hotmail.de>
Signed-off-by: Timo K <toger5@hotmail.de>
Signed-off-by: Timo K <toger5@hotmail.de>
And use them for integrated lobby.

Signed-off-by: Timo K <toger5@hotmail.de>
Signed-off-by: Timo K <toger5@hotmail.de>
Signed-off-by: Timo K <toger5@hotmail.de>
Signed-off-by: Timo K <toger5@hotmail.de>
Signed-off-by: Timo K <toger5@hotmail.de>
Signed-off-by: Timo K <toger5@hotmail.de>
…pening the lobby)

Signed-off-by: Timo K <toger5@hotmail.de>
Not on widget creation.

Signed-off-by: Timo K <toger5@hotmail.de>

@robintown robintown left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I was able to follow this for the most part, but the one part I need reminding about is why we need to use the 'connected' state for simply viewing the lobby

Comment thread playwright/e2e/room/room-header.spec.ts Outdated
Comment thread src/components/views/voip/CallView.tsx Outdated
Comment thread src/components/views/voip/CallView.tsx Outdated
Comment thread src/components/views/voip/CallView.tsx Outdated
Comment on lines 46 to +47
view_call?: boolean; // Whether to view the call or call lobby for the room
skipLobby?: boolean; // Whether to skip the call lobby when showing the call (only supported for element calls)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Non-blocking comment: I just had the thought that these two fields could be combined in a single view_call?: "lobby" | "call" field, for the sake of keeping related data together. Otherwise you end up with { action: "view_room", view_call: undefined, skipLobby: true } as a possible payload, which isn't very meaningful IMO.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I see the redundance in the information (4 casses for 3 possible scenarios)
I thought about it for a bit but for the sake of intruducing fewer termonology I think we should keep it for now.
skipLobby is a documented term also in EC. intrducing "view_room":"lobby" would need everyone to understand that this results in skipLobby=true.

So if we fix this it should be fixed for the whole chain: EC would need to get a view property which an be set to "lobby" or `"call".
WDYT?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hmm, I do see the value in having the terms be consistent. Maybe we could go with view_call?: "lobby" | "skipLobby" to keep the connection there without needing to change how EC handles this flag?

@toger5 toger5 Jan 29, 2024

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That reduces the possible inputs to 3 (which makes sense sicne there are only 3 possible choices)

It is slighly harder to read (a bit more confusing) in the case there is a running call and its just about showing that call. In this case one need to set it to "lobby" but just wants to show the running call.
And undefined would mean it deos NOT show the call (moves the call to pip)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is there something like rust enums:

enum ViewCallSettings{
    ViewCall(LobbySetting),
    UnViewCall,
    Keep,
}
enum LobbySetting{
    Skip,
    Show,
    Default
}

Its really 5 cases in the end:

  • view call with whatever lobby setting is the default
  • view call with in lobby state
  • view call and skip the lobby
  • Explicitly dont view the call but instead the caht
  • dispatch a roomView update but dont touch the view call settings

Comment thread src/hooks/room/useRoomCall.ts Outdated
Comment thread src/utils/video-rooms.ts Outdated
toger5 and others added 8 commits January 25, 2024 12:49
Co-authored-by: Robin <robin@robin.town>
Co-authored-by: Robin <robin@robin.town>
rename connect -> start
isVideoRoom not dependant on feature flags
rename allOtherCallsDisconnected -> disconnectAllOtherCalls

Signed-off-by: Timo K <toger5@hotmail.de>
Signed-off-by: Timo K <toger5@hotmail.de>
Signed-off-by: Timo K <toger5@hotmail.de>
Signed-off-by: Timo K <toger5@hotmail.de>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

T-Enhancement New features, changes in functionality, performance boosts, user-facing improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants