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: Add muted indicator to people list #6152

Merged
merged 11 commits into from
Jul 12, 2023

Conversation

nikk15
Copy link
Contributor

@nikk15 nikk15 commented Jun 29, 2023

  • adds "muted" indicator in the people list sidebar for guests the user has personally muted (as per the UX Blast
  • As part of this work, I found that users' volumes were being stored under displayName undefined in store._preferences. Opted to store this under the users' session ids as these are accessible from the volume entities.
  • Made lilypad color variable names accessible from theme
Screenshot 2023-06-29 at 1 46 25 PM Screenshot 2023-06-29 at 1 46 39 PM Screenshot 2023-06-29 at 1 47 05 PM

UPDATED 7/4:
Screenshot 2023-07-04 at 3 42 36 PM
Screenshot 2023-07-04 at 3 42 31 PM

Copy link
Contributor

@keianhzo keianhzo left a comment

Choose a reason for hiding this comment

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

Thanks for working on this! I've pointed out a couple of things.

@@ -43,6 +43,6 @@ export function updateAvatarVolumesPref(displayName, gainMultiplier, muted) {
});
}

export function getAvatarVolumePref(displayName) {
return APP.store.state.preferences.avatarVoiceLevels?.[displayName];
export function getAvatarVolumePref(playerSessionId) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe the reason to use the display name instead of the session id is that the session id is ephemeral and different for each session while the display name is stored locally and only changes if the user updates it which tends to be not that often. This way we can restore user volumes across different session as long as the user doesn't update the display name.

It seems that at some point we stopped storing the displayName here:
https://github.com/mozilla/hubs/blob/9b2c6f5ba06431c2b503567335d32f710e90348a/src/components/player-info.js#L136-L143

We have two options, either store the displayName there so we can keep on accessing it through this.playerInfo.displayName or subscribe to the presence notifications in avatar-volume-controls like we do here and store the display name locally:
https://github.com/mozilla/hubs/blob/9b2c6f5ba06431c2b503567335d32f710e90348a/src/components/player-info.js#L99

Let me know if there is any other reason why we should switch to using the sessionId other than that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the context! I'll have a look into adding displayName back in.

@@ -80,6 +84,10 @@ AFRAME.registerComponent("avatar-volume-controls", {
const step = -calcGainStepDown(gainMultiplier);
gainMultiplier = THREE.MathUtils.clamp(gainMultiplier + step, 0, MAX_GAIN_MULTIPLIER);
this.updateGainMultiplier(gainMultiplier, true);
// If the gainMultiplier is lowered to 0, updated muted status in local storage
Copy link
Contributor

Choose a reason for hiding this comment

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

This is already calling updateGainMultiplier which already calls updateLocalMuted so I believe we can remove the updateLocalMuted call from here.

@hrithikwins
Copy link

image
How about 'deafened' showing up for each individual 🗡️

@Exairnous
Copy link
Contributor

We talked about this PR at the Friday meetup, so here are some additional thoughts to what Hrithik posted (although I do like Hrithik's idea).

  • Rather than adding in an additional word, it might be good to use an additional icon replacing the speaker icon to indicate that someone has been individually muted, perhaps an ear or a mouth with a slash through it? Or have the icon beside it if both global and personal muted status need to be shown at the same time.
  • Not directly related to this PR, but the conversation continued on to people thinking that the people menu was the way to go for person to person interaction and should become the central place of access for things like private chat messages, file transfers, etc..

Anyway, having an indicator for personal muting is great!

@keianhzo
Copy link
Contributor

keianhzo commented Jul 4, 2023

I really like the idea of having a private chat embedded in the people menu.

@nikk15
Copy link
Contributor Author

nikk15 commented Jul 4, 2023

image How about 'deafened' showing up for each individual 🗡️

I love this! I'll bring this to design to get the ok on the change. Thanks for the suggestion! :)

@nikk15
Copy link
Contributor Author

nikk15 commented Jul 4, 2023

I really like the idea of having a private chat embedded in the people menu.

Seconded 🚀

Copy link
Contributor

@keianhzo keianhzo left a comment

Choose a reason for hiding this comment

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

I think we should also revert the name update from playerSessionId -> displayName in avatar-volume-utils.js to avoid confusion, otherwise LGTM.

@nikk15 nikk15 temporarily deployed to hc-bio July 11, 2023 19:05 — with GitHub Actions Inactive
@nikk15 nikk15 temporarily deployed to smoke July 11, 2023 19:05 — with GitHub Actions Inactive
@keianhzo keianhzo self-requested a review July 12, 2023 13:46
Copy link
Contributor

@keianhzo keianhzo left a comment

Choose a reason for hiding this comment

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

LGTM

@nikk15 nikk15 merged commit d46b3c3 into master Jul 12, 2023
@nikk15 nikk15 deleted the add-muted-indicator-to-people-list branch July 12, 2023 13:46
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.

4 participants