You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add: iamcal shortcodes (Discord-style canonical aliases) for emoji search
The keyword-only ranking couldn't tell which heart was THE heart — every
colored variant tied on word match, so source order decided. Discord
solves this by elevating one canonical emoji per shortcode (:heart: → ❤️,
:fire: → 🔥, :pray: → 🙏); the iamcal preset that ships with emojibase-data
is the same data Slack/Discord cribbed from.
build-emoji.mjs now reads node_modules/emojibase-data/en/shortcodes/iamcal.json
and tags each entry with its canonical shortcode. searchEmojis() promotes
exact-shortcode matches to a top tier (-2.0) above the previous CLDR
display-name tier (-1.0), and shortcode-prefix matches (-1.5) sit between
them. The shortcode words are also folded into the keyword bag so partial
search ('heart_h…' → 🫶 heart hands) still resolves.
Sample queries after the change:
heart -> ❤️ 😍 😻 💟 ❤️🔥 🫶
fire -> 🔥 🚒 🧯 ❤️🔥 🧑🚒
pray -> 🙏 🛐 📿 🤲 👏
smile -> 😄 😸 😅 😼 🙂
emojibase-data is a build-time devDependency only (~5 MB); the runtime
ships only the regenerated emoji.js entries with their shortcode fields.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments