From d8b4e425bf019c593abdcb7693a04e4780b18f06 Mon Sep 17 00:00:00 2001 From: Thomas Hallock Date: Mon, 29 Sep 2025 18:56:40 -0500 Subject: [PATCH] feat: enhance emoji picker with super powered magnifying glass and hide empty categories MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Improve emoji selection UX by making hover preview more dramatic and removing empty category tabs. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../games/matching/components/EmojiPicker.tsx | 144 ++++++++++++++---- 1 file changed, 115 insertions(+), 29 deletions(-) diff --git a/apps/web/src/app/games/matching/components/EmojiPicker.tsx b/apps/web/src/app/games/matching/components/EmojiPicker.tsx index 7038c882..8b452084 100644 --- a/apps/web/src/app/games/matching/components/EmojiPicker.tsx +++ b/apps/web/src/app/games/matching/components/EmojiPicker.tsx @@ -93,6 +93,20 @@ export function EmojiPicker({ currentEmoji, onEmojiSelect, onClose, playerNumber const isSearching = searchFilter.trim().length > 0 const isCategoryFiltered = selectedCategory !== null && !isSearching + // Calculate which categories have emojis + const availableCategories = useMemo(() => { + const categoryCounts: Record = {} + PLAYER_EMOJIS.forEach(emoji => { + const data = emojiMap.get(emoji) + if (data && data.group !== undefined) { + categoryCounts[data.group] = (categoryCounts[data.group] || 0) + 1 + } + }) + return Object.keys(EMOJI_GROUPS) + .map(Number) + .filter(groupId => categoryCounts[groupId] > 0) + }, []) + const displayEmojis = useMemo(() => { // Start with all emojis let emojis = PLAYER_EMOJIS @@ -319,7 +333,9 @@ export function EmojiPicker({ currentEmoji, onEmojiSelect, onClose, playerNumber > ✨ All - {Object.entries(EMOJI_GROUPS).map(([groupId, group]) => ( + {availableCategories.map((groupId) => { + const group = EMOJI_GROUPS[groupId as keyof typeof EMOJI_GROUPS] + return ( - ))} + ) + })} )} @@ -559,55 +576,96 @@ export function EmojiPicker({ currentEmoji, onEmojiSelect, onClose, playerNumber - {/* Magnifying Glass Preview */} + {/* Magnifying Glass Preview - SUPER POWERED! */} {hoveredEmoji && (
-
- {hoveredEmoji} -
- {/* Arrow pointing down */} + {/* Outer glow ring */}
+ + {/* Main preview card */} +
+ {/* Sparkle effects */} +
✨
+
✨
+
✨
+ + {hoveredEmoji} +
+ + {/* Arrow pointing down with glow */} +
)} - {/* Add magnifying animation */} + {/* Add magnifying animations */}