Add emoji picker, reactions user_id & UI tweaks
Introduce client-side emoji picker and richer reaction UX, and propagate user IDs for reactions over the WS protocol. Backend: include user_id in reaction events. Frontend: add EmojiPicker component; update useChatSocket types to include user_id; handle "reaction" events in ChatRoomPage to update cached messages (add/remove/switch reactions). Message component: UI overhaul — action menu with slide-out actions, toggle button (⋮→✕), emoji picker trigger, grouped reaction buttons that show counts and indicate "mine" state, and various layout/cleanups. Media: defer video loading by setting preload="none" in ChatMediaGallery, MediaGallery and PostComposer to improve performance.
This commit is contained in:
@@ -84,7 +84,8 @@ class ChatConsumer(AsyncWebsocketConsumer):
|
||||
"message_id": data["message_id"],
|
||||
"emoji": data["emoji"],
|
||||
"user": user.username,
|
||||
"action": action, # 'added' | 'removed' | 'switched'
|
||||
"user_id": user.id,
|
||||
"action": action,
|
||||
})
|
||||
|
||||
elif msg_type == "typing":
|
||||
@@ -158,6 +159,7 @@ class ChatConsumer(AsyncWebsocketConsumer):
|
||||
"message_id": event["message_id"],
|
||||
"emoji": event["emoji"],
|
||||
"user": event["user"],
|
||||
"user_id": event["user_id"],
|
||||
"action": event["action"],
|
||||
}))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user