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

[🐴] add emoji multiplier prop to RichText and bump it up for DMs #4229

Merged
merged 9 commits into from
May 31, 2024

Conversation

mozzius
Copy link
Member

@mozzius mozzius commented May 27, 2024

Screenshot 2024-05-27 at 10 19 27

Emojis are now 1.85 times bigger than whatever the text size was meant to be, rather than a static 26px. This should mostly result in the same size.

In DMs, the multiplier is 3x

Before
Screenshot 2024-05-27 at 10 13 05

After
Screenshot 2024-05-27 at 10 12 53

Test plan

Check it looks ok, including on existing areas that have rich text. Make sure to test it looks ok on Windows, since their emoji can be a bit funny looking

Copy link

render bot commented May 27, 2024

Copy link

github-actions bot commented May 27, 2024

Old size New size Diff
7.39 MB 7.39 MB -4.6 KB (-0.06%)

* origin/main: (51 commits)
  [🐴] Option to share via chat in post dropdown (#4231)
  [🐴] Record message (#4230)
  [🐴] send record via link in text (Record DMs - base PR) (#4227)
  Use new icons on notifications screen (#4299)
  Composer - fix modals, and other tweaks (#4298)
  Shadows (#4265)
  Change many border widths from `1` to `hairlineWidth` (#4294)
  Add follow button to feed item avatar (#3560)
  Disable non-deterministic flaky test (#4295)
  Don't log downsample warning when unnecessary (#4291)
  [Statsig] Sample noisy events (#4288)
  Bump FontAwesome (#4285)
  Fix scrolling for labeler profiles (#4286)
  Reduce Threadgate button size (#4287)
  put dropdown in fullscreenoverlay on iOS (#4284)
  play haptics before closing modal (#4283)
  match loadmore position to fab (#4280)
  Composer - Use sheet presentation on iOS (#4278)
  don't maintain position whenever there are no parents (#4277)
  Fix native translations on iOS 17.5.1 (#4282)
  ...
Copy link
Member

@estrattonbailey estrattonbailey left a comment

Choose a reason for hiding this comment

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

Needs tweaks, my b, sec

Comment on lines +252 to +253
text.length <= 15 &&
/^[\p{Emoji_Presentation}\p{Extended_Pictographic}]+$/u.test(text)
Copy link
Member

Choose a reason for hiding this comment

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

Supports large emojis like 🧑🏻‍❤️‍💋‍🧑🏼 which is 15 and captures a few more emoji like some flags 🇿🇼

Copy link
Member

Choose a reason for hiding this comment

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

If we wanted to do this right we'd count graphemes, but unsure it's worth the perf

Copy link
Member

Choose a reason for hiding this comment

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

Correction: 🧑🏻‍❤️‍💋‍🧑🏼 is not caught by the regex, but I'll leave the limit here anyway since even something like 🐴 is length 2.

Copy link
Collaborator

@gaearon gaearon left a comment

Choose a reason for hiding this comment

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

sure

@gaearon gaearon merged commit b51640f into main May 31, 2024
6 checks passed
@gaearon gaearon deleted the samuel/emoji-multiplier branch May 31, 2024 19:57
estrattonbailey added a commit that referenced this pull request May 31, 2024
* origin/main: (37 commits)
  fix accessibility label in notifications (#4305)
  [🐴] add emoji multiplier prop to RichText and bump it up for DMs (#4229)
  Tweak avi follow button styles (#4304)
  [🐴] Embed backwards compat (#4302)
  [🐴] Add labels to chats (#4293)
  [🐴] Option to share via chat in post dropdown (#4231)
  [🐴] Record message (#4230)
  [🐴] send record via link in text (Record DMs - base PR) (#4227)
  Use new icons on notifications screen (#4299)
  Composer - fix modals, and other tweaks (#4298)
  Shadows (#4265)
  Change many border widths from `1` to `hairlineWidth` (#4294)
  Add follow button to feed item avatar (#3560)
  Disable non-deterministic flaky test (#4295)
  Don't log downsample warning when unnecessary (#4291)
  [Statsig] Sample noisy events (#4288)
  Bump FontAwesome (#4285)
  Fix scrolling for labeler profiles (#4286)
  Reduce Threadgate button size (#4287)
  put dropdown in fullscreenoverlay on iOS (#4284)
  ...
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