[PR #262] [MERGED] bugfix: extend light-mode support to RP, mobile toolbar, and dialogue #4532

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/262
Author: @LukaTheHero
Created: 4/27/2026
Status: ✅ Merged
Merged: 4/27/2026
Merged by: @LukaTheHero

Base: main ← Head: fix/light-mode-rp-coverage


📝 Commits (3)

  • be9523b bugfix: Remove hardcoded darkmode
  • 9acc060 Merge branch 'main' into main
  • 03b59be bugfix: extend light-mode support to RP, mobile toolbar, and dialogue

📊 Changes

16 files changed (+323 additions, -289 deletions)

View changed files

📝 packages/client/src/components/chat/ChatInput.tsx (+3 -3)
📝 packages/client/src/components/chat/ChatMessage.tsx (+15 -5)
📝 packages/client/src/components/chat/ChatRoleplaySurface.tsx (+14 -9)
📝 packages/client/src/components/chat/ConversationInput.tsx (+3 -3)
📝 packages/client/src/components/chat/ConversationMessage.tsx (+4 -4)
📝 packages/client/src/components/chat/ConversationView.tsx (+24 -28)
📝 packages/client/src/components/chat/CyoaChoices.tsx (+10 -10)
📝 packages/client/src/components/chat/EncounterModal.tsx (+58 -58)
📝 packages/client/src/components/chat/HomeFaq.tsx (+17 -17)
📝 packages/client/src/components/chat/RoleplayHUD.tsx (+24 -24)
📝 packages/client/src/components/chat/RoleplayHUDPanels.tsx (+72 -70)
📝 packages/client/src/components/game/GameInput.tsx (+14 -14)
📝 packages/client/src/components/game/GameNarration.tsx (+29 -24)
📝 packages/client/src/components/game/GameSetupWizard.tsx (+3 -3)
📝 packages/client/src/components/game/GameSurface.tsx (+16 -14)
📝 packages/client/src/styles/globals.css (+17 -3)

📄 Description

Why this change

Builds on @Javedz678's work in #217. The original PR scoped the roleplay surface as "always dark" and intentionally kept hardcoded white/black overrides in that area. That worked for conversation mode but left light mode unusable inside RP: message text was invisible, dialogue rendered as ghost-outlined letters (white fill + dark text-stroke on a light bg), the mobile toolbar collapsed into a column of black circles, the message action icons (trash / branch / flag / refresh / pencil / translate / copy) disappeared, and the conversation surface had no visible contrast against the page bg.

This PR keeps Javedz's commits and stacks the additional theme-aware conversions on top.

What changed

CSS

  • .rpg-chat-area now uses var(--background) instead of #0a0a0f.
  • Removed the .rpg-chat-area .mari-message-content { color: #d4d4d4 } override so message body text follows --foreground in both themes.
  • Added [data-theme=\"light\"] variants for .rpg-overlay and .rpg-vignette (warm-white gradient + faint purple radial instead of forcing dark).

ChatMessage

  • Bubble RGB is now theme-aware (dark mode keeps neutral-900 translucent; light mode uses a slightly tinted lavender so bubbles contrast the page).
  • Dialogue color fallback was hardcoded text-white — now text-black dark:text-white so quoted text reads correctly in light mode (Tailwind v4 dark: is wired to data-theme=\"dark\" via the @custom-variant in globals.css).
  • ActionBtn "dark" variant was text-white/40 hover:bg-white/10 hover:text-white/70 — swapped for text-foreground/40 hover:bg-foreground/10 hover:text-foreground/70. This is what restores the row of message-action icons in light-mode RP.

Component white→foreground swaps

  • ChatRoleplaySurface.tsx, RoleplayHUD.tsx, EncounterModal.tsx, ChatInput.tsx: ~120 instances of bg-white/X, text-white/X, border-white/X swapped to the foreground/X equivalents so they invert with the theme.
  • ChatInput: bg-black/40 input bar and bg-black/80 slash-completion popup → bg-[var(--card)].

Mobile

  • ChatRoleplaySurface ToolbarMenu: mobile trigger button and the collapsed popover panel were bg-black/40 and bg-black/80 — swapped for bg-[var(--card)] so the column of collapsed toolbar buttons is visible in mobile light mode.
  • Load More button got the same treatment.

Conversation tint

  • ConversationView: when the user has the default dark gradient and theme is light, the surface now uses var(--secondary) (a tinted lavender) instead of falling through to --background. This gives the chat surface the same subtle contrast-vs-page bg that RP has.

Validation

  • pnpm check passes
  • Manual: tested in browser (desktop + mobile viewport) in both light and dark mode across CONVO and RP. Confirmed message bubbles, dialogue text, toolbar icons, action buttons, mobile collapsed toolbar, and chat-surface tint all read correctly in both themes.
  • Confirmed Javedz's original conversation-mode fixes still work in CONVO.
  • Confirmed dark mode is unchanged (the dark: variants and theme-keyed CSS overrides only kick in for [data-theme=\"light\"]).

Credit

Original light-mode support work is @Javedz678's in #217 — those commits are preserved on this branch with their authorship intact. This PR extends the same approach into the areas that were intentionally left as "always dark."

Summary by CodeRabbit

  • Style
    • Updated chat, game, and UI component styling to use theme-aware CSS variables instead of hardcoded colors throughout the application.
    • Enhanced light and dark mode support with improved color consistency and better theme responsiveness.
    • Refined styling for message bubbles, input fields, buttons, panels, modals, and various controls for improved visual cohesion.

🔄 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/262 **Author:** [@LukaTheHero](https://github.com/LukaTheHero) **Created:** 4/27/2026 **Status:** ✅ Merged **Merged:** 4/27/2026 **Merged by:** [@LukaTheHero](https://github.com/LukaTheHero) **Base:** `main` ← **Head:** `fix/light-mode-rp-coverage` --- ### 📝 Commits (3) - [`be9523b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/be9523becfa9ae067d2e5feb3ab36ae88845e7cd) bugfix: Remove hardcoded darkmode - [`9acc060`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9acc060fca500d25911c85d4aa8773866bef8401) Merge branch 'main' into main - [`03b59be`](https://github.com/Pasta-Devs/Marinara-Engine/commit/03b59be242de0e0abf26f4f85ed4419bae31d215) bugfix: extend light-mode support to RP, mobile toolbar, and dialogue ### 📊 Changes **16 files changed** (+323 additions, -289 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/chat/ChatInput.tsx` (+3 -3) 📝 `packages/client/src/components/chat/ChatMessage.tsx` (+15 -5) 📝 `packages/client/src/components/chat/ChatRoleplaySurface.tsx` (+14 -9) 📝 `packages/client/src/components/chat/ConversationInput.tsx` (+3 -3) 📝 `packages/client/src/components/chat/ConversationMessage.tsx` (+4 -4) 📝 `packages/client/src/components/chat/ConversationView.tsx` (+24 -28) 📝 `packages/client/src/components/chat/CyoaChoices.tsx` (+10 -10) 📝 `packages/client/src/components/chat/EncounterModal.tsx` (+58 -58) 📝 `packages/client/src/components/chat/HomeFaq.tsx` (+17 -17) 📝 `packages/client/src/components/chat/RoleplayHUD.tsx` (+24 -24) 📝 `packages/client/src/components/chat/RoleplayHUDPanels.tsx` (+72 -70) 📝 `packages/client/src/components/game/GameInput.tsx` (+14 -14) 📝 `packages/client/src/components/game/GameNarration.tsx` (+29 -24) 📝 `packages/client/src/components/game/GameSetupWizard.tsx` (+3 -3) 📝 `packages/client/src/components/game/GameSurface.tsx` (+16 -14) 📝 `packages/client/src/styles/globals.css` (+17 -3) </details> ### 📄 Description ## Why this change Builds on @Javedz678's work in #217. The original PR scoped the roleplay surface as "always dark" and intentionally kept hardcoded white/black overrides in that area. That worked for conversation mode but left **light mode unusable inside RP**: message text was invisible, dialogue rendered as ghost-outlined letters (white fill + dark text-stroke on a light bg), the mobile toolbar collapsed into a column of black circles, the message action icons (trash / branch / flag / refresh / pencil / translate / copy) disappeared, and the conversation surface had no visible contrast against the page bg. This PR keeps Javedz's commits and stacks the additional theme-aware conversions on top. ## What changed ### CSS - `.rpg-chat-area` now uses `var(--background)` instead of `#0a0a0f`. - Removed the `.rpg-chat-area .mari-message-content { color: #d4d4d4 }` override so message body text follows `--foreground` in both themes. - Added `[data-theme=\"light\"]` variants for `.rpg-overlay` and `.rpg-vignette` (warm-white gradient + faint purple radial instead of forcing dark). ### ChatMessage - Bubble RGB is now theme-aware (dark mode keeps neutral-900 translucent; light mode uses a slightly tinted lavender so bubbles contrast the page). - Dialogue color fallback was hardcoded `text-white` — now `text-black dark:text-white` so quoted text reads correctly in light mode (Tailwind v4 `dark:` is wired to `data-theme=\"dark\"` via the `@custom-variant` in `globals.css`). - `ActionBtn` \"dark\" variant was `text-white/40 hover:bg-white/10 hover:text-white/70` — swapped for `text-foreground/40 hover:bg-foreground/10 hover:text-foreground/70`. This is what restores the row of message-action icons in light-mode RP. ### Component white→foreground swaps - `ChatRoleplaySurface.tsx`, `RoleplayHUD.tsx`, `EncounterModal.tsx`, `ChatInput.tsx`: ~120 instances of `bg-white/X`, `text-white/X`, `border-white/X` swapped to the `foreground/X` equivalents so they invert with the theme. - `ChatInput`: `bg-black/40` input bar and `bg-black/80` slash-completion popup → `bg-[var(--card)]`. ### Mobile - `ChatRoleplaySurface` `ToolbarMenu`: mobile trigger button and the collapsed popover panel were `bg-black/40` and `bg-black/80` — swapped for `bg-[var(--card)]` so the column of collapsed toolbar buttons is visible in mobile light mode. - `Load More` button got the same treatment. ### Conversation tint - `ConversationView`: when the user has the default dark gradient and theme is light, the surface now uses `var(--secondary)` (a tinted lavender) instead of falling through to `--background`. This gives the chat surface the same subtle contrast-vs-page bg that RP has. ## Validation - [x] `pnpm check` passes - [x] Manual: tested in browser (desktop + mobile viewport) in **both** light and dark mode across CONVO and RP. Confirmed message bubbles, dialogue text, toolbar icons, action buttons, mobile collapsed toolbar, and chat-surface tint all read correctly in both themes. - [x] Confirmed Javedz's original conversation-mode fixes still work in CONVO. - [x] Confirmed dark mode is unchanged (the `dark:` variants and theme-keyed CSS overrides only kick in for `[data-theme=\"light\"]`). ## Credit Original light-mode support work is @Javedz678's in #217 — those commits are preserved on this branch with their authorship intact. This PR extends the same approach into the areas that were intentionally left as \"always dark.\" <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Style** * Updated chat, game, and UI component styling to use theme-aware CSS variables instead of hardcoded colors throughout the application. * Enhanced light and dark mode support with improved color consistency and better theme responsiveness. * Refined styling for message bubbles, input fields, buttons, panels, modals, and various controls for improved visual cohesion. <!-- 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:08:28 +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#4532
No description provided.