[PR #7168] [MERGED] Keep character dialogue colors when a chat style applies its colors #7606

Closed
opened 2026-10-24 04:05:48 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: staging ← Head: fix/preset-colors-dialogue


📝 Commits (4)

  • b7f0071 fix(chat): keep character dialogue colors under Apply preset colors (#7167)
  • 47d70a0 fix(game): keep own speaker name colors under Apply preset colors (#7167)
  • 57a3e0b Merge remote-tracking branch 'origin/staging' into fix/preset-colors-dialogue
  • 54874fa Merge branch 'staging' into fix/preset-colors-dialogue

📊 Changes

10 files changed (+427 additions, -18 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 docs/appearance/appearance-settings.md (+2 -2)
📝 docs/appearance/custom-css-themes.md (+1 -1)
📝 docs/chats/chat-settings.md (+1 -1)
➕ e2e/chat-widget-dialogue-colors.e2e.ts (+339 -0)
📝 packages/client/src/components/chat/ChatMessage.tsx (+34 -9)
📝 packages/client/src/components/game/GameNarration.tsx (+19 -3)
📝 packages/client/src/components/game/GameNarrationVisuals.tsx (+11 -1)
📝 packages/client/src/lib/chat-widget-colors.ts (+4 -0)
📝 packages/client/src/styles/themes/chat-widget-surfaces.css (+15 -1)

📄 Description

Linked issue

Closes #7167

Why this change

With a chat widget style that applies its own colors (for example Mari with Apply preset colors on), quoted dialogue lost each character's dialogue color and was painted in the preset's text color. Chat surfaces set an inherited -webkit-text-fill-color, which beats a dialogue span's inline color when text is painted, and a custom-text rule repainted text leaves directly. Game Mode speaker names had the same problem.

What changed

  • Text painted in a character's or persona's own color carries one shared class, mari-character-color (CHARACTER_COLOR_CLASS in lib/chat-widget-colors.ts), in every render path: Roleplay plain and HTML messages, group speaker colors, Game narration dialogue, and Game speaker names.
  • Under Apply preset colors that element paints with its own color (-webkit-text-fill-color: currentColor), and the preset's gradient-text rule skips it and its children, so italics inside a quote keep the color too.
  • Dialogue without a character color (the Default Dialogue Color) still follows the preset's text color. Nothing changes when Apply preset colors is off.
  • e2e/chat-widget-dialogue-colors.e2e.ts covers Roleplay, persona and Game dialogue plus Game names on Default, Mari and Dottore, in light and dark mode, with and without gradient text.
  • The appearance, custom CSS themes and chat settings guides now say quoted dialogue keeps each card's color under Apply preset colors.

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, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Manually verify: choose Mari (and Dottore) under Chat widget style with Apply preset colors on, open a Roleplay chat whose characters have dialogue colors, and check quotes (including italics inside quotes) use each character's color in light and dark mode, in classic and Visual Novel display.
  • Manually verify in a Game that dialogue and the speaker's name use the character's color with Apply preset colors on, and that a character without a dialogue color follows the preset.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation) — follow-up: #7172
  • Version/release files updated (only if this PR includes a version bump)

Summary by CodeRabbit

  • Bug Fixes
    • Character-colored dialogue now retains its color when preset text styling or gradients are enabled.
    • Improved color consistency for dialogue across chat and game views, including speaker labels, HTML dialogue, visual-novel displays, and game logs.

🔄 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/7168 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/6/2026 **Status:** ✅ Merged **Merged:** 10/6/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/preset-colors-dialogue` --- ### 📝 Commits (4) - [`b7f0071`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b7f007198a7e5627319fc8eed269078150b7491c) fix(chat): keep character dialogue colors under Apply preset colors (#7167) - [`47d70a0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/47d70a06ac45fb2cac8a87e519135b030fee04a0) fix(game): keep own speaker name colors under Apply preset colors (#7167) - [`57a3e0b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/57a3e0b953574b484ba121480dd74f2d9ce7e56d) Merge remote-tracking branch 'origin/staging' into fix/preset-colors-dialogue - [`54874fa`](https://github.com/Pasta-Devs/Marinara-Engine/commit/54874fa6bcc8d2b19b4bb05877f62485f66a718e) Merge branch 'staging' into fix/preset-colors-dialogue ### 📊 Changes **10 files changed** (+427 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `docs/appearance/appearance-settings.md` (+2 -2) 📝 `docs/appearance/custom-css-themes.md` (+1 -1) 📝 `docs/chats/chat-settings.md` (+1 -1) ➕ `e2e/chat-widget-dialogue-colors.e2e.ts` (+339 -0) 📝 `packages/client/src/components/chat/ChatMessage.tsx` (+34 -9) 📝 `packages/client/src/components/game/GameNarration.tsx` (+19 -3) 📝 `packages/client/src/components/game/GameNarrationVisuals.tsx` (+11 -1) 📝 `packages/client/src/lib/chat-widget-colors.ts` (+4 -0) 📝 `packages/client/src/styles/themes/chat-widget-surfaces.css` (+15 -1) </details> ### 📄 Description ## Linked issue Closes #7167 ## Why this change With a chat widget style that applies its own colors (for example **Mari** with **Apply preset colors** on), quoted dialogue lost each character's dialogue color and was painted in the preset's text color. Chat surfaces set an inherited `-webkit-text-fill-color`, which beats a dialogue span's inline `color` when text is painted, and a custom-text rule repainted text leaves directly. Game Mode speaker names had the same problem. ## What changed - Text painted in a character's or persona's own color carries one shared class, `mari-character-color` (`CHARACTER_COLOR_CLASS` in `lib/chat-widget-colors.ts`), in every render path: Roleplay plain and HTML messages, group speaker colors, Game narration dialogue, and Game speaker names. - Under Apply preset colors that element paints with its own color (`-webkit-text-fill-color: currentColor`), and the preset's gradient-text rule skips it and its children, so italics inside a quote keep the color too. - Dialogue without a character color (the Default Dialogue Color) still follows the preset's text color. Nothing changes when Apply preset colors is off. - `e2e/chat-widget-dialogue-colors.e2e.ts` covers Roleplay, persona and Game dialogue plus Game names on Default, Mari and Dottore, in light and dark mode, with and without gradient text. - The appearance, custom CSS themes and chat settings guides now say quoted dialogue keeps each card's color under Apply preset colors. ## 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, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Manually verify: choose **Mari** (and **Dottore**) under Chat widget style with **Apply preset colors** on, open a Roleplay chat whose characters have dialogue colors, and check quotes (including italics inside quotes) use each character's color in light and dark mode, in classic and Visual Novel display. - Manually verify in a Game that dialogue and the speaker's name use the character's color with Apply preset colors on, and that a character without a dialogue color follows the preset. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) — follow-up: #7172 - [ ] Version/release files updated (only if this PR includes a version bump) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Character-colored dialogue now retains its color when preset text styling or gradients are enabled. * Improved color consistency for dialogue across chat and game views, including speaker labels, HTML dialogue, visual-novel displays, and game logs. <!-- 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-24 04:05:48 +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#7606
No description provided.