[PR #7610] [MERGED] fix(game): keep Game section colors readable and steady under preset colors #7833

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

📋 Pull Request Information

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

Base: staging ← Head: fix/game-hud-widget-style-followup


📝 Commits (4)

  • 5848944 fix(game): keep Game section colors readable and steady under preset colors
  • a185ac3 Merge branch 'staging' into fix/game-hud-widget-style-followup
  • a2afdce Merge branch 'staging' into fix/game-hud-widget-style-followup
  • b8172c3 Merge branch 'staging' into fix/game-hud-widget-style-followup

📊 Changes

8 files changed (+251 additions, -15 deletions)

View changed files

📝 e2e/game-widget-style.e2e.ts (+117 -0)
📝 packages/client/src/components/game/CombatWeatherSummary.tsx (+7 -1)
📝 packages/client/src/components/game/GameJournal.tsx (+1 -0)
📝 packages/client/src/components/game/GameSurface.tsx (+24 -3)
📝 packages/client/src/components/game/GameWidgetPanel.tsx (+1 -0)
📝 packages/client/src/components/game/StoryboardBackgroundControls.tsx (+3 -0)
📝 packages/client/src/lib/chat-widget-colors.ts (+1 -1)
📝 packages/client/src/styles/themes/chat-widget-surfaces.css (+97 -10)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

No linked issue: follow-up to #7604 (maintainer report of 2026-10-14), fixing what the review of #7604 found after it merged. @SpicyMarinara

This branch starts with the one-line build fix from #7608, because staging does not build without it. Once #7608 merges, only the second commit is new here.

Why this change

The review of #7604 found these problems with Apply preset colors on:

  • On light styles (Prof. Mari light, Dottore light, light custom backgrounds) the pale blue and red party and enemy colors were nearly invisible. The turn order chips and the active hero's initial measured about 1.3:1 contrast.
  • With Default, the Game accent (the amber that marks warnings, such as "encumbered", the QTE ring and item letters) fell back to the chat button color. That color is the pulsing accent at 64% opacity, so warnings pulsed with Accent Pulse on and looked faded.
  • A Game section's own black shadow became a light halo on light styles, unlike Roleplay's dialogs.
  • Start combat, Remove party member, the party card choice, Delete journal entry and Remove widget stayed plain app dialogs, while End session and Interrupt followed the style. The scene helper and retry banners, the combat weather strip and the storyboard toolbar stayed black.
  • The e2e checked only each section's box, so it still passed when the colors inside a section were not remapped.

What changed

With Apply preset colors on (and for Game content inside a window, such as the Journal, whenever a style is chosen):

  • Pale party, enemy and element colors (red, orange, yellow, green, emerald, cyan, sky, blue, violet, purple, fuchsia and rose, shades 50–400) inside a Game section are mixed toward the style's text color. They keep their hue and stay readable on light and dark styles. The active hero's initial in classic combat now measures 5.5:1 with Prof. Mari light, and the turn order chips about 4:1.
  • The Game accent ends on the app accent held steady instead of the pulsing chat button color, so warnings never pulse and draw at full strength. Presets with their own control color (Dottore, Prof. Mari, custom border) look the same as before.
  • Black tints follow the style's background only inside a section. A section's own shadow stays dark, as on Roleplay's dialogs.
  • Icons inside a section take the control color, as on every chat surface. Amber icons, which mark warnings, take the steady accent. The #7604 description said "party, enemy and element colors stay" for icons too; that was not what it did, and icons now match the rest of the chat.
  • Start combat, Remove party member, the party card choice, Delete journal entry and Remove widget use the chat dialog style (chatStyle: true), like Roleplay's chat dialogs.
  • The "Local scene helper failed to start" banner (scene-alert), the "Image generation failed" and "Scene analysis failed" retry banners (scene-retry) and the combat weather strip (combat-weather) are Game sections. The storyboard toolbar in the Game controls window follows that window's colors (storyboard-controls).
  • With Default and every switch off, nothing changes: desktop screenshots of every Game section match staging apart from the QTE timer digits.

Technical summary:

  • chat-widget-surfaces.css: --mari-game-accent resolves --mari-chat-control-color → --mari-window-control-color → custom border → --mari-widget-accent → --marinara-app-accent-static, for both sections and window content. The section remap adds --color-<hue>-{50…400}: color-mix(in oklab, var(--color-<hue>-600) 15–55%, var(--mari-game-text)). A ponytail: note says a new hue needs its rows. --color-black moves to the section's children; for window content it stays on the element itself, since that has no shadow over the scene. svg[class*=" text-amber-"] inside a section reverts to its own class color, which is the steady accent. New outline defaults cover combat-weather, scene-alert and scene-retry.
  • CombatWeatherSummary.tsx, GameSurface.tsx (three banners, two confirm dialogs, the party card choice), GameJournal.tsx, GameWidgetPanel.tsx, StoryboardBackgroundControls.tsx: the shared classes and data-game-section names, or chatStyle: true.
  • e2e/game-widget-style.e2e.ts: the fixture now carries an Inventory item. Under Apply preset colors the test checks content inside the Inventory: the quantity badge's white text equals the widget text color, the amber item letter equals the control color, black inside follows the background, and the section's own black stays black. With Default and Apply preset colors, the amber letter must be the steady app accent. The classic and tactical combat tests switch to Prof. Mari light and require every pale party, enemy or element text in the combat sections to reach 3:1 against its composited background. Classic combat must check at least one.

Not changed:

  • The Apply switches are still needed for sections outside windows (see the decision below).
  • Text effects such as {bounce:Victory!} keep their hard-coded colors (.anim-text-* in globals.css, with !important). On a light style, the yellow "Victory!" in the classic action bar is hard to read; the same happens in the dialogue box since #7136. These effects are shared with Roleplay, so they need their own change.

Decision for Mari

Game sections outside windows follow the style only with the Apply preset font / shape / colors switches on, like the dialogue box, HUD widgets and character sheets (#7136) and Roleplay's chat surfaces. With only Dottore or Prof. Mari picked and the switches off, the logs, Inventory and combat panels look as they did before; only Game content inside windows (the Journal) changes. If you want the sections to follow the style without the switches, that is a small CSS change.

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

Commands run by the agent (results):

  • pnpm check: passed (one existing lint warning in HomeProfessorMariChat.tsx, unrelated). Without the #7608 commit, staging fails it with 7 × TS2304.
  • pnpm localization:check (part of pnpm check): passed; no new strings.
  • pnpm smoke:ui: 7 passed. The first run lost its dev server after one test (ECONNREFUSED on every later test); the rerun passed.
  • e2e/game-widget-style.e2e.ts on desktop-chromium, mobile-chromium and mobile-webkit: 12 passed.
  • Fails before the fix: four mutations of chat-widget-surfaces.css each make the desktop spec fail on the matching check:
    • section selector removed from the remap: "Inventory white text uses the widget text color" and combat-actions "H" is readable (1.33).
    • old accent chain: "Default amber uses the steady accent".
    • hue rows removed: combat-actions "H" is readable (1.33).
    • black remapped on the section itself: "the Inventory's own shadow stays dark".
  • e2e/game-combat-director.e2e.ts and e2e/game-hybrid-terrain.e2e.ts, which render the weather strip: 10 passed.
  • node scripts/run-regressions.mjs --filter … for the 14 regressions that read the changed files: all passed.
  • Local CodeRabbit on the fix commit: 0 findings.

Manual verification notes

Manual verification still to do:

  • Manually verify classic combat with Prof. Mari in light mode and all three Apply switches on: the turn order chips (Hero, Companion, Guard) and the active hero's initial are readable.
  • Manually verify Default with Apply preset colors and Accent Pulse on: the Inventory's amber item letters and the "encumbered" chip stay one steady accent color.
  • Manually verify the End session and QTE panels with Prof. Mari light: a dark shadow, no cream glow.
  • Manually verify Start combat, Remove party member, Delete journal entry and Remove widget match Roleplay's chat dialogs under each style.
  • Manually verify the party card choice dialog (two characters with the same name joining the party) under Prof. Mari light.
  • Manually verify the image generation and scene analysis retry banners, and the storyboard toolbar in the Game controls window (video storyboard in background mode).
  • Manually verify that with Default and every switch off, Game mode looks exactly as before.

Agent checks (screenshots kept locally, not uploaded): desktop Game sections under Default, Default with switches and Accent Pulse, Prof. Mari light with switches, and Dottore with switches. Default matched staging pixel for pixel apart from the QTE timer digits and a one-pixel anti-aliasing edge in the tactical grid. Also checked: the Start combat and End session dialogs, the forced "Local scene helper failed" banner, and the tactical weather strip in rain. Probed values: Prof. Mari light chips 1.32 → 4.1–4.3, active hero initial 1.33 → 5.5; Default with Accent Pulse, the amber probe was steady at #ec4b97 with full alpha, where before it changed on each of 6 samples at alpha 0.64.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) 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)
  • Version/release files updated (only if this PR includes a version bump)

No docs changes: the guides from #7604 already describe the covered areas and the data-game-section hook.

UI evidence (if applicable)

Before and after screenshots exist locally and are not uploaded.


🔄 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/7610 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/14/2026 **Status:** ✅ Merged **Merged:** 10/14/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/game-hud-widget-style-followup` --- ### 📝 Commits (4) - [`5848944`](https://github.com/Pasta-Devs/Marinara-Engine/commit/584894466b3999d84c3603de010cfac3d610945b) fix(game): keep Game section colors readable and steady under preset colors - [`a185ac3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a185ac3bbae3bc093a5806512da4868ebc173611) Merge branch 'staging' into fix/game-hud-widget-style-followup - [`a2afdce`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a2afdce9f24172ae68d0d9a4c256d7463bfc47f7) Merge branch 'staging' into fix/game-hud-widget-style-followup - [`b8172c3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b8172c394f41ca8c996afeea14cbce6293d10fac) Merge branch 'staging' into fix/game-hud-widget-style-followup ### 📊 Changes **8 files changed** (+251 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `e2e/game-widget-style.e2e.ts` (+117 -0) 📝 `packages/client/src/components/game/CombatWeatherSummary.tsx` (+7 -1) 📝 `packages/client/src/components/game/GameJournal.tsx` (+1 -0) 📝 `packages/client/src/components/game/GameSurface.tsx` (+24 -3) 📝 `packages/client/src/components/game/GameWidgetPanel.tsx` (+1 -0) 📝 `packages/client/src/components/game/StoryboardBackgroundControls.tsx` (+3 -0) 📝 `packages/client/src/lib/chat-widget-colors.ts` (+1 -1) 📝 `packages/client/src/styles/themes/chat-widget-surfaces.css` (+97 -10) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue <!-- Every PR should reference a feature request or issue report. If there isn't one yet, open one first to gather opinions: --> <!-- https://github.com/Pasta-Devs/Marinara-Engine/issues/new/choose --> No linked issue: follow-up to #7604 (maintainer report of 2026-10-14), fixing what the review of #7604 found after it merged. @SpicyMarinara This branch starts with the one-line build fix from #7608, because `staging` does not build without it. Once #7608 merges, only the second commit is new here. ## Why this change <!-- What user problem, bug, or goal does this solve? --> The review of #7604 found these problems with **Apply preset colors** on: - On light styles (Prof. Mari light, Dottore light, light custom backgrounds) the pale blue and red party and enemy colors were nearly invisible. The turn order chips and the active hero's initial measured about 1.3:1 contrast. - With **Default**, the Game accent (the amber that marks warnings, such as "encumbered", the QTE ring and item letters) fell back to the chat button color. That color is the pulsing accent at 64% opacity, so warnings pulsed with Accent Pulse on and looked faded. - A Game section's own black shadow became a light halo on light styles, unlike Roleplay's dialogs. - Start combat, Remove party member, the party card choice, Delete journal entry and Remove widget stayed plain app dialogs, while End session and Interrupt followed the style. The scene helper and retry banners, the combat weather strip and the storyboard toolbar stayed black. - The e2e checked only each section's box, so it still passed when the colors inside a section were not remapped. ## What changed <!-- List the key changes in this PR --> With **Apply preset colors** on (and for Game content inside a window, such as the Journal, whenever a style is chosen): - Pale party, enemy and element colors (red, orange, yellow, green, emerald, cyan, sky, blue, violet, purple, fuchsia and rose, shades 50–400) inside a Game section are mixed toward the style's text color. They keep their hue and stay readable on light and dark styles. The active hero's initial in classic combat now measures 5.5:1 with Prof. Mari light, and the turn order chips about 4:1. - The Game accent ends on the app accent held steady instead of the pulsing chat button color, so warnings never pulse and draw at full strength. Presets with their own control color (Dottore, Prof. Mari, custom border) look the same as before. - Black tints follow the style's background only inside a section. A section's own shadow stays dark, as on Roleplay's dialogs. - Icons inside a section take the control color, as on every chat surface. Amber icons, which mark warnings, take the steady accent. The #7604 description said "party, enemy and element colors stay" for icons too; that was not what it did, and icons now match the rest of the chat. - Start combat, Remove party member, the party card choice, Delete journal entry and Remove widget use the chat dialog style (`chatStyle: true`), like Roleplay's chat dialogs. - The "Local scene helper failed to start" banner (`scene-alert`), the "Image generation failed" and "Scene analysis failed" retry banners (`scene-retry`) and the combat weather strip (`combat-weather`) are Game sections. The storyboard toolbar in the Game controls window follows that window's colors (`storyboard-controls`). - With **Default** and every switch off, nothing changes: desktop screenshots of every Game section match `staging` apart from the QTE timer digits. Technical summary: - `chat-widget-surfaces.css`: `--mari-game-accent` resolves `--mari-chat-control-color` → `--mari-window-control-color` → custom border → `--mari-widget-accent` → `--marinara-app-accent-static`, for both sections and window content. The section remap adds `--color-<hue>-{50…400}: color-mix(in oklab, var(--color-<hue>-600) 15–55%, var(--mari-game-text))`. A `ponytail:` note says a new hue needs its rows. `--color-black` moves to the section's children; for window content it stays on the element itself, since that has no shadow over the scene. `svg[class*=" text-amber-"]` inside a section reverts to its own class color, which is the steady accent. New outline defaults cover `combat-weather`, `scene-alert` and `scene-retry`. - `CombatWeatherSummary.tsx`, `GameSurface.tsx` (three banners, two confirm dialogs, the party card choice), `GameJournal.tsx`, `GameWidgetPanel.tsx`, `StoryboardBackgroundControls.tsx`: the shared classes and `data-game-section` names, or `chatStyle: true`. - `e2e/game-widget-style.e2e.ts`: the fixture now carries an Inventory item. Under Apply preset colors the test checks content inside the Inventory: the quantity badge's white text equals the widget text color, the amber item letter equals the control color, black inside follows the background, and the section's own black stays black. With Default and Apply preset colors, the amber letter must be the steady app accent. The classic and tactical combat tests switch to Prof. Mari light and require every pale party, enemy or element text in the combat sections to reach 3:1 against its composited background. Classic combat must check at least one. Not changed: - The Apply switches are still needed for sections outside windows (see the decision below). - Text effects such as `{bounce:Victory!}` keep their hard-coded colors (`.anim-text-*` in `globals.css`, with `!important`). On a light style, the yellow "Victory!" in the classic action bar is hard to read; the same happens in the dialogue box since #7136. These effects are shared with Roleplay, so they need their own change. ### Decision for Mari Game sections outside windows follow the style only with the **Apply preset font / shape / colors** switches on, like the dialogue box, HUD widgets and character sheets (#7136) and Roleplay's chat surfaces. With only Dottore or Prof. Mari picked and the switches off, the logs, Inventory and combat panels look as they did before; only Game content inside windows (the Journal) changes. If you want the sections to follow the style without the switches, that is a small CSS change. ## Validation <!-- Required: include commands run and/or manual checks performed --> - [ ] `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` Commands run by the agent (results): - `pnpm check`: passed (one existing lint warning in `HomeProfessorMariChat.tsx`, unrelated). Without the #7608 commit, `staging` fails it with 7 × `TS2304`. - `pnpm localization:check` (part of `pnpm check`): passed; no new strings. - `pnpm smoke:ui`: 7 passed. The first run lost its dev server after one test (`ECONNREFUSED` on every later test); the rerun passed. - `e2e/game-widget-style.e2e.ts` on desktop-chromium, mobile-chromium and mobile-webkit: 12 passed. - Fails before the fix: four mutations of `chat-widget-surfaces.css` each make the desktop spec fail on the matching check: - section selector removed from the remap: "Inventory white text uses the widget text color" and `combat-actions "H" is readable` (1.33). - old accent chain: "Default amber uses the steady accent". - hue rows removed: `combat-actions "H" is readable` (1.33). - black remapped on the section itself: "the Inventory's own shadow stays dark". - `e2e/game-combat-director.e2e.ts` and `e2e/game-hybrid-terrain.e2e.ts`, which render the weather strip: 10 passed. - `node scripts/run-regressions.mjs --filter …` for the 14 regressions that read the changed files: all passed. - Local CodeRabbit on the fix commit: 0 findings. ### Manual verification notes <!-- Describe exactly what you tested in a real browser/app, step by step. --> <!-- ⚠️ If an AI agent filled out or ticked these boxes for you, treat them --> <!-- as a TO-DO LIST, not as proof the work is done. Verify each item yourself --> <!-- before submitting. If you haven't verified it, untick the box. --> Manual verification still to do: - Manually verify classic combat with Prof. Mari in light mode and all three Apply switches on: the turn order chips (Hero, Companion, Guard) and the active hero's initial are readable. - Manually verify Default with Apply preset colors and Accent Pulse on: the Inventory's amber item letters and the "encumbered" chip stay one steady accent color. - Manually verify the End session and QTE panels with Prof. Mari light: a dark shadow, no cream glow. - Manually verify Start combat, Remove party member, Delete journal entry and Remove widget match Roleplay's chat dialogs under each style. - Manually verify the party card choice dialog (two characters with the same name joining the party) under Prof. Mari light. - Manually verify the image generation and scene analysis retry banners, and the storyboard toolbar in the Game controls window (video storyboard in background mode). - Manually verify that with Default and every switch off, Game mode looks exactly as before. Agent checks (screenshots kept locally, not uploaded): desktop Game sections under Default, Default with switches and Accent Pulse, Prof. Mari light with switches, and Dottore with switches. Default matched `staging` pixel for pixel apart from the QTE timer digits and a one-pixel anti-aliasing edge in the tactical grid. Also checked: the Start combat and End session dialogs, the forced "Local scene helper failed" banner, and the tactical weather strip in rain. Probed values: Prof. Mari light chips 1.32 → 4.1–4.3, active hero initial 1.33 → 5.5; Default with Accent Pulse, the amber probe was steady at `#ec4b97` with full alpha, where before it changed on each of 6 samples at alpha 0.64. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) 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) - [ ] Version/release files updated (only if this PR includes a version bump) No docs changes: the guides from #7604 already describe the covered areas and the `data-game-section` hook. ## UI evidence (if applicable) <!-- Add before/after screenshots or recordings for UI changes --> Before and after screenshots exist locally and are not uploaded. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:07:58 +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#7833
No description provided.