[PR #964] [MERGED] fix(chat): apply Chat Text Color to message content (#961) #4860

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/964
Author: @taiman724
Created: 5/18/2026
Status: ✅ Merged
Merged: 5/18/2026
Merged by: @Xelvanis

Base: staging ← Head: fix/961-chat-text-color


📝 Commits (2)

  • 781b6e1 fix(chat): apply Chat Text Color to message content (#961)
  • cc4b6f8 fix(chat): apply chat text color to conversation messages

📊 Changes

2 files changed (+16 additions, -3 deletions)

View changed files

📝 packages/client/src/components/chat/ChatMessage.tsx (+8 -2)
📝 packages/client/src/components/chat/ConversationMessage.tsx (+8 -1)

📄 Description

Closes #961.

Why this change

The Chat Text Color appearance setting (chatFontColor) was already wired into messageTextStyle in ChatMessage.tsx and applied to the message bubble containers (roleplay bubble around line 1645, texting bubble around line 2127). However, chatFontColor had no visible effect on actual chat message text — the reporter set Chat Text Color to a noticeable red (#972121) and chat text stayed light/white (issue #961).

Root cause: the inner .mari-message-content div has its own CSS rule in packages/client/src/styles/globals.css:

.mari-message-content {
  color: var(--foreground);
}

CSS specificity: a class rule on the same element wins over an inherited color cascaded from a parent's inline style. So even though the bubble parent had color: chatFontColor inline, the child .mari-message-content reverted to var(--foreground). The narrator render path (around line 1463) already places style={messageTextStyle} directly on the .mari-message-content div, which is why narrator text colored correctly while chat / roleplay text did not.

What changed

Two surgical edits in packages/client/src/components/chat/ChatMessage.tsx:

  • Roleplay path (around line 1335): added style={messageTextStyle} to the .mari-message-content div inside roleplayBubbleContent.
  • Texting path (around line 2137): added style={messageTextStyle} to the .mari-message-content div inside the texting bubble.

Both edits mirror the narrator path's existing pattern. Inline style on the same element beats the class rule, so color: chatFontColor (and fontSize / textStrokeStyle carried by messageTextStyle) now wins.

No CSS, store, or settings UI changed. No behavior changes when chatFontColor is empty (default): messageTextStyle only sets color when chatFontColor is truthy — otherwise .mari-message-content's color: var(--foreground) continues to apply.

Diff: 1 file, +8 / -2.

Validation

  • pnpm check (ran pnpm install --frozen-lockfile then pnpm check locally; clean — TypeScript, ESLint, and the production build all pass).
  • Manually verify in dev server (roleplay chat): set Chat Text Color to a clearly visible color, confirm narration (non-dialogue text) renders in that color in both light and dark mode.
  • Manually verify in dev server (texting chat): same as above for chat message text.
  • Manually verify dialogue (quoted text) still uses dialogueColor / per-speaker color independently from chatFontColor.
  • Manually verify clearing Chat Text Color (empty value) returns text to var(--foreground) in both light and dark mode.
  • Manually verify chatFontSize and the text-stroke setting still apply correctly on the same content divs (already applied via bubble parent and continue to apply now via the inner div as well).

I have not run a dev-server visual test myself, so all manual checks above are intentionally left unchecked.

Note

Co-developed with AI assistance; reviewed and tested by submitter.

Summary by CodeRabbit

  • Bug Fixes
    • Chat message text styling has been enhanced to properly apply customized font sizes and colors across both roleplay and conversation modes, ensuring consistent text appearance throughout the chat interface.

Review Change Stack


🔄 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/964 **Author:** [@taiman724](https://github.com/taiman724) **Created:** 5/18/2026 **Status:** ✅ Merged **Merged:** 5/18/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `staging` ← **Head:** `fix/961-chat-text-color` --- ### 📝 Commits (2) - [`781b6e1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/781b6e1c8125ee1dbe8deaaa87be4f7677dc3e9e) fix(chat): apply Chat Text Color to message content (#961) - [`cc4b6f8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/cc4b6f8607c5455bcdbe1f60e9e066c14667e368) fix(chat): apply chat text color to conversation messages ### 📊 Changes **2 files changed** (+16 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/chat/ChatMessage.tsx` (+8 -2) 📝 `packages/client/src/components/chat/ConversationMessage.tsx` (+8 -1) </details> ### 📄 Description Closes #961. ## Why this change The Chat Text Color appearance setting (`chatFontColor`) was already wired into `messageTextStyle` in `ChatMessage.tsx` and applied to the message bubble containers (roleplay bubble around line 1645, texting bubble around line 2127). However, `chatFontColor` had no visible effect on actual chat message text — the reporter set Chat Text Color to a noticeable red (`#972121`) and chat text stayed light/white (issue #961). Root cause: the inner `.mari-message-content` div has its own CSS rule in `packages/client/src/styles/globals.css`: ```css .mari-message-content { color: var(--foreground); } ``` CSS specificity: a class rule on the same element wins over an inherited `color` cascaded from a parent's inline style. So even though the bubble parent had `color: chatFontColor` inline, the child `.mari-message-content` reverted to `var(--foreground)`. The narrator render path (around line 1463) already places `style={messageTextStyle}` directly on the `.mari-message-content` div, which is why narrator text colored correctly while chat / roleplay text did not. ## What changed Two surgical edits in `packages/client/src/components/chat/ChatMessage.tsx`: - Roleplay path (around line 1335): added `style={messageTextStyle}` to the `.mari-message-content` div inside `roleplayBubbleContent`. - Texting path (around line 2137): added `style={messageTextStyle}` to the `.mari-message-content` div inside the texting bubble. Both edits mirror the narrator path's existing pattern. Inline style on the same element beats the class rule, so `color: chatFontColor` (and `fontSize` / `textStrokeStyle` carried by `messageTextStyle`) now wins. No CSS, store, or settings UI changed. No behavior changes when `chatFontColor` is empty (default): `messageTextStyle` only sets `color` when `chatFontColor` is truthy — otherwise `.mari-message-content`'s `color: var(--foreground)` continues to apply. Diff: 1 file, +8 / -2. ## Validation - [x] `pnpm check` (ran `pnpm install --frozen-lockfile` then `pnpm check` locally; clean — TypeScript, ESLint, and the production build all pass). - [ ] Manually verify in dev server (roleplay chat): set Chat Text Color to a clearly visible color, confirm narration (non-dialogue text) renders in that color in both light and dark mode. - [ ] Manually verify in dev server (texting chat): same as above for chat message text. - [ ] Manually verify dialogue (quoted text) still uses `dialogueColor` / per-speaker color independently from `chatFontColor`. - [ ] Manually verify clearing Chat Text Color (empty value) returns text to `var(--foreground)` in both light and dark mode. - [ ] Manually verify `chatFontSize` and the text-stroke setting still apply correctly on the same content divs (already applied via bubble parent and continue to apply now via the inner div as well). I have not run a dev-server visual test myself, so all manual checks above are intentionally left unchecked. ## Note Co-developed with AI assistance; reviewed and tested by submitter. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Chat message text styling has been enhanced to properly apply customized font sizes and colors across both roleplay and conversation modes, ensuring consistent text appearance throughout the chat interface. <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/964?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- 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-22 04:11:14 +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#4860
No description provided.