open-sauced / hot

πŸ•The site that recommends the hottest projects on GitHub.
https://hot.opensauced.pizza
MIT License
418 stars 145 forks source link

feat: allow :emoji: in repository list descriptions #449

Closed JoshuaKGoldberg closed 1 year ago

JoshuaKGoldberg commented 1 year ago

What type of PR is this? (check all applicable)

Description

Uses node-emoji to "emojify" repository descriptions. Strings like "a :fire: :pizza: !" get emojis converted to outputs like " a πŸ”₯ πŸ• !".

Related Tickets & Documents

Fixes #370

Mobile & Desktop Screenshots/Recordings

The hero search shows two examples when searching for ossu:

Screenshot of hero search with two repos for ossue, both with starting colon emoji names replaced by actual emojis

For older repos below, I added olderData[0].description = ':tada: ' + olderData[0].description in RecentRepoListWrap.tsx's useEffect:

Screenshot of 'Older' repository list showing the πŸŽ‰ emoji at the start of a first entry's description

Added tests?

Added to documentation?

[optional] Are there any post-deployment tasks we need to perform?

[optional] What gif best describes this PR or how it makes you feel?

Donkey from Shrek smiling at the camera charmingly

netlify[bot] commented 1 year ago

Deploy Preview for hot-sauced-ui ready!

Name Link
Latest commit fc37ee20f737f698a684af84201fadbd00f7e759
Latest deploy log https://app.netlify.com/sites/hot-sauced-ui/deploys/63f6a173abfd52000819669e
Deploy Preview https://deploy-preview-449--hot-sauced-ui.netlify.app/
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

takanome-dev commented 1 year ago

Looks great :pizza:

Did you test it for the search results as well? Here is what I got from the deploy preview

emojify

0-vortex commented 1 year ago

Hey, thanks for opening the PR. Have a couple of questions/concerns before reviewing (big πŸ‘)

  1. @TAKANOME-DEV the effort of hooking the emoji translator into every frontend bit of code seems pointless, it would be best to implement the description translator in the client hook to have it available everywhere
  2. @JoshuaKGoldberg have some maintenance concerns about node-emoji, but the biggest blocker is that it doesn't look like it's doing purely GFM emojis, curious what your thoughts are on using a GFM only emoji translator like node-github-emoji
JoshuaKGoldberg commented 1 year ago

best to implement the description translator in the client hook

Oh, is that something you'd like me to do in this PR?

doesn't look like it's doing purely GFM emojis

Sorry, I'm not following - is it that you want to make sure it does nonstandard GitHub emojis such as :shipit: :shipit: too?

0-vortex commented 1 year ago

Oh, is that something you'd like me to do in this PR?

If you are willing to edit the description in multiple places (like the search dropdown) then it would require more effort - my suggestion was to limit that effort for this PR, somehow

doesn't look like it's doing purely GFM emojis

Sorry, I'm not following - is it that you want to make sure it does nonstandard GitHub emojis such as :shipit: :shipit: too?

Just wanted to make sure it has parity with GitHub readmes, from a first time viewers' perspective, node-emoji looks like it's doing more than just GFM πŸ˜…

JoshuaKGoldberg commented 1 year ago

the search dropdown

D'oh! I had been looking at the wrong place 🀦 just pushed fc37ee2 to apply to the searched repo card too.

limit that effort for this PR

Yeah, that's a good question. In theory the backend could normalize PR descriptions to have actual emojis rather than :name:s. But then they'd be different from the repos themselves. Not sure.

At any rate, the two codepaths that end up in this repo's emojify(description)s don't seem the same to me. But if you see a way to deduplicate I'd love that! πŸ˜„

node-emoji

Yeah I haven't found a library that works better. node-emoji seems to be in-and-out of maintenance and I never ended up pushing https://github.com/omnidan/node-emoji/pull/113 through. Definitely open to suggestions here!

github-actions[bot] commented 1 year ago

:tada: This PR is included in version 2.31.0-beta.10 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] commented 1 year ago

:tada: This PR is included in version 2.31.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: