[PR #2634] [MERGED] feat(conversation): message reactions + character reacts #5700

Closed
opened 2026-10-22 04:18:39 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2634
Author: @kolacheee
Created: 6/18/2026
Status: ✅ Merged
Merged: 6/19/2026
Merged by: @SpicyMarinara

Base: staging ← Head: feat/staging-message-reactions


📝 Commits (10+)

  • 113f4c9 feat(custom-emojis): data model + storage for global custom emojis
  • 1cea476 feat(custom-emojis): routes — upload, serve, list, rename, delete, import/export
  • ffdf5c1 feat(custom-emojis): emoji-picker Custom tab + client hooks
  • e834059 feat(custom-emojis): render :name: tokens as inline images in conversation messages
  • 6216af2 feat(custom-emojis): jumbo rendering for emoji-only lines
  • 1e8338a feat(custom-emojis): :emoji: autocomplete in the conversation composer
  • 2ba59cb feat(emoji): resolve per-source custom emojis in conversations
  • 4627cef feat(emoji): show persona & character emojis in the picker's Custom tab
  • 2636930 feat(emoji): advertise available custom emojis to the model
  • 35ec1ff feat(emoji): add selection preferences (max count + random/semantic)

📊 Changes

43 files changed (+3775 additions, -98 deletions)

View changed files

📝 packages/client/src/components/chat/ConversationInput.tsx (+283 -2)
📝 packages/client/src/components/chat/ConversationMessage.tsx (+76 -1)
📝 packages/client/src/components/chat/ConversationMessageActions.tsx (+5 -0)
📝 packages/client/src/components/chat/ConversationMessageBubble.tsx (+6 -4)
📝 packages/client/src/components/chat/ConversationMessageGrouped.tsx (+7 -3)
📝 packages/client/src/components/chat/ConversationMessageLine.tsx (+4 -2)
📝 packages/client/src/components/chat/ConversationMessageShared.tsx (+20 -3)
📝 packages/client/src/components/chat/ConversationView.tsx (+10 -0)
➕ packages/client/src/components/chat/CustomEmojiSelectionSettings.tsx (+123 -0)
➕ packages/client/src/components/chat/CustomEmojiTab.tsx (+308 -0)
➕ packages/client/src/components/chat/MessageReactions.tsx (+133 -0)
➕ packages/client/src/components/chat/ReactionAddButton.tsx (+83 -0)
➕ packages/client/src/components/chat/StickerPicker.tsx (+413 -0)
📝 packages/client/src/components/ui/AppDialogRenderer.tsx (+38 -1)
📝 packages/client/src/components/ui/EmojiPicker.tsx (+108 -47)
📝 packages/client/src/components/ui/GifPicker.tsx (+25 -12)
➕ packages/client/src/hooks/use-conversation-custom-emojis.ts (+88 -0)
➕ packages/client/src/hooks/use-conversation-custom-stickers.ts (+88 -0)
➕ packages/client/src/hooks/use-custom-emojis.ts (+70 -0)
➕ packages/client/src/hooks/use-custom-stickers.ts (+70 -0)

...and 23 more files

📄 Description

Linked issue

Closes #2610.

Stacked on #2622 (Part 1 — custom emojis) and #2632 (Part 2 — stickers). This branch builds on feat/staging-custom-stickers (which carries both), so until those merge this PR's diff includes their commits too. Review/merge #2622 then #2632 first.

Why this change

Add message reactions to Conversation mode (Part 3 of 3, after custom emojis + stickers): users can react to messages with standard or custom emojis, and characters can react too. Reactions are serialized into the prompt so characters perceive them, and a lone user reaction with no text follow-up is a valid turn that can prompt a (time-gated) character response. Conversation mode only — no Roleplay/Game codepaths.

What changed

Built in slices, reusing the custom-emoji / sticker work:

  • Reaction UI & data — a MessageReaction type + extra.reactions on messages; pure toggleReaction / USER_REACTOR helpers; a Discord-style MessageReactions chip row (own-reaction highlight, who-reacted tooltip, rendered outside the [data-card-css] container so a character's bubble theme can't restyle it; right-aligned under user bubbles); a ReactionAddButton in the hover action bar (standard emojis + a pick-only custom grid). Wired into the line, bubble, and grouped message layouts. Reactions persist via the existing PATCH /chats/:id/messages/:id/extra route (optimistic, with rollback).
  • Prompt serialization — each message's prompt content is annotated with a compact [<who> reacted with <emoji>] note (custom emojis shown as :name:, already advertised), injected once per request so every conversation prompt path inherits it; it is not timestamp-shaped, so the conversation timestamp stripper leaves it intact.
  • Character reacts — a model-agnostic inline directive [react: emoji="😂"] (custom emojis via :name:) advertised in the system prompt, parsed + stripped from the reply, and applied to the user's most recent message (the responding character becomes a reactor; a custom-emoji image URL is resolved server-side so the chip renders). Whether and how warmly to react is left emergent per personality — nothing hardcoded.
  • Lone-reaction trigger — a reaction with no text after it is recorded as a soft activity signal and routed through the existing autonomous-messaging cadence: it opens a shorter, reaction-specific gate for the first proactive response (a fraction of the character's quiet threshold, floored at 30s so it is never near-instant) and never accelerates follow-ups, so characters stay un-needy. Only when autonomous messaging is enabled.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, timing behavior)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

Suggested manual checks (Conversation mode):

  • Manually verify adding/removing a reaction (standard + custom emoji) on both user and character messages: the chip toggles, the count and who-reacted tooltip are correct, and it persists across reload.
  • Manually verify the chip row renders correctly in the line, bubble, and grouped layouts, in light + dark mode and on a mobile viewport, and that a character's bubble-CSS theme cannot restyle it.
  • Manually verify that after you react to a message and send a normal turn, the character's reply reflects that it perceived the reaction.
  • Manually verify a character reaction: prompt one (or let it happen naturally), confirm [react: …] does not appear in the visible message, and the reaction badge lands on your latest message.
  • Manually verify the lone-reaction trigger: with autonomous messaging enabled, leave a reaction with no text and confirm a character responds after a short delay (not instantly), and that it does not become repetitive.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

Pending — reaction chips, the add-reaction button, and a character reaction badge (to be attached after manual verification).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/2634 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 6/18/2026 **Status:** ✅ Merged **Merged:** 6/19/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/staging-message-reactions` --- ### 📝 Commits (10+) - [`113f4c9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/113f4c97187d102ae176cf849795f110d2424ab7) feat(custom-emojis): data model + storage for global custom emojis - [`1cea476`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1cea476491b4802ad14eba9b418bfd210acd6111) feat(custom-emojis): routes — upload, serve, list, rename, delete, import/export - [`ffdf5c1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ffdf5c1c092d99c8bfb37871cec0677ec3e65e5f) feat(custom-emojis): emoji-picker Custom tab + client hooks - [`e834059`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e8340591b5d97e8059db8bf901603714729d8261) feat(custom-emojis): render :name: tokens as inline images in conversation messages - [`6216af2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6216af2a2b0e03dbafc8279736afe9bf057e0e6c) feat(custom-emojis): jumbo rendering for emoji-only lines - [`1e8338a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1e8338a642007aed02e119e9d68b8347e3a9b5f4) feat(custom-emojis): :emoji: autocomplete in the conversation composer - [`2ba59cb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2ba59cb08df826d99edde8055900506d5966e57d) feat(emoji): resolve per-source custom emojis in conversations - [`4627cef`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4627cef3b45bcacabf68b77add1022f289a99b76) feat(emoji): show persona & character emojis in the picker's Custom tab - [`2636930`](https://github.com/Pasta-Devs/Marinara-Engine/commit/26369303b393c756b8356b02639a989c03301962) feat(emoji): advertise available custom emojis to the model - [`35ec1ff`](https://github.com/Pasta-Devs/Marinara-Engine/commit/35ec1ff342582aecb480bbaa62c399be22906981) feat(emoji): add selection preferences (max count + random/semantic) ### 📊 Changes **43 files changed** (+3775 additions, -98 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/chat/ConversationInput.tsx` (+283 -2) 📝 `packages/client/src/components/chat/ConversationMessage.tsx` (+76 -1) 📝 `packages/client/src/components/chat/ConversationMessageActions.tsx` (+5 -0) 📝 `packages/client/src/components/chat/ConversationMessageBubble.tsx` (+6 -4) 📝 `packages/client/src/components/chat/ConversationMessageGrouped.tsx` (+7 -3) 📝 `packages/client/src/components/chat/ConversationMessageLine.tsx` (+4 -2) 📝 `packages/client/src/components/chat/ConversationMessageShared.tsx` (+20 -3) 📝 `packages/client/src/components/chat/ConversationView.tsx` (+10 -0) ➕ `packages/client/src/components/chat/CustomEmojiSelectionSettings.tsx` (+123 -0) ➕ `packages/client/src/components/chat/CustomEmojiTab.tsx` (+308 -0) ➕ `packages/client/src/components/chat/MessageReactions.tsx` (+133 -0) ➕ `packages/client/src/components/chat/ReactionAddButton.tsx` (+83 -0) ➕ `packages/client/src/components/chat/StickerPicker.tsx` (+413 -0) 📝 `packages/client/src/components/ui/AppDialogRenderer.tsx` (+38 -1) 📝 `packages/client/src/components/ui/EmojiPicker.tsx` (+108 -47) 📝 `packages/client/src/components/ui/GifPicker.tsx` (+25 -12) ➕ `packages/client/src/hooks/use-conversation-custom-emojis.ts` (+88 -0) ➕ `packages/client/src/hooks/use-conversation-custom-stickers.ts` (+88 -0) ➕ `packages/client/src/hooks/use-custom-emojis.ts` (+70 -0) ➕ `packages/client/src/hooks/use-custom-stickers.ts` (+70 -0) _...and 23 more files_ </details> ### 📄 Description ## Linked issue Closes #2610. > **Stacked on #2622 (Part 1 — custom emojis) and #2632 (Part 2 — stickers).** This branch builds on `feat/staging-custom-stickers` (which carries both), so until those merge this PR's diff includes their commits too. Review/merge #2622 then #2632 first. ## Why this change Add **message reactions** to Conversation mode (Part 3 of 3, after custom emojis + stickers): users can react to messages with standard or custom emojis, and **characters can react too**. Reactions are serialized into the prompt so characters perceive them, and a lone user reaction with no text follow-up is a valid turn that can prompt a (time-gated) character response. **Conversation mode only** — no Roleplay/Game codepaths. ## What changed Built in slices, reusing the custom-emoji / sticker work: - **Reaction UI & data** — a `MessageReaction` type + `extra.reactions` on messages; pure `toggleReaction` / `USER_REACTOR` helpers; a Discord-style `MessageReactions` chip row (own-reaction highlight, who-reacted tooltip, rendered outside the `[data-card-css]` container so a character's bubble theme can't restyle it; right-aligned under user bubbles); a `ReactionAddButton` in the hover action bar (standard emojis + a pick-only custom grid). Wired into the line, bubble, and grouped message layouts. Reactions persist via the existing `PATCH /chats/:id/messages/:id/extra` route (optimistic, with rollback). - **Prompt serialization** — each message's prompt content is annotated with a compact `[<who> reacted with <emoji>]` note (custom emojis shown as `:name:`, already advertised), injected once per request so every conversation prompt path inherits it; it is not timestamp-shaped, so the conversation timestamp stripper leaves it intact. - **Character reacts** — a model-agnostic inline directive `[react: emoji="😂"]` (custom emojis via `:name:`) advertised in the system prompt, parsed + stripped from the reply, and applied to the user's most recent message (the responding character becomes a reactor; a custom-emoji image URL is resolved server-side so the chip renders). Whether and how warmly to react is left emergent per personality — nothing hardcoded. - **Lone-reaction trigger** — a reaction with no text after it is recorded as a soft activity signal and routed through the existing autonomous-messaging cadence: it opens a shorter, reaction-specific gate for the *first* proactive response (a fraction of the character's quiet threshold, floored at 30s so it is never near-instant) and never accelerates follow-ups, so characters stay un-needy. Only when autonomous messaging is enabled. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, timing behavior) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes Suggested manual checks (Conversation mode): - Manually verify adding/removing a reaction (standard + custom emoji) on both user and character messages: the chip toggles, the count and who-reacted tooltip are correct, and it persists across reload. - Manually verify the chip row renders correctly in the line, bubble, and grouped layouts, in light + dark mode and on a mobile viewport, and that a character's bubble-CSS theme cannot restyle it. - Manually verify that after you react to a message and send a normal turn, the character's reply reflects that it perceived the reaction. - Manually verify a character reaction: prompt one (or let it happen naturally), confirm `[react: …]` does not appear in the visible message, and the reaction badge lands on your latest message. - Manually verify the lone-reaction trigger: with autonomous messaging enabled, leave a reaction with no text and confirm a character responds after a short delay (not instantly), and that it does not become repetitive. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) _Pending — reaction chips, the add-reaction button, and a character reaction badge (to be attached after manual verification)._ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:18:39 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#5700
No description provided.