feat(feedback): emoji reactions on photos (#839) (#855)

* feat(feedback): emoji reactions on photos (#839)

Per-photo emoji reactions from a fixed curated set (❤️ 😂 😍 👏 🎉),
one reaction per guest per photo — same emoji toggles off, another
switches in place. Stored as feedback_type='reaction' rows with per-guest
scoping identical to likes (guest_id when present, device hash otherwise).

- migration 164: allow_reactions toggle (default on, still gated by the
  opt-in feedback_enabled master switch), photo_feedback.reaction value
  column, denormalized photos.reaction_count
- emoji whitelist enforced in the route validator AND the service
  (shared constants/reactions.js, mirrored in the frontend)
- per-emoji tallies + my_feedback.reaction in the photo feedback
  endpoint; hidden-by-moderator reactions leave all counts
- reactions ride the existing rate limiting (like-tier), guest identity
  modes, and moderation actions; long + pivot exports carry the emoji
- gallery: reaction bar in the photo feedback panel (grid lightbox);
  admin: allow_reactions toggle next to likes, analytics tile,
  create/duplicate event paths
- i18n for all 8 locales; 9 service-level tests

* fix(feedback): reach reactions without comments; numeric analytics totals (#839)

- the lightbox feedback-panel toggle was gated on allow_comments only —
  with comments off the new reaction bar was unreachable; the gate now
  opens for comments OR reactions
- the analytics summary now coerces Postgres string counts to numbers:
  total_feedback concatenated instead of adding ("00006")

* fix(feedback): harden reactions from review round 1 (#839)

- per-emoji tallies are gated on show_feedback_to_guests — with sharing
  off a guest sees only their own selection, no aggregate counts
- reaction toggle/switch operate on the guest-scoped row SET, so rows
  duplicated by the (like-parity) check-then-insert race collapse on the
  next interaction instead of counting twice
- rate-limit defaults merge UNDER the persisted settings object —
  stored rows predating the reaction key otherwise dropped it to the
  generic 100/h fallback
- optimistic revert uses the pre-mutation value via mutation context;
  the onError closure sees the post-optimistic render, so the old
  revert froze the wrong state on failed toggles

* fix(feedback): review round 2 — hide reaction_count with sharing off, admin list shows emoji (#839)

- summary.reaction_count is gated on show_feedback_to_guests like the
  per-emoji map, keeping the "no aggregates while sharing is off"
  promise consistent
- the admin feedback list renders the reaction emoji on reaction rows
  and the type filter gains a Reactions option (7 locales; es has no
  types block and falls back to EN defaults)

* fix(feedback): register reaction activity types with translated labels (#839)

photo_reaction / guest_feedback_reaction are logged by the submission
paths but were absent from the frontend activity-type union and the
admin.activities label maps — the recent-activity feed would have shown
the raw identifiers. All 8 locales.

* feat(feedback): reactions in guest CRM and the premium gallery layout (#839)

- guest CRM: per-guest reaction counts in the list aggregation and a
  Reacted tab (photo grid with emoji badges) + stats card in the guest
  detail modal; picks/aggregate/exports stay selection-only by design
- premium layout: its own yet-another-react-lightbox now gets a fixed
  reaction-bar overlay (per-photo fetch, optimistic switch) — reactions
  were otherwise unreachable in this layout since it bypasses the
  shared PhotoLightbox
- allowReactions threaded through the layout feedbackOptions; guest
  i18n keys for the 7 locales that carry the guests block

* fix(feedback): portal the premium reaction bar to document.body (#839)

Inside the layout tree an ancestor stacking context (framer-motion
transforms) painted the bar under yarl's body-level portal — visible
but unclickable, every tap landed on the slide image. As a direct body
child the z-index 10000 genuinely wins over yarl's 9999. Verified by
clicking through in the running app.

---------

Co-authored-by: Paul Nothaft <[email protected]>
This commit is contained in:
Paul Nothaft
2026-07-22 20:59:43 +02:00
committed by GitHub
co-authored by Paul Nothaft
parent f8a95d29d2
commit 3d6c9848dc
36 changed files with 885 additions and 54 deletions
+14 -1
View File
@@ -2728,6 +2728,7 @@
"favorites": "Favoriten",
"comments": "Kommentare",
"ratings": "Bewertungen",
"reactions": "Reaktionen",
"lastSeen": "Zuletzt gesehen"
},
"view": "Details anzeigen",
@@ -2741,6 +2742,7 @@
"liked": "Gemocht",
"favorited": "Favorisiert",
"rated": "Bewertet",
"reacted": "Reagiert",
"commented": "Kommentiert"
},
"inviteStatus": {
@@ -2796,7 +2798,9 @@
"event_renamed": "Ereignis umbenannt: {{eventName}}",
"photo_rating": "Foto bewertet in {{eventName}}",
"photo_comment": "Foto kommentiert in {{eventName}}",
"photo_reaction": "Foto-Reaktion in {{eventName}}",
"guest_feedback_like": "Gast hat ein Foto geliked in {{eventName}}",
"guest_feedback_reaction": "Gast hat auf ein Foto in {{eventName}} reagiert",
"guest_feedback_favorite": "Gast hat ein Foto als Favorit markiert in {{eventName}}",
"guest_feedback_rating": "Gast hat ein Foto bewertet in {{eventName}}",
"guest_feedback_comment": "Gast hat ein Foto kommentiert in {{eventName}}",
@@ -3337,6 +3341,12 @@
"patternDescription": "Passwörter werden mit Ihrem Veranstaltungsnamen und -datum generiert. Beispiel: \"Location2024$August\" für bessere Sicherheit und Merkbarkeit."
},
"feedback": {
"reaction": "Reaktion",
"reactions": "Reaktionen",
"reactWith": "Mit {{emoji}} reagieren",
"removeReaction": "{{emoji}}-Reaktion entfernen",
"reactionError": "Reaktion konnte nicht aktualisiert werden",
"totalReactions": "Reaktionen gesamt",
"comments": "Kommentare",
"addComment": "Kommentar hinzufügen",
"yourName": "Ihr Name",
@@ -3365,6 +3375,8 @@
"comments": "Kommentare",
"commentsDesc": "Textkommentare auf Fotos",
"favorites": "Favoriten",
"reactions": "Emoji-Reaktionen",
"reactionsDesc": "Ein Emoji pro Gast und Foto (❤️ 😂 😍 👏 🎉)",
"favoritesDesc": "Fotos als Favoriten markieren",
"perGuestLimits": "Limits pro Gast",
"perGuestLimitsDesc": "Begrenzen, wie viele Fotos jeder Gast favorisieren oder liken kann — praktisch für „Wählen Sie Ihre Top-N fürs Album“-Abläufe. 0 = unbegrenzt. Eine Senkung unter den aktuellen Stand eines Gasts lässt vorhandene Einträge bestehen; nur neue Hinzufügungen werden blockiert, bis er welche entfernt.",
@@ -3409,7 +3421,8 @@
"rating": "Bewertungen",
"like": "Likes",
"comment": "Kommentare",
"favorite": "Favoriten"
"favorite": "Favoriten",
"reaction": "Reaktionen"
},
"allStatuses": "Alle Status",
"status": {
+14 -1
View File
@@ -2306,6 +2306,7 @@
"favorites": "Favorites",
"comments": "Comments",
"ratings": "Ratings",
"reactions": "Reactions",
"lastSeen": "Last seen"
},
"view": "View details",
@@ -2319,6 +2320,7 @@
"liked": "Liked",
"favorited": "Favorited",
"rated": "Rated",
"reacted": "Reacted",
"commented": "Commented"
},
"inviteStatus": {
@@ -2351,7 +2353,9 @@
"photo_favorite": "Photo favorited in {{eventName}}",
"photo_rating": "Photo rated in {{eventName}}",
"photo_comment": "Photo commented in {{eventName}}",
"photo_reaction": "Photo reaction in {{eventName}}",
"guest_feedback_like": "Guest liked a photo in {{eventName}}",
"guest_feedback_reaction": "Guest reacted to a photo in {{eventName}}",
"guest_feedback_favorite": "Guest favorited a photo in {{eventName}}",
"guest_feedback_rating": "Guest rated a photo in {{eventName}}",
"guest_feedback_comment": "Guest commented on a photo in {{eventName}}",
@@ -3358,6 +3362,12 @@
"patternDescription": "Passwords are generated using your event name and date. Example: \"Venue2024$August\" for better security and memorability."
},
"feedback": {
"reaction": "reaction",
"reactions": "Reactions",
"reactWith": "React with {{emoji}}",
"removeReaction": "Remove {{emoji}} reaction",
"reactionError": "Failed to update reaction",
"totalReactions": "Total Reactions",
"comments": "Comments",
"addComment": "Add Comment",
"yourName": "Your name",
@@ -3386,6 +3396,8 @@
"comments": "Comments",
"commentsDesc": "Text comments on photos",
"favorites": "Favorites",
"reactions": "Emoji Reactions",
"reactionsDesc": "One emoji per guest per photo (❤️ 😂 😍 👏 🎉)",
"favoritesDesc": "Mark photos as favorites",
"perGuestLimits": "Per-guest limits",
"perGuestLimitsDesc": "Cap how many photos each guest can favorite or like — useful for \"pick your top N for the album\" workflows. Leave at 0 for no limit. Lowering a cap below an existing guest's count keeps their existing rows; only new adds are blocked until they remove some.",
@@ -3430,7 +3442,8 @@
"rating": "Ratings",
"like": "Likes",
"comment": "Comments",
"favorite": "Favorites"
"favorite": "Favorites",
"reaction": "Reactions"
},
"allStatuses": "All Statuses",
"status": {
+10
View File
@@ -1492,7 +1492,9 @@
"photo_favorite": "Foto añadida a favoritos en {{eventName}}",
"photo_rating": "Foto valorada en {{eventName}}",
"photo_comment": "Comentario en foto en {{eventName}}",
"photo_reaction": "Reacción a una foto en {{eventName}}",
"guest_feedback_like": "Invitado marcó me gusta en {{eventName}}",
"guest_feedback_reaction": "Invitado reaccionó a una foto en {{eventName}}",
"guest_feedback_favorite": "Invitado añadió a favoritos en {{eventName}}",
"guest_feedback_rating": "Invitado valoró una foto en {{eventName}}",
"guest_feedback_comment": "Invitado comentó en una foto en {{eventName}}",
@@ -2348,6 +2350,12 @@
"patternDescription": "Las contraseñas se generan usando el nombre y la fecha del evento. Ejemplo: \"Venue2024$August\" para mayor seguridad y memorización."
},
"feedback": {
"reaction": "reacción",
"reactions": "Reacciones",
"reactWith": "Reaccionar con {{emoji}}",
"removeReaction": "Quitar la reacción {{emoji}}",
"reactionError": "No se pudo actualizar la reacción",
"totalReactions": "Reacciones totales",
"comments": "Comentarios",
"addComment": "Añadir comentario",
"yourName": "Tu nombre",
@@ -2387,6 +2395,8 @@
"comments": "Comentarios",
"commentsDesc": "Comentarios de texto en fotos",
"favorites": "Favoritos",
"reactions": "Reacciones con emojis",
"reactionsDesc": "Un emoji por invitado y foto (❤️ 😂 😍 👏 🎉)",
"favoritesDesc": "Marcar fotos como favoritas",
"identityMode": "Modo de identidad",
"identityModeSimple": "Feedback simple",
+14 -1
View File
@@ -1699,6 +1699,7 @@
"favorites": "Favoris",
"comments": "Commentaires",
"ratings": "Notes",
"reactions": "Réactions",
"lastSeen": "Dernière visite"
},
"view": "Voir les détails",
@@ -1712,6 +1713,7 @@
"liked": "Aimés",
"favorited": "Favoris",
"rated": "Notés",
"reacted": "A réagi",
"commented": "Commentés"
},
"inviteStatus": {
@@ -1744,7 +1746,9 @@
"photo_favorite": "Photo marquée comme favori dans {{eventName}}",
"photo_rating": "Photo notée dans {{eventName}}",
"photo_comment": "Commentaire ajouté sur une photo dans {{eventName}}",
"photo_reaction": "Réaction à une photo dans {{eventName}}",
"guest_feedback_like": "Un invité a aimé une photo dans {{eventName}}",
"guest_feedback_reaction": "Un invité a réagi à une photo dans {{eventName}}",
"guest_feedback_favorite": "Un invité a marqué une photo comme favori dans {{eventName}}",
"guest_feedback_rating": "Un invité a noté une photo dans {{eventName}}",
"guest_feedback_comment": "Un invité a commenté une photo dans {{eventName}}",
@@ -2496,6 +2500,12 @@
"patternDescription": "Les mots de passe sont générés à partir du nom de votre événement et de la date. Exemple : \"Lieu2024$Août\" pour une meilleure sécurité et mémorisation."
},
"feedback": {
"reaction": "réaction",
"reactions": "Réactions",
"reactWith": "Réagir avec {{emoji}}",
"removeReaction": "Retirer la réaction {{emoji}}",
"reactionError": "Impossible de mettre à jour la réaction",
"totalReactions": "Total des réactions",
"comments": "Commentaires",
"addComment": "Ajouter un commentaire",
"yourName": "Votre nom",
@@ -2524,6 +2534,8 @@
"comments": "Commentaires",
"commentsDesc": "Commentaires textuels sur les photos",
"favorites": "Favoris",
"reactions": "Réactions emoji",
"reactionsDesc": "Un emoji par invité et par photo (❤️ 😂 😍 👏 🎉)",
"favoritesDesc": "Marquer les photos comme favoris",
"identityMode": "Mode d'identité",
"identityModeSimple": "Commentaires simples",
@@ -2562,7 +2574,8 @@
"rating": "Notes",
"like": "J'aimes",
"comment": "Commentaires",
"favorite": "Favoris"
"favorite": "Favoris",
"reaction": "Réactions"
},
"allStatuses": "Tous statuts",
"status": {
+14 -1
View File
@@ -1688,6 +1688,7 @@
"favorites": "Favorieten",
"comments": "Opmerkingen",
"ratings": "Beoordelingen",
"reactions": "Reacties",
"lastSeen": "Laatste bezoek"
},
"view": "Details bekijken",
@@ -1701,6 +1702,7 @@
"liked": "Geliked",
"favorited": "Favoriet",
"rated": "Beoordeeld",
"reacted": "Gereageerd",
"commented": "Becommentarieerd"
},
"inviteStatus": {
@@ -1756,7 +1758,9 @@
"event_renamed": "Evenement hernoemd: {{eventName}}",
"photo_rating": "Foto beoordeeld in {{eventName}}",
"photo_comment": "Foto becommentarieerd in {{eventName}}",
"photo_reaction": "Fotoreactie in {{eventName}}",
"guest_feedback_like": "Gast heeft een foto geliked in {{eventName}}",
"guest_feedback_reaction": "Gast reageerde op een foto in {{eventName}}",
"guest_feedback_favorite": "Gast heeft een foto als favoriet gemarkeerd in {{eventName}}",
"guest_feedback_rating": "Gast heeft een foto beoordeeld in {{eventName}}",
"guest_feedback_comment": "Gast heeft een opmerking geplaatst op een foto in {{eventName}}",
@@ -2485,6 +2489,12 @@
"patternDescription": "Wachtwoorden worden gegenereerd met uw evenementnaam en datum. Voorbeeld: \"Locatie2024$Augustus\" voor betere beveiliging en herkenbaarheid."
},
"feedback": {
"reaction": "reactie",
"reactions": "Reacties",
"reactWith": "Reageer met {{emoji}}",
"removeReaction": "{{emoji}}-reactie verwijderen",
"reactionError": "Reactie kon niet worden bijgewerkt",
"totalReactions": "Totaal reacties",
"comments": "Opmerkingen",
"addComment": "Opmerking toevoegen",
"yourName": "Uw naam",
@@ -2513,6 +2523,8 @@
"comments": "Opmerkingen",
"commentsDesc": "Tekstopmerkingen bij foto's",
"favorites": "Favorieten",
"reactions": "Emoji-reacties",
"reactionsDesc": "Eén emoji per gast per foto (❤️ 😂 😍 👏 🎉)",
"favoritesDesc": "Foto's als favoriet markeren",
"identityMode": "Identiteitsmodus",
"identityModeSimple": "Eenvoudige feedback",
@@ -2551,7 +2563,8 @@
"rating": "Beoordelingen",
"like": "Likes",
"comment": "Opmerkingen",
"favorite": "Favorieten"
"favorite": "Favorieten",
"reaction": "Reacties"
},
"allStatuses": "Alle statussen",
"status": {
+14 -1
View File
@@ -1713,6 +1713,7 @@
"favorites": "Favoritos",
"comments": "Comentários",
"ratings": "Avaliações",
"reactions": "Reações",
"lastSeen": "Última visita"
},
"view": "Ver detalhes",
@@ -1726,6 +1727,7 @@
"liked": "Gostou",
"favorited": "Favorito",
"rated": "Avaliado",
"reacted": "Reagiu",
"commented": "Comentado"
},
"inviteStatus": {
@@ -1781,7 +1783,9 @@
"event_renamed": "Evento renomeado: {{eventName}}",
"photo_rating": "Foto avaliada em {{eventName}}",
"photo_comment": "Foto comentada em {{eventName}}",
"photo_reaction": "Reação a uma foto em {{eventName}}",
"guest_feedback_like": "Convidado curtiu uma foto em {{eventName}}",
"guest_feedback_reaction": "Convidado reagiu a uma foto em {{eventName}}",
"guest_feedback_favorite": "Convidado adicionou uma foto aos favoritos em {{eventName}}",
"guest_feedback_rating": "Convidado avaliou uma foto em {{eventName}}",
"guest_feedback_comment": "Convidado comentou uma foto em {{eventName}}",
@@ -2510,6 +2514,12 @@
"patternDescription": "As senhas são geradas usando o nome e data do evento. Ex: \"Evento2024$Agosto\" para melhor memorização."
},
"feedback": {
"reaction": "reação",
"reactions": "Reações",
"reactWith": "Reagir com {{emoji}}",
"removeReaction": "Remover a reação {{emoji}}",
"reactionError": "Não foi possível atualizar a reação",
"totalReactions": "Total de reações",
"comments": "Comentários",
"addComment": "Adicionar Comentário",
"yourName": "Seu nome",
@@ -2538,6 +2548,8 @@
"comments": "Comentários",
"commentsDesc": "Comentários em texto nas fotos",
"favorites": "Favoritos",
"reactions": "Reações com emojis",
"reactionsDesc": "Um emoji por convidado por foto (❤️ 😂 😍 👏 🎉)",
"favoritesDesc": "Marcar fotos como favoritas",
"identityMode": "Modo de identidade",
"identityModeSimple": "Feedback simples",
@@ -2576,7 +2588,8 @@
"rating": "Avaliações",
"like": "Gostos",
"comment": "Comentários",
"favorite": "Favoritos"
"favorite": "Favoritos",
"reaction": "Reações"
},
"allStatuses": "Todos os estados",
"status": {
+14 -1
View File
@@ -1738,6 +1738,7 @@
"favorites": "Избранное",
"comments": "Комментарии",
"ratings": "Оценки",
"reactions": "Реакции",
"lastSeen": "Последний визит"
},
"view": "Подробнее",
@@ -1751,6 +1752,7 @@
"liked": "Понравилось",
"favorited": "В избранном",
"rated": "Оценено",
"reacted": "Отреагировал",
"commented": "Прокомментировано"
},
"inviteStatus": {
@@ -1806,7 +1808,9 @@
"event_renamed": "Событие переименовано: {{eventName}}",
"photo_rating": "Фото оценено в {{eventName}}",
"photo_comment": "Фото прокомментировано в {{eventName}}",
"photo_reaction": "Реакция на фото в {{eventName}}",
"guest_feedback_like": "Гость поставил лайк фото в {{eventName}}",
"guest_feedback_reaction": "Гость отреагировал на фото в {{eventName}}",
"guest_feedback_favorite": "Гость добавил фото в избранное в {{eventName}}",
"guest_feedback_rating": "Гость оценил фото в {{eventName}}",
"guest_feedback_comment": "Гость прокомментировал фото в {{eventName}}",
@@ -2535,6 +2539,12 @@
"patternDescription": "Пароли генерируются на основе названия и даты события. Пример: «Место2024$Август» для лучшей запоминаемости и безопасности."
},
"feedback": {
"reaction": "реакция",
"reactions": "Реакции",
"reactWith": "Отреагировать {{emoji}}",
"removeReaction": "Убрать реакцию {{emoji}}",
"reactionError": "Не удалось обновить реакцию",
"totalReactions": "Всего реакций",
"comments": "Комментарии",
"addComment": "Добавить комментарий",
"yourName": "Ваше имя",
@@ -2563,6 +2573,8 @@
"comments": "Комментарии",
"commentsDesc": "Текстовые комментарии к фото",
"favorites": "Избранное",
"reactions": "Эмодзи-реакции",
"reactionsDesc": "Один эмодзи на гостя для каждого фото (❤️ 😂 😍 👏 🎉)",
"favoritesDesc": "Отмечать фото как избранные",
"identityMode": "Режим идентификации",
"identityModeSimple": "Простые отзывы",
@@ -2601,7 +2613,8 @@
"rating": "Оценки",
"like": "Лайки",
"comment": "Комментарии",
"favorite": "Избранное"
"favorite": "Избранное",
"reaction": "Реакции"
},
"allStatuses": "Все статусы",
"status": {
+14 -1
View File
@@ -1688,6 +1688,7 @@
"favorites": "Priljubljene",
"comments": "Komentarji",
"ratings": "Ocene",
"reactions": "Odzivi",
"lastSeen": "Nazadnje viden"
},
"view": "Ogled podrobnosti",
@@ -1701,6 +1702,7 @@
"liked": "Všečkano",
"favorited": "Dodano med priljubljene",
"rated": "Ocenjeno",
"reacted": "Odzval se",
"commented": "Komentirano"
},
"inviteStatus": {
@@ -1733,7 +1735,9 @@
"photo_favorite": "Fotografija dodana med priljubljene v {{eventName}}",
"photo_rating": "Fotografija ocenjena v {{eventName}}",
"photo_comment": "Fotografija komentirana v {{eventName}}",
"photo_reaction": "Odziv na fotografijo v {{eventName}}",
"guest_feedback_like": "Gost je všečkal fotografijo v {{eventName}}",
"guest_feedback_reaction": "Gost se je odzval na fotografijo v {{eventName}}",
"guest_feedback_favorite": "Gost je dodal fotografijo med priljubljene v {{eventName}}",
"guest_feedback_rating": "Gost je ocenil fotografijo v {{eventName}}",
"guest_feedback_comment": "Gost je komentiral fotografijo v {{eventName}}",
@@ -2485,6 +2489,12 @@
"patternDescription": "Gesla se ustvarijo z uporabo imena in datuma dogodka. Primer: »Lokacija2024$Avgust« za boljšo varnost in lažje pomnjenje."
},
"feedback": {
"reaction": "odziv",
"reactions": "Odzivi",
"reactWith": "Odzovi se z {{emoji}}",
"removeReaction": "Odstrani odziv {{emoji}}",
"reactionError": "Odziva ni bilo mogoče posodobiti",
"totalReactions": "Skupaj odzivov",
"comments": "Komentarji",
"addComment": "Dodaj komentar",
"yourName": "Vaše ime",
@@ -2513,6 +2523,8 @@
"comments": "Komentarji",
"commentsDesc": "Besedilni komentarji na fotografijah",
"favorites": "Priljubljene",
"reactions": "Emoji odzivi",
"reactionsDesc": "En emoji na gosta na fotografijo (❤️ 😂 😍 👏 🎉)",
"favoritesDesc": "Označi fotografije kot priljubljene",
"identityMode": "Način identitete",
"identityModeSimple": "Preproste povratne informacije",
@@ -2551,7 +2563,8 @@
"rating": "Ocene",
"like": "Všečki",
"comment": "Komentarji",
"favorite": "Priljubljene"
"favorite": "Priljubljene",
"reaction": "Odzivi"
},
"allStatuses": "Vsa stanja",
"status": {