Skip to content

FEATURE: Improve emoji diversity rendering #32909

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

Merged
merged 4 commits into from
May 27, 2025

Conversation

pento
Copy link
Member

@pento pento commented May 26, 2025

✨ What's This?

This change polishes the emoji diversity rendering behaviour in the emoji pickers. When a user changes their diversity setting, that setting will now be applied to favourites, chat default reactions, and in the emoji picker section selectors.

If an emoji was previously stored with a skin tone in favourites or default reactions, the stored skin tone won't be overridden.

📺 Screenshots



@pento pento self-assigned this May 26, 2025
@github-actions github-actions bot added the chat PRs which include a change to Chat plugin label May 26, 2025
@jjaffeux
Copy link
Contributor

That was on purpose, but honestly no big feelings on if that should go that way or the other. My reasoning was: I store what has actually been used. My main complaint would probably be that it's more code for something that people will very rarely use (supposedly we don't change the diversity value very often).

Anyways, if you feel like it should be like this, Im fine with it 👍

Comment on lines 79 to 81
this.emojiStore.diversity !== DEFAULT_DIVERSITY &&
!/:t[1-6]$/.test(emoji) &&
isSkinTonableEmoji(emoji)
Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed that this logic is being duplicated in two spots in the codebase. Might be good for us to centralize it into a function somewhere.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, I moved the regex test into isSkinTonableEmoji(), where it more accurately fits the intended logic of the function.

Comment on lines +257 to +260
// Check if the emoji term already has a tone modifier
if (/:t[1-6]:?$/.test(term)) {
return false;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't know if I agree with this...

Technically :woman_artist:t1: can be changed to :woman_artist:t2: so it's a little bit surprising.

Copy link
Member Author

Choose a reason for hiding this comment

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

Looking at the couple of places where isSkinTonableEmoji() was called in the codebase (prior to this PR), it appears that this is the expected behaviour: other usages will append a tone modifier if isSkinTonableEmoji() returns true.

Copy link
Contributor

@jjaffeux jjaffeux May 26, 2025

Choose a reason for hiding this comment

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

Ok fair, I guess I was not so surprised by this in the past :D

@pento pento merged commit 8efd99d into main May 27, 2025
16 checks passed
@pento pento deleted the pento/feature-improve-emoji-reaction-skin-tone-rendering branch May 27, 2025 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chat PRs which include a change to Chat plugin
Development

Successfully merging this pull request may close these issues.

3 participants