mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7297] [MERGED] fix(theme): keep colours set by HTML agent output when Chat Chrome Text Color is on #7671
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#7671
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7297
Author: @SpicyMarinara
Created: 10/8/2026
Status: ✅ Merged
Merged: 10/8/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/chat-chrome-text-html-7296📝 Commits (2)
bc4a8fbfix(theme): keep colours set by HTML agent output when Chat Chrome Text Color is onc236a76Merge origin/staging into fix/chat-chrome-text-html-7296📊 Changes
5 files changed (+125 additions, -6 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
e2e/chat-widget-dialogue-colors.e2e.ts(+97 -0)📝
packages/client/src/components/chat/ChatMessage.tsx(+4 -4)📝
packages/client/src/lib/chat-widget-colors.ts(+3 -0)📝
packages/client/src/styles/themes/chat-widget-surfaces.css(+20 -2)📄 Description
Linked issue
Closes #7296
Why this change
Kakekay reported on Discord that the Immersive HTML agent draws a cream card with black text, but Marinara painted that text in their Chat Chrome Text Color (green in their screenshots, white by default), so the card became hard to read.
Root cause: the agent's output is fine. The bug is in the Engine. With Settings → Appearance → Chat widget style → Apply preset colors on,
chat-widget-surfaces.csssets-webkit-text-fill-coloron the message bubble to the preset text. Under the Default preset, that falls back to Chat Chrome Text Color. The fill is inherited and paints text instead ofcolor. Author colors set withstyle="color:…",<font color>or a class from the message's own<style>only changecolor, so every element in the HTML painted the preset or chrome color. With the switch off, the chrome color never reaches messages, which is why only some users see this. This follows the same pattern as #7167, where a character's own dialogue color already wins over the preset.What changed
ChatMessage.tsx: the HTML message wrapper gets a stablemari-html-contentclass. Its per-message scope class can't be targeted from CSS. Dialogue that the Engine colors with the fallback inside HTML messages is markedmari-fallback-dialogue(newFALLBACK_DIALOGUE_CLASSbesideCHARACTER_COLOR_CLASS).chat-widget-surfaces.css, when Apply preset colors is on:.mari-html-contentresets the fill tocurrentColor. Each element then paints its own color: inline,<font>, a class from the message's<style>, or a color inherited from a colored box. The wrapper's owncolorstill comes from the preset, so text without a color of its own looks exactly as before.<font>colors in HTML skip the gradient. Uncolored text and uncolored dialogue keep it. Aponytail:note records the limits: a color set only by a class still gets the gradient, and text in a box with only a background color gets the solid first stop.e2e/chat-widget-dialogue-colors.e2e.ts: a new test (dark and light) posts an Immersive-HTML-like message and sets Chat Chrome Text Color to the reporter's#6ab04c. Black text stays black (inherited from the card, inline,<font>, and a class from the message's<style>) with Apply preset colors off, then on with Default, Mari and Dottore, plus a gradient text color. Plain narration and uncolored dialogue keep following the preset. Under Default, the bubble uses the chrome color. Nothing changes after switching off again. Existing tests are unchanged; the shared fixture only gains one message, posted before the last one so the visual-novel check still sees the same latest message.[Unreleased].No UI copy changes. No docs changes: the docs already say Chat Chrome Text Color is for chat chrome, and Apply preset colors for messages, inputs and controls.
Validation
pnpm checkpasses locallyCONTRIBUTING.mdAgent-run checks (not a substitute for the boxes above):
pnpm check: exit 0.color(srgb 0.416 0.69 0.298 / 0.9), the chrome green at 90%, in dark and light) and passes with the fix.e2e/chat-widget-dialogue-colors.e2e.ts+e2e/chat-widget-style.e2e.tson desktop-chromium and mobile-webkit: all dialogue-color tests passed on both projects, including the new ones. In the full runs, two style tests failed once each, on different runs, because a fresh page stayed on "Loading..." (movable button pixel size …andchat style switches … dottore … dark). Neither involves HTML messages. Both passed on rerun on desktop-chromium and mobile-webkit, and the movable-button test also passed alone on unfixed staging.coderabbit review --agent --committed): 0 findings.Manual verification notes
style="color:#000",<font color="#000000">, and a class from its own<style>).Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)UI evidence (if applicable)
Measured in Chromium with Chat Chrome Text Color
#6ab04c, Apply preset colors on, Default preset (computedcolor/-webkit-text-fill-color):<font>/ class / inherited black textrgb(0,0,0)/ chrome green at 90%rgb(0,0,0)/rgb(0,0,0)Credit: reported by Kakekay on Discord.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.