[PR #7604] [MERGED] fix(game): HUD sections follow the Chat widget style #7830

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

📋 Pull Request Information

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

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


📝 Commits (4)

  • 7850c85 fix(game): HUD sections follow the Chat widget style
  • eee1406 fix(game): keep element colors in Game sections under preset colors
  • 9261fa6 docs(game): split the Apply preset coverage into short sentences
  • 2e94113 Merge branch 'staging' into fix/game-hud-widget-style

📊 Changes

25 files changed (+638 additions, -49 deletions)

View changed files

📝 docs/appearance/appearance-settings.md (+1 -1)
📝 docs/appearance/custom-css-themes.md (+6 -2)
📝 e2e/game-widget-style.e2e.ts (+243 -2)
📝 packages/client/src/components/game/CombatAiControls.tsx (+11 -1)
📝 packages/client/src/components/game/DirectedCombatUI.tsx (+4 -0)
📝 packages/client/src/components/game/GameChoiceCards.tsx (+8 -1)
📝 packages/client/src/components/game/GameCombatUI.tsx (+48 -7)
📝 packages/client/src/components/game/GameElementReaction.tsx (+3 -1)
📝 packages/client/src/components/game/GameInventory.tsx (+8 -1)
📝 packages/client/src/components/game/GameJournal.tsx (+11 -6)
📝 packages/client/src/components/game/GameJsonRepairModal.tsx (+2 -0)
📝 packages/client/src/components/game/GameNarration.tsx (+7 -3)
📝 packages/client/src/components/game/GameQteOverlay.tsx (+8 -1)
📝 packages/client/src/components/game/GameSessionReplay.tsx (+31 -5)
📝 packages/client/src/components/game/GameStoryboardViewer.tsx (+8 -1)
📝 packages/client/src/components/game/GameSurface.tsx (+10 -3)
📝 packages/client/src/components/game/GameWidgetPanel.tsx (+9 -1)
📝 packages/client/src/components/game/RulesetCombatBoard.tsx (+17 -3)
📝 packages/client/src/components/game/RulesetItemPicker.tsx (+2 -0)
📝 packages/client/src/components/game/StartingGearPicker.tsx (+2 -0)

...and 5 more files

📄 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: reported by the maintainer on 2026-10-14.

Why this change

  • In Game mode, the logs, the Inventory, the combat screens and most other Game panels ignored the Chat widget style. With Dottore, Prof. Mari or custom colors chosen, they stayed black with amber highlights, while the Game dialogue box, HUD widgets, map and character sheets next to them took the chosen font, frame shape and colors.
  • With Prof. Mari's light style, the Journal in the Session window was unreadable: white text on the light window.

What changed

With Apply preset font, Apply preset shape and Apply preset colors on, these Game sections now take the Chat widget style, like the dialogue box, HUD widgets and character sheets already do (custom colors and gradients included):

  • Session Logs and the combat logs windows.
  • The Inventory, plus its starting gear and item pickers.
  • Classic combat: the action bar (the bottom sheet and its drawer on phones), the round counter, the turn order, the "resolving" banners, and the Logs and Previous Turn buttons.
  • Tactical combat: the phase bar and turn order, the action card, the combat log drawer, the flee and restart confirmations, and the tile card.
  • Party control and combat styles where it stands on its own, the ruleset combat board strips and the directed combat strip.
  • Choice cards, quick-time events, element reactions, the storyboard viewer, the Session Replay panels and its leave button, and the Town and Overworld place cards.
  • Game dialogs: Attempt to interrupt, End session, Repair JSON and the HUD widget editors use the same chat dialog look as Roleplay's chat dialogs.
  • The Journal (Timeline, NPCs, Quests and the other tabs) in the Session window now follows the window's own style, so it is readable with every preset.
  • The Inventory count badge on the dialogue box stays readable with Apply preset colors.
  • With Default and every switch off, nothing changes (checked pixel for pixel against staging).

Technical summary:

  • chat-widget-colors.ts: GAME_SECTION_CLASS (mari-chat-style-surface mari-game-section), GAME_WINDOW_CONTENT_CLASS (mari-game-section) and GAME_DIALOG_CLASS (Roleplay's mari-chat-style-surface mari-chat-action-panel plus mari-game-section). Each panel also gets a data-game-section name for custom themes. No section is nested directly inside another.
  • chat-widget-surfaces.css: a Game section reuses the action panel's palette aliases. Under Apply preset colors its Tailwind white, black, amber and zinc tints map to the style's text, background and control colors, so existing markup follows without new palette classes. Text keeps each element's own color (muted labels, party and enemy colors); fallback name colors in the logs still follow the preset text, as on other chat surfaces (#7296). Game content in a window maps the same tints to the window palette whenever a preset or custom color is set. Under cut corners a section keeps its own fill (revert-layer), clipped to the frame, so gradients and scrolling content are not lost; under Shape alone the frame outline uses each section's own outline color. A ponytail: note covers the two sections that scroll themselves.
  • Not changed, with reasons: the dice and skill-check cards (shared dice component with its own card art, also used in Roleplay messages), readable notes and books (in-world document art), the combat stage itself (combatant cards, HP/MP bars, damage numbers, party and enemy speech, boss mechanic cards, intro and victory overlays), the inventory gain/loss toasts, transition cinematics, the setup wizard, the shared image prompt review dialog, and sections drawn by agent packages (those live in Pasta-Devs/Marinara-Agents).
  • Docs: docs/appearance/appearance-settings.md and docs/appearance/custom-css-themes.md list the new Game areas and the theme hooks.
  • e2e/game-widget-style.e2e.ts (extended): the Session Logs and Inventory join the measured surfaces (Default, preset alone, each switch, custom gradients, gradient accent, back to Default), the Journal must use the window text under a preset and white under Default, and new classic and tactical combat tests check that the panels carry the shared classes and take the Dottore font, cut corners, colors and custom gradients, then return to the staging look.

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).
  • pnpm localization:check: passed (no new strings).
  • pnpm smoke:ui: 7 passed.
  • pnpm exec playwright test e2e/game-widget-style.e2e.ts on desktop-chromium, mobile-chromium and mobile-webkit: 12 passed.
  • Fail before the fix: with the source changes reversed, all 4 desktop tests fail (missing Journal and combat sections). With only the class constants emptied, they fail on "the Journal uses the window text", "logs uses the chat font" and "combat-round carries the shared chat style classes".
  • node scripts/run-regressions.mjs --filter … for the 42 regressions that read the changed files (game inventory, ruleset combat and items, floating window, chat window icons, chat widget style persistence, prompt and others): all passed.
  • Local CodeRabbit (3 runs): see the review notes below.

Manual verification notes

Manual verification still to do:

  • Manually verify in a Game chat with Dottore, Prof. Mari and a custom style (all three Apply switches on) that the Session Logs, Inventory and combat panels match the dialogue box and the chat windows.
  • Manually verify classic, tactical and ruleset combat with Dottore and Apply preset shape: cut corners on the action bar, round counter, tactical bars and cards, and nothing clipped that should show.
  • Manually verify the Journal tabs in the Session window are readable with Prof. Mari in light mode.
  • Manually verify the Attempt to interrupt, End session and Repair JSON dialogs with Apply preset colors on, in light and dark mode.
  • Manually verify on a phone that the combat bottom sheet and its drawers follow the style and still scroll.
  • Manually verify that with Default and every switch off, Game mode looks exactly as before.

Agent checks: before and after screenshots (desktop Default, Dottore, Dottore with the switches, Prof. Mari, Prof. Mari with the switches, and a custom gradient; plus phone shots) exist locally and were compared; Default renders pixel-identical to staging.

Local CodeRabbit notes:

  • Fixed: the inline fallback color rule also caught an element reaction's multiplier badge; it now applies to the logs only.
  • Fixed: the docs sentences listing the Game areas were split into short sentences.
  • Follow-up: [docs-i18n] issue #7603 for the two edited guides.
  • Not changed: "replace the slate backgrounds in TacticalCombatUI with black" and "replace the amber Previous Turn classes". These are existing classes. Under Apply preset colors the section's own background, border and text are replaced by the style, and swapping slate for black would change the Default look this PR must keep.
  • Not changed: "use data-game-section locators in the e2e". The test finds the dialogs the way a player sees them, so it still fails if a section loses its attribute or classes; the suite runs in English like the rest of the e2e specs.
  • Not changed: "data-game-section is an internal term in a guide". It sits in the custom CSS reference table, next to the other class names.

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)

Docs updated: docs/appearance/appearance-settings.md, docs/appearance/custom-css-themes.md. Translation follow-up: #7603.

UI evidence (if applicable)

Before and after screenshots of every Game section (desktop and phone; Default, Dottore, Prof. Mari and a custom gradient, with and without the Apply switches) exist locally and are not uploaded.

Summary by CodeRabbit

  • New Features
    • Chat preset font, shape, and color settings now extend across additional Game Mode areas, including logs, Inventory, combat panels, dialogs, and other in-game surfaces.
    • Custom CSS theme guidance now documents the expanded styling coverage and related selectors.
  • Bug Fixes
    • Game Mode sections and dialogs now consistently reflect applicable chat styling settings, including colors, fonts, shapes, and gradients, while retaining their established fills and borders.

🔄 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/7604 **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` --- ### 📝 Commits (4) - [`7850c85`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7850c85687617ab81187234057dc9476f6cf29c6) fix(game): HUD sections follow the Chat widget style - [`eee1406`](https://github.com/Pasta-Devs/Marinara-Engine/commit/eee1406459d288ee9ad3ac0754c932090cacd9dc) fix(game): keep element colors in Game sections under preset colors - [`9261fa6`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9261fa657c1f59f3e96b3e0fd9c1dfde82a2b821) docs(game): split the Apply preset coverage into short sentences - [`2e94113`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2e94113c0455bf43208c2c92b83246b88e44bb8f) Merge branch 'staging' into fix/game-hud-widget-style ### 📊 Changes **25 files changed** (+638 additions, -49 deletions) <details> <summary>View changed files</summary> 📝 `docs/appearance/appearance-settings.md` (+1 -1) 📝 `docs/appearance/custom-css-themes.md` (+6 -2) 📝 `e2e/game-widget-style.e2e.ts` (+243 -2) 📝 `packages/client/src/components/game/CombatAiControls.tsx` (+11 -1) 📝 `packages/client/src/components/game/DirectedCombatUI.tsx` (+4 -0) 📝 `packages/client/src/components/game/GameChoiceCards.tsx` (+8 -1) 📝 `packages/client/src/components/game/GameCombatUI.tsx` (+48 -7) 📝 `packages/client/src/components/game/GameElementReaction.tsx` (+3 -1) 📝 `packages/client/src/components/game/GameInventory.tsx` (+8 -1) 📝 `packages/client/src/components/game/GameJournal.tsx` (+11 -6) 📝 `packages/client/src/components/game/GameJsonRepairModal.tsx` (+2 -0) 📝 `packages/client/src/components/game/GameNarration.tsx` (+7 -3) 📝 `packages/client/src/components/game/GameQteOverlay.tsx` (+8 -1) 📝 `packages/client/src/components/game/GameSessionReplay.tsx` (+31 -5) 📝 `packages/client/src/components/game/GameStoryboardViewer.tsx` (+8 -1) 📝 `packages/client/src/components/game/GameSurface.tsx` (+10 -3) 📝 `packages/client/src/components/game/GameWidgetPanel.tsx` (+9 -1) 📝 `packages/client/src/components/game/RulesetCombatBoard.tsx` (+17 -3) 📝 `packages/client/src/components/game/RulesetItemPicker.tsx` (+2 -0) 📝 `packages/client/src/components/game/StartingGearPicker.tsx` (+2 -0) _...and 5 more files_ </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: reported by the maintainer on 2026-10-14. ## Why this change <!-- What user problem, bug, or goal does this solve? --> - In Game mode, the logs, the Inventory, the combat screens and most other Game panels ignored the Chat widget style. With Dottore, Prof. Mari or custom colors chosen, they stayed black with amber highlights, while the Game dialogue box, HUD widgets, map and character sheets next to them took the chosen font, frame shape and colors. - With Prof. Mari's light style, the Journal in the Session window was unreadable: white text on the light window. ## What changed <!-- List the key changes in this PR --> With **Apply preset font**, **Apply preset shape** and **Apply preset colors** on, these Game sections now take the Chat widget style, like the dialogue box, HUD widgets and character sheets already do (custom colors and gradients included): - **Session Logs** and the **combat logs** windows. - The **Inventory**, plus its starting gear and item pickers. - **Classic combat**: the action bar (the bottom sheet and its drawer on phones), the round counter, the turn order, the "resolving" banners, and the **Logs** and **Previous Turn** buttons. - **Tactical combat**: the phase bar and turn order, the action card, the combat log drawer, the flee and restart confirmations, and the tile card. - **Party control and combat styles** where it stands on its own, the **ruleset combat** board strips and the **directed combat** strip. - **Choice cards**, **quick-time events**, **element reactions**, the **storyboard viewer**, the **Session Replay** panels and its leave button, and the **Town** and **Overworld** place cards. - Game dialogs: **Attempt to interrupt**, **End session**, **Repair JSON** and the HUD widget editors use the same chat dialog look as Roleplay's chat dialogs. - The **Journal** (Timeline, NPCs, Quests and the other tabs) in the Session window now follows the window's own style, so it is readable with every preset. - The Inventory count badge on the dialogue box stays readable with Apply preset colors. - With **Default** and every switch off, nothing changes (checked pixel for pixel against `staging`). Technical summary: - `chat-widget-colors.ts`: `GAME_SECTION_CLASS` (`mari-chat-style-surface mari-game-section`), `GAME_WINDOW_CONTENT_CLASS` (`mari-game-section`) and `GAME_DIALOG_CLASS` (Roleplay's `mari-chat-style-surface mari-chat-action-panel` plus `mari-game-section`). Each panel also gets a `data-game-section` name for custom themes. No section is nested directly inside another. - `chat-widget-surfaces.css`: a Game section reuses the action panel's palette aliases. Under Apply preset colors its Tailwind white, black, amber and zinc tints map to the style's text, background and control colors, so existing markup follows without new palette classes. Text keeps each element's own color (muted labels, party and enemy colors); fallback name colors in the logs still follow the preset text, as on other chat surfaces (#7296). Game content in a window maps the same tints to the window palette whenever a preset or custom color is set. Under cut corners a section keeps its own fill (`revert-layer`), clipped to the frame, so gradients and scrolling content are not lost; under Shape alone the frame outline uses each section's own outline color. A `ponytail:` note covers the two sections that scroll themselves. - Not changed, with reasons: the dice and skill-check cards (shared dice component with its own card art, also used in Roleplay messages), readable notes and books (in-world document art), the combat stage itself (combatant cards, HP/MP bars, damage numbers, party and enemy speech, boss mechanic cards, intro and victory overlays), the inventory gain/loss toasts, transition cinematics, the setup wizard, the shared image prompt review dialog, and sections drawn by agent packages (those live in Pasta-Devs/Marinara-Agents). - Docs: `docs/appearance/appearance-settings.md` and `docs/appearance/custom-css-themes.md` list the new Game areas and the theme hooks. - `e2e/game-widget-style.e2e.ts` (extended): the Session Logs and Inventory join the measured surfaces (Default, preset alone, each switch, custom gradients, gradient accent, back to Default), the Journal must use the window text under a preset and white under Default, and new classic and tactical combat tests check that the panels carry the shared classes and take the Dottore font, cut corners, colors and custom gradients, then return to the staging look. ## 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). - `pnpm localization:check`: passed (no new strings). - `pnpm smoke:ui`: 7 passed. - `pnpm exec playwright test e2e/game-widget-style.e2e.ts` on desktop-chromium, mobile-chromium and mobile-webkit: 12 passed. - Fail before the fix: with the source changes reversed, all 4 desktop tests fail (missing Journal and combat sections). With only the class constants emptied, they fail on "the Journal uses the window text", "logs uses the chat font" and "combat-round carries the shared chat style classes". - `node scripts/run-regressions.mjs --filter …` for the 42 regressions that read the changed files (game inventory, ruleset combat and items, floating window, chat window icons, chat widget style persistence, prompt and others): all passed. - Local CodeRabbit (3 runs): see the review notes below. ### 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 in a Game chat with Dottore, Prof. Mari and a custom style (all three Apply switches on) that the Session Logs, Inventory and combat panels match the dialogue box and the chat windows. - Manually verify classic, tactical and ruleset combat with Dottore and Apply preset shape: cut corners on the action bar, round counter, tactical bars and cards, and nothing clipped that should show. - Manually verify the Journal tabs in the Session window are readable with Prof. Mari in light mode. - Manually verify the Attempt to interrupt, End session and Repair JSON dialogs with Apply preset colors on, in light and dark mode. - Manually verify on a phone that the combat bottom sheet and its drawers follow the style and still scroll. - Manually verify that with Default and every switch off, Game mode looks exactly as before. Agent checks: before and after screenshots (desktop Default, Dottore, Dottore with the switches, Prof. Mari, Prof. Mari with the switches, and a custom gradient; plus phone shots) exist locally and were compared; Default renders pixel-identical to `staging`. Local CodeRabbit notes: - Fixed: the inline fallback color rule also caught an element reaction's multiplier badge; it now applies to the logs only. - Fixed: the docs sentences listing the Game areas were split into short sentences. - Follow-up: `[docs-i18n]` issue #7603 for the two edited guides. - Not changed: "replace the slate backgrounds in TacticalCombatUI with black" and "replace the amber Previous Turn classes". These are existing classes. Under Apply preset colors the section's own background, border and text are replaced by the style, and swapping slate for black would change the Default look this PR must keep. - Not changed: "use `data-game-section` locators in the e2e". The test finds the dialogs the way a player sees them, so it still fails if a section loses its attribute or classes; the suite runs in English like the rest of the e2e specs. - Not changed: "`data-game-section` is an internal term in a guide". It sits in the custom CSS reference table, next to the other class names. ## 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) Docs updated: `docs/appearance/appearance-settings.md`, `docs/appearance/custom-css-themes.md`. Translation follow-up: #7603. ## UI evidence (if applicable) <!-- Add before/after screenshots or recordings for UI changes --> Before and after screenshots of every Game section (desktop and phone; Default, Dottore, Prof. Mari and a custom gradient, with and without the Apply switches) exist locally and are not uploaded. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Chat preset font, shape, and color settings now extend across additional Game Mode areas, including logs, Inventory, combat panels, dialogs, and other in-game surfaces. * Custom CSS theme guidance now documents the expanded styling coverage and related selectors. * **Bug Fixes** * Game Mode sections and dialogs now consistently reflect applicable chat styling settings, including colors, fonts, shapes, and gradients, while retaining their established fills and borders. <!-- 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:07:57 +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#7830
No description provided.