From c0a739c9f216ee1ca7b922d16322f5e077ea9682 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 15 Jan 2026 18:33:51 +0000 Subject: [PATCH] Fix emoji picker UI issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove quick reaction bar (❤️ 👍 🔥 etc.) - Fix custom emoji in "Recently used" section - now renders images instead of shortcodes - Increase grid spacing from gap-2 to gap-3 to reduce crowding - Add helpers to properly lookup and render custom emoji from service --- src/components/chat/EmojiPickerDialog.tsx | 63 ++++++++++++++--------- 1 file changed, 40 insertions(+), 23 deletions(-) diff --git a/src/components/chat/EmojiPickerDialog.tsx b/src/components/chat/EmojiPickerDialog.tsx index f193b24..149ab60 100644 --- a/src/components/chat/EmojiPickerDialog.tsx +++ b/src/components/chat/EmojiPickerDialog.tsx @@ -16,7 +16,6 @@ interface EmojiPickerDialogProps { // Frequently used emojis stored in localStorage const STORAGE_KEY = "grimoire:reaction-history"; -const QUICK_REACTIONS = ["❤️", "👍", "🔥", "😂", "🎉", "👀", "🤔", "💯"]; function getReactionHistory(): Record { try { @@ -109,29 +108,47 @@ export function EmojiPickerDialog({ setSearchQuery(""); // Reset search on close }; - const handleQuickReaction = (emoji: string) => { - onEmojiSelect(emoji); - updateReactionHistory(emoji); + // Helper to render a frequently used emoji (handles both unicode and custom) + const renderFrequentEmoji = (emojiStr: string) => { + // Check if it's a custom emoji shortcode (e.g., ":yesno:") + if (emojiStr.startsWith(":") && emojiStr.endsWith(":")) { + const shortcode = emojiStr.slice(1, -1); + // Look up the emoji in the service + const customEmoji = service.getByShortcode(shortcode); + if (customEmoji && customEmoji.url) { + return {emojiStr}; + } + // Fallback to text if not found + return {emojiStr}; + } + // Unicode emoji - render as text + return {emojiStr}; + }; + + const handleFrequentEmojiClick = (emojiStr: string) => { + // Check if it's a custom emoji shortcode + if (emojiStr.startsWith(":") && emojiStr.endsWith(":")) { + const shortcode = emojiStr.slice(1, -1); + const customEmoji = service.getByShortcode(shortcode); + if (customEmoji && customEmoji.url) { + onEmojiSelect(emojiStr, { + shortcode: shortcode, + url: customEmoji.url, + }); + } else { + // Fallback to treating as unicode + onEmojiSelect(emojiStr); + } + } else { + // Unicode emoji + onEmojiSelect(emojiStr); + } onOpenChange(false); }; return ( - {/* Quick reaction bar */} -
- {QUICK_REACTIONS.map((emoji) => ( - - ))} -
- {/* Search input */}
@@ -151,15 +168,15 @@ export function EmojiPickerDialog({
Recently used
-
+
{frequentlyUsed.map((emoji) => ( ))}
@@ -169,7 +186,7 @@ export function EmojiPickerDialog({ {/* Emoji grid */}
{searchResults.length > 0 ? ( -
+
{searchResults.map((result) => (