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(Participant) - count total talking time within call for participants #10068

Merged
merged 4 commits into from
Aug 8, 2023

Conversation

Antreesy
Copy link
Contributor

@Antreesy Antreesy commented Jul 27, 2023

☑️ Resolves

🖼️ Screenshots

🏚️ Before 🏡 After
image image
For currently speaking: image

🚧 Tasks

  • Code review
  • Design review
    • Additional highlight for currently speaking partcipants (apart from different text and bold font-weight)?
  • Test fix

🏁 Checklist

Copy link
Member

@danxuliu danxuliu left a comment

Choose a reason for hiding this comment

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

LocalVideo and Video views should not act as proxies of the events of their models. The source of truth is the model, and a view may or may not exist independently of its model; different view objects can be created and destroyed during the lifetime of the model, and there could even be several views for the same model (maybe right now there is always a single view for each participant model, I have not checked, but that would be just a happy coincidence).

Following a similar reasoning, the speaking time should not be calculated directly on the Participant component; it should be calculated in a helper object (one for all participants? One for each participant? I have no preference on that) that directly listens to the speaking events from the model and any view that wants to know the current speaking time of certain participant just gets the value from that helper object (whether it is exposed through an attribute that is read using reactivity or by emitting an event is not really relevant, the important part is that the speaking time is calculated/tracked in that helper object rather than the view).

@Antreesy Antreesy force-pushed the feat/9903/talking-time branch 3 times, most recently from f2d66d7 to d2b54fe Compare July 29, 2023 08:37
@Antreesy Antreesy marked this pull request as ready for review July 29, 2023 08:37
Copy link
Contributor

@ShGKme ShGKme left a comment

Choose a reason for hiding this comment

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

Looks super in general!

Some minor code style comments.

About design:

  1. Seconds don't update at the same time that looks not perfect :D
    But I don't know how easily make them sync without putting it to the store and commiting mutation every second.
  2. Time has the same text and time while talking and while not.
    "💬 01:20 talking time" - is it "talking now" and "was talking"? You will know only in a second
    What about making different styles for "speaking" and "not speaking" state?

talking-time

src/utils/SignalingSpeakingHandler.js Outdated Show resolved Hide resolved
src/utils/SignalingSpeakingHandler.js Outdated Show resolved Hide resolved
src/utils/formattedTime.js Outdated Show resolved Hide resolved
src/utils/formattedTime.js Outdated Show resolved Hide resolved
Copy link
Member

@danxuliu danxuliu left a comment

Choose a reason for hiding this comment

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

Besides the comments personally I would not even use the store and expose the speaking time directly in attributes in the SignalingSpeakingHandler (like done for other models). But in this case it would require an associative array for the participants hashed by (Nextcloud) session ID or something like that, which I do not know if it could be problematic for reactivity. Anyway, that is just personal preference... because I dislike stores :-P

src/components/CallView/shared/VideoBottomBar.spec.js Outdated Show resolved Hide resolved
src/components/CallView/shared/VideoVue.spec.js Outdated Show resolved Hide resolved
src/store/conversationsStore.js Outdated Show resolved Hide resolved
src/utils/webrtc/models/CallParticipantModel.js Outdated Show resolved Hide resolved
src/utils/webrtc/webrtc.js Outdated Show resolved Hide resolved
src/store/participantsStore.js Outdated Show resolved Hide resolved
Copy link
Member

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

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

Nice! To comment on @ShGKme's points:

Seconds don't update at the same time that looks not perfect :D

I think this is fine, usually only 1 person talks at a time – or there is an issue. ;)

Time has the same text and time while talking and while not.
What about making different styles for "speaking" and "not speaking" state?

Makes sense – how about giving the avatar of the current speaker a white border like we do for the video containers in the view, making it consistent? :) Additionally the text can be bolded as well, like we do in the video containers too.

@Antreesy
Copy link
Contributor Author

Antreesy commented Aug 1, 2023

@jancborchardt please see updated screenshots at the PR description:

  • bold font-weight for text of currently speaking participant;
  • color-primary-element outline for the avatar (white doesn't seem to have a proper visibility on background)

@danxuliu the main logic of keeping elapsed time data and its calculation remains in store (until the follow-up is resolved), handling of signals was updated, please take a look as well

Copy link
Member

@danxuliu danxuliu left a comment

Choose a reason for hiding this comment

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

Tested and mostly works 👍

I found a little issue: after a forced reconnection the talking time for the local participant is no longer shown in the sidebar (although the store is still updated when speaking and stopping speaking, as can be seen with store.getters.getParticipantSpeakingInformation(TOKEN, store.getters.getSessionId())). This can be tested in the following way:

	webrtc.forceReconnect = function() {
		forceReconnect(signaling)
	}
  • Rebuild the code
  • Setup the HPB
  • Start a call
  • Start speaking
  • In the browser console, run OCA.Talk.SimpleWebRTC.webrtc.forceReconnect()

Anyway all this could be fixed in a follow up if needed, as it may not be directly related to the speaking indicator but how sessions are handled after forced reconnections or something like that.

Finally, as a little nitpick I would have added the highlighted border for speaking participants in a separate commit :-P

src/store/participantsStore.js Outdated Show resolved Hide resolved
src/store/participantsStore.js Outdated Show resolved Hide resolved
src/utils/SignalingSpeakingHandler.js Outdated Show resolved Hide resolved
src/utils/SignalingSpeakingHandler.js Outdated Show resolved Hide resolved
src/utils/SignalingSpeakingHandler.js Outdated Show resolved Hide resolved
src/utils/SignalingSpeakingHandler.js Outdated Show resolved Hide resolved
src/utils/SignalingSpeakingHandler.js Outdated Show resolved Hide resolved
src/utils/SignalingSpeakingHandler.js Outdated Show resolved Hide resolved
src/utils/SignalingSpeakingHandler.js Outdated Show resolved Hide resolved
@Antreesy
Copy link
Contributor Author

Antreesy commented Aug 7, 2023

Anyway all this could be fixed in a follow up if needed, as it may not be directly related to the speaking indicator but how sessions are handled after forced reconnections or something like that.

Let's take a look after the feature freeze, as the current state works fine to provide screenshots for marketing, and changes shouldn't touch anything UI-related

Finally, as a little nitpick I would have added the highlighted border for speaking participants in a separate commit :-P

I've asked for the final design review, to see, if that's needed. Personally. font-weight: bold and blue border around avatar look good enough for me

@Antreesy Antreesy requested a review from danxuliu August 7, 2023 17:03
Copy link
Member

@danxuliu danxuliu left a comment

Choose a reason for hiding this comment

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

Other than the mentioned issue, tested and works 👍

Anyway all this could be fixed in a follow up if needed, as it may not be directly related to the speaking indicator but how sessions are handled after forced reconnections or something like that.

Let's take a look after the feature freeze, as the current state works fine to provide screenshots for marketing, and changes shouldn't touch anything UI-related

Totally fine to wait.

Finally, as a little nitpick I would have added the highlighted border for speaking participants in a separate commit :-P

I've asked for the final design review, to see, if that's needed. Personally. font-weight: bold and blue border around avatar look good enough for me

Sorry, I did not explain myself clearly 🤦 With the highlighted border I was referring to the bold font and the blue border around the avatar (which I also think that look good enough); it was just a comment about preferring that to be split from the code changes to add the speaking indicator, not about adding any additional design change :-)

src/utils/SignalingSpeakingHandler.js Outdated Show resolved Hide resolved
src/store/participantsStore.js Outdated Show resolved Hide resolved
* It is expected that the speaking status of participant will be
* modified only when the current conversation is joined and call is started.
*/
export default class SignalingSpeakingHandler {
Copy link
Member

Choose a reason for hiding this comment

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

Now that I see that... it should not be called SignalingSpeakingHandler :-) It should be called something like SpeakingStatusHandler or SpeakingStatusNotifier or SpeakingStatusAdapter or SpeakingStatusStoreAdapter or... whatever (I can not decide, and I could think of more names xD), but not Signaling :-)

And it should be in src/utils/webrtc rather than src/utils, as it is specific to calls rather than a generic utility.

Copy link
Contributor

@DorraJaouad DorraJaouad left a comment

Choose a reason for hiding this comment

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

Tested and it works 🦅.

Copy link
Member

@jancborchardt jancborchardt left a comment

Choose a reason for hiding this comment

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

Looks good design-wise, nice! :)

@Antreesy
Copy link
Contributor Author

Antreesy commented Aug 8, 2023

Splitted the last commit into two, renamed and moved handler, fix comments and computed properties wording - no significant changes

@Antreesy Antreesy enabled auto-merge August 8, 2023 07:46
@Antreesy Antreesy disabled auto-merge August 8, 2023 08:28
@nickvergessen
Copy link
Member

/backport to stable27

Copy link
Member

@danxuliu danxuliu left a comment

Choose a reason for hiding this comment

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

Tested again after the last rebase and (still :-) ) works 👍

CI failure is unrelated (chat integration tests in PostgreSQL)

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.

Show "Talking time" in participants list during a call
6 participants