[PR #8424] [MERGED] fix: make Roleplay opacity override saved background alpha #8592

Closed
opened 2026-11-07 16:45:50 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: staging ← Head: fix/8420-roleplay-colored-background-opacity


📝 Commits (8)

  • a8d74df test: reproduce roleplay custom background opacity bypass
  • f8c3829 Merge branch 'staging' into fix/8420-roleplay-colored-background-opacity
  • d767f25 test: reproduce roleplay custom background opacity bypass
  • 5c679e8 fix: apply Roleplay opacity to authored background colors
  • a3c1f2a fix: align color previews and preserve explicit theme overrides
  • 02938fb test: remove theme probes through the typed Node API
  • 237c83b docs: shorten message color opacity guidance
  • 0a1b361 Merge maintainer staging update into opacity fix

📊 Changes

13 files changed (+371 additions, -22 deletions)

View changed files

📝 docs/characters/colors-and-stats.md (+4 -2)
📝 e2e/chat-widget-style.e2e.ts (+13 -4)
📝 e2e/core-flows.e2e.ts (+4 -3)
➕ e2e/roleplay-background-opacity.e2e.ts (+266 -0)
📝 packages/client/src/App.tsx (+4 -1)
📝 packages/client/src/components/characters/CharacterEditor.tsx (+9 -2)
📝 packages/client/src/components/chat/ChatMessage.tsx (+9 -1)
📝 packages/client/src/components/panels/SettingsPanel.tsx (+3 -0)
📝 packages/client/src/components/personas/PersonaEditor.tsx (+5 -2)
📝 packages/client/src/lib/chat-widget-colors.ts (+3 -1)
📝 packages/client/src/lib/css-colors.ts (+21 -2)
📝 packages/client/src/localization/locales/en.json (+2 -0)
📝 packages/client/src/styles/themes/chat-widget-surfaces.css (+28 -4)

📄 Description

Linked issue

Closes #8420

Why this change

Avatar color extraction saves a translucent message-box color. Roleplay used that saved alpha directly, so its background-opacity slider could not make those bubbles readable over a scene image. Applied preset backgrounds bypassed the slider separately.

What changed

  • You can no longer set a separate native Roleplay bubble opacity through a character/persona or applied preset background's saved alpha: Roleplay Messages Background Opacity replaces it, as requested. Saved colors themselves are unchanged.
  • Preset gradient stops and cut-corner fills follow the same slider; authored character/persona color previews do too.
  • Explain the setting beside the slider, in both color editors, and in the character-color guide. Translation follow-up: #8428.
  • Preserve explicit custom-theme background hooks and card CSS overrides. The existing reduced-paint profile still flattens nonzero fills over its opaque backing; its zero-opacity state clears both native bubbles.

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

Automated local evidence (checkboxes above remain human tasks):

  • pnpm install completed.
  • pnpm check passed, including localization, TypeScript, lint and production builds. The pre-existing HomeProfessorMariChat.tsx missing-dependency warning remains outside this diff.
  • pnpm exec playwright test -c playwright.config.ts e2e/roleplay-background-opacity.e2e.ts e2e/chat-widget-style.e2e.ts --grep 'Roleplay opacity replaces|chat style switches independently' --workers=2: 12 passed, across desktop Chromium, mobile Chromium and mobile WebKit in dark/light modes. This covers 0/50/100%, saved persona snapshots, reload, unchanged stored colors, native presets, gradients, cut corners, theme-hook precedence, editor previews, and the other chat modes.
  • pnpm smoke:ui: 7 passed.
  • Existing Roleplay reduced paint effects preserve semantic and custom styling browser regression: 1 passed, including card-CSS priority, zero opacity and reload.
  • Before-fix reproduction failed on the actual paint: at slider 0%, the character still used alpha 0.25 and the saved persona still used alpha 0.4.
  • Local CodeRabbit review completed. The authored-color preview and help-copy findings were repaired; the empty-color preview finding was classified as a pre-existing non-regression: both staging editors already use fixed fallback preview paint (0.08/0.12) when no color is authored. That separate default-preview behavior is unchanged. Final delta review completed with zero findings on the typed theme-probe cleanup and shortened help copy.

Shipping head 0a1b36197 preserves the maintainer's staging-update merge and has the identical tree to 237c83be5, which passed the final full check, localization, smoke and reduced-paint checks. The 12-case matrix ran at 02938fbc5, before only the final help-copy shortening and history integration.

Manual verification notes

  • Manually verify an avatar-extracted character and persona in the reporter's Firefox setup against a scene background at 0%, 50% and 100%.
  • Firefox did not execute locally: the Playwright browser exits at launch with Could not find profile folder, also with a fresh isolated browser download and explicit temporary/persistent profiles. This is an unverified browser row, not a passing result.
  • Physical Android/iPhone and the reporter's Linux/Firefox profile were not available. The mobile results above are browser emulation.
  • Docker did not run: the local OrbStack Docker socket is absent. Hosted container checks remain separate evidence.

Docs and release impact

The English character/persona color guide is updated. #8428 tracks the docs-i18n counterparts. No release metadata or changelog changes.

UI evidence

Download and open the self-contained before/after browser-evidence HTML. It embeds the 0%-slider reproduction, the fixed 0% state, and dark/light desktop/mobile screenshots from synthetic fixtures; no generated user content is included.


🔄 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/8424 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/28/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/8420-roleplay-colored-background-opacity` --- ### 📝 Commits (8) - [`a8d74df`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a8d74df9e5a0fd6b60444e3a1b51560bf60c7668) test: reproduce roleplay custom background opacity bypass - [`f8c3829`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f8c3829512dcb731b5ffbb1d236696cc065b846e) Merge branch 'staging' into fix/8420-roleplay-colored-background-opacity - [`d767f25`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d767f2562eb215af92db4f44deb254c267d380e4) test: reproduce roleplay custom background opacity bypass - [`5c679e8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5c679e847a604edb944cafb7fc79e68d934068b7) fix: apply Roleplay opacity to authored background colors - [`a3c1f2a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a3c1f2ab2606aa9faa217fa8c1359f5b1e2651f0) fix: align color previews and preserve explicit theme overrides - [`02938fb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/02938fbc583678c5c6084a6128e8dd0455ba848c) test: remove theme probes through the typed Node API - [`237c83b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/237c83be554d6c4ed8419d86da0b99482a270471) docs: shorten message color opacity guidance - [`0a1b361`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0a1b361979d0d08a79e8bbfcda3211cafbe86c40) Merge maintainer staging update into opacity fix ### 📊 Changes **13 files changed** (+371 additions, -22 deletions) <details> <summary>View changed files</summary> 📝 `docs/characters/colors-and-stats.md` (+4 -2) 📝 `e2e/chat-widget-style.e2e.ts` (+13 -4) 📝 `e2e/core-flows.e2e.ts` (+4 -3) ➕ `e2e/roleplay-background-opacity.e2e.ts` (+266 -0) 📝 `packages/client/src/App.tsx` (+4 -1) 📝 `packages/client/src/components/characters/CharacterEditor.tsx` (+9 -2) 📝 `packages/client/src/components/chat/ChatMessage.tsx` (+9 -1) 📝 `packages/client/src/components/panels/SettingsPanel.tsx` (+3 -0) 📝 `packages/client/src/components/personas/PersonaEditor.tsx` (+5 -2) 📝 `packages/client/src/lib/chat-widget-colors.ts` (+3 -1) 📝 `packages/client/src/lib/css-colors.ts` (+21 -2) 📝 `packages/client/src/localization/locales/en.json` (+2 -0) 📝 `packages/client/src/styles/themes/chat-widget-surfaces.css` (+28 -4) </details> ### 📄 Description ## Linked issue Closes #8420 ## Why this change Avatar color extraction saves a translucent message-box color. Roleplay used that saved alpha directly, so its background-opacity slider could not make those bubbles readable over a scene image. Applied preset backgrounds bypassed the slider separately. ## What changed - You can no longer set a separate native Roleplay bubble opacity through a character/persona or applied preset background's saved alpha: **Roleplay Messages Background Opacity** replaces it, as requested. Saved colors themselves are unchanged. - Preset gradient stops and cut-corner fills follow the same slider; authored character/persona color previews do too. - Explain the setting beside the slider, in both color editors, and in the character-color guide. Translation follow-up: #8428. - Preserve explicit custom-theme background hooks and card CSS overrides. The existing reduced-paint profile still flattens nonzero fills over its opaque backing; its zero-opacity state clears both native bubbles. ## 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` Automated local evidence (checkboxes above remain human tasks): - `pnpm install` completed. - `pnpm check` passed, including localization, TypeScript, lint and production builds. The pre-existing `HomeProfessorMariChat.tsx` missing-dependency warning remains outside this diff. - `pnpm exec playwright test -c playwright.config.ts e2e/roleplay-background-opacity.e2e.ts e2e/chat-widget-style.e2e.ts --grep 'Roleplay opacity replaces|chat style switches independently' --workers=2`: **12 passed**, across desktop Chromium, mobile Chromium and mobile WebKit in dark/light modes. This covers 0/50/100%, saved persona snapshots, reload, unchanged stored colors, native presets, gradients, cut corners, theme-hook precedence, editor previews, and the other chat modes. - `pnpm smoke:ui`: **7 passed**. - Existing `Roleplay reduced paint effects preserve semantic and custom styling` browser regression: **1 passed**, including card-CSS priority, zero opacity and reload. - Before-fix reproduction failed on the actual paint: at slider 0%, the character still used alpha 0.25 and the saved persona still used alpha 0.4. - Local CodeRabbit review completed. The authored-color preview and help-copy findings were repaired; the empty-color preview finding was classified as a pre-existing non-regression: both staging editors already use fixed fallback preview paint (0.08/0.12) when no color is authored. That separate default-preview behavior is unchanged. Final delta review completed with zero findings on the typed theme-probe cleanup and shortened help copy. Shipping head `0a1b36197` preserves the maintainer's staging-update merge and has the identical tree to `237c83be5`, which passed the final full check, localization, smoke and reduced-paint checks. The 12-case matrix ran at `02938fbc5`, before only the final help-copy shortening and history integration. ### Manual verification notes - Manually verify an avatar-extracted character and persona in the reporter's Firefox setup against a scene background at 0%, 50% and 100%. - Firefox did not execute locally: the Playwright browser exits at launch with `Could not find profile folder`, also with a fresh isolated browser download and explicit temporary/persistent profiles. This is an unverified browser row, not a passing result. - Physical Android/iPhone and the reporter's Linux/Firefox profile were not available. The mobile results above are browser emulation. - Docker did not run: the local OrbStack Docker socket is absent. Hosted container checks remain separate evidence. ## Docs and release impact The English character/persona color guide is updated. #8428 tracks the `docs-i18n` counterparts. No release metadata or changelog changes. ## UI evidence [Download and open the self-contained before/after browser-evidence HTML](https://gist.github.com/SpicyMarinara/2378c4edae2d1152ed7a021b53638bb4). It embeds the 0%-slider reproduction, the fixed 0% state, and dark/light desktop/mobile screenshots from synthetic fixtures; no generated user content is included. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 16:45:50 +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#8592
No description provided.