damus icon indicating copy to clipboard operation
damus copied to clipboard

Render Custom :shortcode: emoji support NIP-30

Open alltheseas opened this issue 1 year ago • 16 comments

user story

As a Damus and emoji aficionado, I would like to be able to see & share custom emojis, so that I can increase my enjoyment of nostr.

Acceptance criteria

  1. Damus user can read custom shortcode emoji
  2. Damus user can send custom shortcode emoji
  • [ ] #2055
  • [ ] #2056

implementation

Example note with emoji links in tags

https://gist.github.com/mattn/9b43595824750c3794902d77ec9deb71

NIP-30

List of generic shortcode emojis: https://emojibase.dev/shortcodes/?

Origin image

https://damus.io/nevent1qqs0hw2euptpu5k6t6ruyx6wtvvp9czzjeyr0eyj9ltru3p6gl9z8jgpramhxue69uhkummnw3ez6un9d3shjtnwda4k7arpwfhjucm0d5hsz9mhwden5te0wfjkccte9ehx7um5wghxyctwvshszythwden5te0dehhxarj9emkjmn99uqsuamnwvaz7tmev9382tndv5hsvu7lx4

alltheseas avatar Feb 13 '24 03:02 alltheseas

Example link with shortcode:

https://damus.io/nevent1qvzqqqqqqypzq2aj4wlutzft00dg77x4x6pdjy7vnfzxk30pry5lpy6a3l0uks9aqy88wumn8ghj7mn0wvhxcmmv9uq32amnwvaz7tmjv4kxz7fwv3sk6atn9e5k7tcqyp7a3z7nlr4p4eqhyckmpkcql6rses4p23f5rlpcpaptg8upe4a07c50gha

https://njump.me/nevent1qvzqqqqqqypzq2aj4wlutzft00dg77x4x6pdjy7vnfzxk30pry5lpy6a3l0uks9aqy88wumn8ghj7mn0wvhxcmmv9uq32amnwvaz7tmjv4kxz7fwv3sk6atn9e5k7tcqyp7a3z7nlr4p4eqhyckmpkcql6rses4p23f5rlpcpaptg8upe4a07c50gha

alltheseas avatar Feb 13 '24 03:02 alltheseas

Clients that support

Nostter noStrudel Amethyst Rabbit (I am not sure to whether it's only reactions or kind1 also)

alltheseas avatar Feb 13 '24 04:02 alltheseas

njump will fix by https://github.com/fiatjaf/njump/pull/42

mattn avatar Feb 13 '24 06:02 mattn

open question

How are inline emojis displayed in notecrumbs (e.g. in telegram or other places where damus.io/neventlinks are shared)?

alltheseas avatar Feb 13 '24 15:02 alltheseas

I'm working on this

kernelkind avatar Mar 13 '24 14:03 kernelkind

Do you think you can fit this in for current sprint @kernelkind ?

alltheseas avatar Mar 13 '24 15:03 alltheseas

I believe I can do rendering this sprint

kernelkind avatar Mar 13 '24 16:03 kernelkind

Can we break this issue up into multiple? I recommend the following issues:

  • rendering custom emojis
  • Ability to add custom emojis from local cache/db to new post
  • uploading new custom emojis

kernelkind avatar Mar 14 '24 21:03 kernelkind

Can we break this issue up into multiple? I recommend the following issues:

  • rendering custom emojis
  • Ability to add custom emojis from local cache/db to new post
  • uploading new custom emojis

Yes, great suggestion

#2055 #2056

alltheseas avatar Mar 14 '24 21:03 alltheseas

On Thu, Mar 14, 2024 at 02:20:29PM -0700, kernelkind wrote:

Can we break this issue up into multiple? I recommend the following issues:

  • rendering custom emojis
  • Ability to add custom emojis from local cache/db to new post
  • uploading new custom emojis

yes, makes sense!

jb55 avatar Mar 16 '24 08:03 jb55

@jb55 has performance worries about this. Can @kernelkind @danieldaquino help test performance impacts of this feature add?

alltheseas avatar Apr 08 '24 16:04 alltheseas

  1. manual test first,
  2. go to profiler ("xcode instruments"). SwiftUI profiler is good. Shares info about SwiftUI views (e.g. if views getting invalidated too quickly). Can help test network bandwidth.

Should collect network stats on individual components. Will suspects images. Some people suspect relay queries.

alltheseas avatar Apr 08 '24 16:04 alltheseas

related

measure and attribute data https://github.com/damus-io/damus/issues/1838

alltheseas avatar Apr 08 '24 16:04 alltheseas

NostrSDK supports NIP-30 https://github.com/nostr-sdk/nostr-sdk-ios?tab=readme-ov-file

cc @tyiu @joelklabo @bryanmontz

alltheseas avatar Apr 16 '24 15:04 alltheseas

there's a lot involved to implement this well:

  • rendering custom emojis (@kernelkind has a patch for this)
  • collecting seen custom emojis into a local collection for later use
  • updating our emoji picker to display all collected custom emojis
  • exploring custom emoji sets

I can start putting together a tracking issue for this

jb55 avatar May 10 '24 17:05 jb55

I will use this as the tracking issue

jb55 avatar May 10 '24 17:05 jb55