Millorar selecció d'emojis

Problema

Hola, des de l’inici del node (no sé si passava el mateix amb Barcelona.Social ), que he trobat molt incòmoda la selecció d’emojis. Us importi més o menys, segur que us hi heu trobat:

imatge

Tenen un ordre força aleatori, no es poden triar tons de pell, i em sembla que n’hi falten.
Pel que sembla, estan ordenats “alfabèticament”, segons un nom o descripció en anglès. Però sort recordant o endevinant-los.

Això crec que s’arreglaria agrupant emojis.
L’altra solució podria ser reordenar l’arxiu emoji.json

L’arxiu font és aquest akkoma-fe/static/emoji.json at develop - AkkomaGang/akkoma-fe - Akkoma Development , que comença així:

{
	  "100": "💯",
	  "1234": "🔢",
	  "1st_place_medal": "🥇",
	  "2nd_place_medal": "🥈",
	  "3rd_place_medal": "🥉",
	  "8ball": "🎱",
	  ...

Documentació relacionada però sobre emojis personalitzats

Sembla que també hi ha una configuració per defecte a config.exs, que es pot sobreescriure a prod.config.exs akkoma/config/config.exs at develop - AkkomaGang/akkoma - Akkoma Development

config :pleroma, :emoji,
  shortcode_globs: ["/emoji/custom/**/*.png"],
  pack_extensions: [".png", ".gif"],
  groups: [
    Custom: ["/emoji/*.png", "/emoji/**/*.png"]
  ],
  default_manifest: "https://git.pleroma.social/pleroma/emoji-index/raw/master/index.json",
  shared_pack_cache_seconds_per_file: 60

Això està referenciat a docs / custom emoji.

Sembla que les opcions d’administració d’emojis personalitzats estan disponibles tant a través de la admin-fe com des de la CLI. Per fer-ho per consola: akkoma/docs/docs/administration/CLI_tasks/emoji.md at develop - AkkomaGang/akkoma - Akkoma Development

Què fa l’altra gent?

A mi em resulta molt molest i em sorprèn que tan poca gent se’n queixi. Serà pq no té tantis usuàriïs o que tothom fa servir el mòbil?? O que no posen tants emojis? O que els tenen al teclat? jo què sé:

Alguns recursos que poden ser útils

Bueno… veient que pintava malament, he fet una versió del emojis.json ordenada segons unicode. Potser canvia algun nom en anglès. No he pensat com afegir-li els noms en català encara. Molt hacky tot.

Si alguni admin vol provar de substituir l’arxiu del frontend static/emoji.json, per aquest que adjunto a dins del targz, ho agraeixo!

Dins el comprimit hi ha també l’script documentat de com he generat el json ordenat. Molt lleig tot. El copio a sota amb spoiler per si ho preferiu que no el comprimit.

Si funciona, ho podem compartir amb més gent.

Comença així el nou json:

{
  "tone1": "🏻",
  "tone2": "🏼",
  "tone3": "🏽",
  "tone4": "🏾",
  "tone5": "🏿",
  "grinning_face": "😀",
  "grinning_face_with_big_eyes": "😃",
  "grinning_face_with_smiling_eyes": "😄",
  "beaming_face_with_smiling_eyes": "😁",
  "grinning_squinting_face": "😆",
  "grinning_face_with_sweat": "😅",
  "rolling_on_the_floor_laughing": "🤣",
  "face_with_tears_of_joy": "😂",
  "slightly_smiling_face": "🙂",
  "upside-down_face": "🙃",
  "melting_face": "🫠",
  "winking_face": "😉",
...

emojis-akkoma.tgz.pdf (111.6 KB)

akkoma-emojilist-builder.sh
#!/bin/bash

## AKKOMA ORDERED EMOJI.JSON GENERATOR ##

# Generate a valid emoji.json for akkoma using an official unicode ordering file
# Input file for Unicode 16.0
# https://www.unicode.org/emoji/charts-16.0/emoji-ordering.txt

# Sample execution:
# curl 'https://www.unicode.org/emoji/charts-16.0/emoji-ordering.txt' | ./akkoma-emojilist-builder.sh | tee emoji.json | less

# Author: fadelkon
# Date: 2025-02-08

################

# Unicode source file comes with few header comment lines
HEADER_RULE='^# '
# Skin tone modifiers
SKIN_TONES_RULES='U+1F3FB\|U+1F3FC\|U+1F3FD\|U+1F3FE\|U+1F3FF'
# Two diferent gender modifiers. Some use "woman", some use "woman symbol"
GENDER_RULES='U+2640 U+FE0F\|U+2642 U+FE0F\|U+1F469 U+200D\|U+1F468 U+200D'

# Apply the previous filters to the input unicode text
FILTERED=$(grep -v "$HEADER_RULE\|$SKIN_TONES_RULES\|$GENDER_RULES")

# No final , to ease the json bulding
PREFIX='{
  "tone1": "🏻",
  "tone2": "🏼",
  "tone3": "🏽",
  "tone4": "🏾",
  "tone5": "🏿"
'

parse(){
    echo -n "$PREFIX"
    # Sample input line:
    # U+1F312 ; 1.0 # 🌒 waxing crescent moon
    # sed: Ignore everything until '# ', then split by space,
    #       swap order and quote, prefixing by a coma
    #       to generate valid json lines, regardless of linebreak
    # tr: then substitute spaces ' ' in keys by underscores '_'
    sed -r 's/.+# ([^ ]+) (.+)/,"\2":"\1"/' | tr ' ' '_'
    printf '}'
}

# Parse the filtered input and validate and format it with jq
echo "$FILTERED" | parse | jq .

1 'M'agrada'