[PR #4033] [MERGED] feat(chat): custom quick replies + translation display options (#4024) #6211

Closed
opened 2026-10-23 04:08:13 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4033
Author: @SpicyMarinara
Created: 7/24/2026
Status: ✅ Merged
Merged: 7/24/2026
Merged by: @SpicyMarinara

Base: staging ← Head: feature/4024-quick-replies-translation


📝 Commits (2)

  • 1d5fdbf feat(chat): custom quick replies and translation display options
  • 07d5da9 fix: address CodeRabbit review on #4024

📊 Changes

12 files changed (+251 additions, -18 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 packages/client/src/components/chat/ChatArea.tsx (+7 -1)
📝 packages/client/src/components/chat/ChatInput.tsx (+35 -0)
📝 packages/client/src/components/chat/ChatMessage.tsx (+33 -8)
📝 packages/client/src/components/chat/ConversationInput.tsx (+37 -1)
📝 packages/client/src/components/panels/SettingsPanel.tsx (+69 -0)
📝 packages/client/src/features/chat-settings/sections/TranslationSection.tsx (+6 -0)
📝 packages/client/src/hooks/use-generate.ts (+1 -1)
📝 packages/client/src/hooks/use-translate.ts (+3 -1)
📝 packages/client/src/stores/translation.store.ts (+23 -6)
📝 packages/client/src/stores/ui.store.ts (+33 -0)
📝 packages/shared/src/types/chat.ts (+2 -0)

📄 Description

Why

Two QoL requests from #4024 (maintainer agreed to both in the Discord thread):

  1. Custom quick replies — like SillyTavern's, users want to define their own quick-reply buttons that send a fixed prompt/macro/command, instead of only the three built-in actions (Post only / Guide reply / Impersonate).
  2. Translation display options — translations currently render below the original, doubling message length (painful on mobile), and translated text isn't formatted (no markdown). Requested: an option to show only the translation, and markdown formatting for translated text.

What changed

Custom quick replies

  • ui.store.ts: new persisted customQuickReplies list ({ id, label, content }) with addCustomQuickReply / updateCustomQuickReply / removeCustomQuickReply.
  • SettingsPanel.tsx: a Custom quick replies manager inside Settings → General → Quick replies (add / edit label + content / remove).
  • ChatInput.tsx (Roleplay/Game) and ConversationInput.tsx (Conversation): custom entries are appended to the quick replies menu; selecting one writes its content into the composer and sends it through the normal send path, so macros and /slash commands execute as if typed.

Translation display options

  • packages/shared ChatMetadata: new translationDisplayOnly?: boolean.
  • TranslationSection.tsx: Show Only Translation toggle.
  • ChatMessage.tsx: translated text now renders through the same renderContent markdown pipeline as messages (bold/italics/quotes) in both the Conversation and Roleplay surfaces; when Show Only Translation is on and a translation exists, the translation replaces the original in place instead of appearing below it.

Notes / decisions

  • Custom quick replies appear only when the Quick replies menu is enabled (they live in that menu); the manager is in that same settings block.
  • Empty-content custom replies are skipped in the menu; an empty label falls back to a truncated preview of the content.
  • User-visible strings use the existing useLocalizedUiText() pattern used by the surrounding quick-reply settings (English source, community locales fall back to English).

Test plan

  • In Settings → General → Quick replies, add a custom reply (label + a /slash command, e.g. /sys ...); confirm it appears in the quick replies menu beside Send in a Roleplay chat and a Conversation chat, and that selecting it runs the command.
  • Add a custom reply whose content is plain text with a {{macro}}; confirm the macro resolves when sent.
  • Confirm custom replies persist across reload and can be edited/removed.
  • In Chat Settings → Translation, enable Show Only Translation; translate a message and confirm only the translation shows, with markdown (bold/italics) rendered; disable it and confirm both original and translation show.
  • Verify translated markdown renders in both Conversation and Roleplay message surfaces.
  • pnpm check passes. (It passed in the authoring session; re-verify locally.)

Fixes #4024.

Summary by CodeRabbit

  • New Features
    • Create and manage custom Quick Replies for fixed messages, macros, or slash commands.
    • Use custom Quick Replies directly from the chat Send menu.
    • Enable Show Only Translation in Chat Settings to replace original text with translated content.
  • Improvements
    • Translations now retain consistent markdown formatting with regular messages.

🔄 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/4033 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 7/24/2026 **Status:** ✅ Merged **Merged:** 7/24/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feature/4024-quick-replies-translation` --- ### 📝 Commits (2) - [`1d5fdbf`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1d5fdbff7affd871020b0edd436e3714307522f7) feat(chat): custom quick replies and translation display options - [`07d5da9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/07d5da9ee11757545aea746568dd48fb45c39ca9) fix: address CodeRabbit review on #4024 ### 📊 Changes **12 files changed** (+251 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `packages/client/src/components/chat/ChatArea.tsx` (+7 -1) 📝 `packages/client/src/components/chat/ChatInput.tsx` (+35 -0) 📝 `packages/client/src/components/chat/ChatMessage.tsx` (+33 -8) 📝 `packages/client/src/components/chat/ConversationInput.tsx` (+37 -1) 📝 `packages/client/src/components/panels/SettingsPanel.tsx` (+69 -0) 📝 `packages/client/src/features/chat-settings/sections/TranslationSection.tsx` (+6 -0) 📝 `packages/client/src/hooks/use-generate.ts` (+1 -1) 📝 `packages/client/src/hooks/use-translate.ts` (+3 -1) 📝 `packages/client/src/stores/translation.store.ts` (+23 -6) 📝 `packages/client/src/stores/ui.store.ts` (+33 -0) 📝 `packages/shared/src/types/chat.ts` (+2 -0) </details> ### 📄 Description ## Why Two QoL requests from #4024 (maintainer agreed to both in the Discord thread): 1. **Custom quick replies** — like SillyTavern's, users want to define their own quick-reply buttons that send a fixed prompt/macro/command, instead of only the three built-in actions (Post only / Guide reply / Impersonate). 2. **Translation display options** — translations currently render *below* the original, doubling message length (painful on mobile), and translated text isn't formatted (no markdown). Requested: an option to show only the translation, and markdown formatting for translated text. ## What changed ### Custom quick replies - `ui.store.ts`: new persisted `customQuickReplies` list (`{ id, label, content }`) with `addCustomQuickReply` / `updateCustomQuickReply` / `removeCustomQuickReply`. - `SettingsPanel.tsx`: a **Custom quick replies** manager inside **Settings → General → Quick replies** (add / edit label + content / remove). - `ChatInput.tsx` (Roleplay/Game) and `ConversationInput.tsx` (Conversation): custom entries are appended to the quick replies menu; selecting one writes its content into the composer and sends it through the normal send path, so macros and `/slash` commands execute as if typed. ### Translation display options - `packages/shared` `ChatMetadata`: new `translationDisplayOnly?: boolean`. - `TranslationSection.tsx`: **Show Only Translation** toggle. - `ChatMessage.tsx`: translated text now renders through the same `renderContent` markdown pipeline as messages (bold/italics/quotes) in both the Conversation and Roleplay surfaces; when *Show Only Translation* is on and a translation exists, the translation replaces the original in place instead of appearing below it. ## Notes / decisions - Custom quick replies appear only when the **Quick replies** menu is enabled (they live in that menu); the manager is in that same settings block. - Empty-content custom replies are skipped in the menu; an empty label falls back to a truncated preview of the content. - User-visible strings use the existing `useLocalizedUiText()` pattern used by the surrounding quick-reply settings (English source, community locales fall back to English). ## Test plan - [ ] In **Settings → General → Quick replies**, add a custom reply (label + a `/slash` command, e.g. `/sys ...`); confirm it appears in the quick replies menu beside Send in a Roleplay chat and a Conversation chat, and that selecting it runs the command. - [ ] Add a custom reply whose content is plain text with a `{{macro}}`; confirm the macro resolves when sent. - [ ] Confirm custom replies persist across reload and can be edited/removed. - [ ] In **Chat Settings → Translation**, enable **Show Only Translation**; translate a message and confirm only the translation shows, with markdown (bold/italics) rendered; disable it and confirm both original and translation show. - [ ] Verify translated markdown renders in both Conversation and Roleplay message surfaces. - [ ] `pnpm check` passes. (It passed in the authoring session; re-verify locally.) Fixes #4024. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Create and manage custom Quick Replies for fixed messages, macros, or slash commands. * Use custom Quick Replies directly from the chat Send menu. * Enable **Show Only Translation** in Chat Settings to replace original text with translated content. * **Improvements** * Translations now retain consistent markdown formatting with regular messages. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:08:13 +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#6211
No description provided.