[GH-ISSUE #513] [Issue]: Game Mode combat — mobile layout collisions, encounter-trigger timing race, refresh loses combat state, persona name appears as "user" #232

Closed
opened 2026-10-20 17:26:35 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Romuromylus on GitHub (May 7, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/513

Summary

Game Mode combat has four issues, all surfacing during normal play: the encounter overlay either skips or stalls past the GM's pre-fight prose, the mobile layout collides with itself once round-2 panels appear, a page refresh during combat drops the player back into prose narration, and the player's combatant card shows the literal string "User" / "user" instead of the configured persona name.

Expected behavior

  1. When the GM emits a [combat:] or [state: combat] tag, the encounter overlay should open right after the typewriter finishes revealing the GM's pre-fight prose — neither slamming open mid-typewriter nor sitting idle for several seconds afterward.
  2. On mobile (<640px), the combat UI should keep the active player and action panel visible at all times. The current desktop layout (player card, enemy line, dialogue cue bubbles, bottom action panel) competes for the same vertical space and overlaps once round-2 panels render.
  3. A page refresh during a fight should restore the live combat state (party, enemies, HP, mechanics) rather than dropping the player back into prose narration.
  4. The player's combatant card in combat should show the configured persona name (whether the persona was picked globally via the active flag or chat-scoped via chat.personaId).

Actual behavior

  1. Sometimes the encounter overlay opens before any pre-fight prose has been revealed (player can't read what set up the fight). Other times it sits silent for several seconds after the GM typed [combat:] before opening.
  2. On phones, mechanic cards / dialogue cue bubbles / the bottom action panel push each other off-screen as the fight progresses; prior CSS-only tweaks (sprite shrinks, max-h caps, mechanic-card stacking) did not hold up.
  3. F5 during combat reverts to exploration prose — combat party/enemies/blueprint were component-local React state and not persisted.
  4. The player's combatant card shows "User" (or "user" after LLM lowercasing) instead of the persona name.

Steps to reproduce

  1. Open Game Mode and start a chat where the GM is likely to escalate to combat.
  2. Prompt the GM into a fight (the response should contain a [combat: ...] or [state: combat] tag).
  3. Observe whether the encounter overlay opens before the typewriter finishes the pre-fight prose, or stalls after it.
  4. While in combat, resize the browser to <640px (or test on a phone). Cycle through round 1 → round 2 and observe overlap of player card / enemies / dialogue cues / action panel.
  5. While in combat, refresh the page (F5). Observe whether combat state is restored or whether the chat reverts to prose.
  6. With a chat-scoped persona configured (via chat.personaId), enter combat and observe the player combatant's name on the card — it appears as "User" / "user" rather than the persona name.

Environment

  • Marinara Engine version: 1.5.8 (upstream main)
  • Install type: docker
  • OS + version: any
  • Browser or app shell: Chrome desktop + mobile devtools / phone

Logs, screenshots, or video

Image Image

Additional context

  • The combat-trigger timing race appears to be a stale narrationDone === true from the previous turn leaking past the encounter-trigger gate in GameSurface.tsx before the new assistant message's typewriter has a chance to push the value to false.
  • The mobile collision class of bug has been re-attempted three times with progressively tighter responsive CSS; a dedicated mobile render path is the next step.
  • The persona-name bug is in encounter.routes.ts buildPersonaContext — it only consults isActive === "true" and ignores chat.personaId. chats.routes.ts:365-368 already does the right thing (prefer chat persona, fall back to active); the encounter routes need the same.

Fixes are prepared in a follow-up PR.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @Romuromylus on GitHub (May 7, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/513 ## Summary Game Mode combat has four issues, all surfacing during normal play: the encounter overlay either skips or stalls past the GM's pre-fight prose, the mobile layout collides with itself once round-2 panels appear, a page refresh during combat drops the player back into prose narration, and the player's combatant card shows the literal string "User" / "user" instead of the configured persona name. ## Expected behavior 1. When the GM emits a `[combat:]` or `[state: combat]` tag, the encounter overlay should open right after the typewriter finishes revealing the GM's pre-fight prose — neither slamming open mid-typewriter nor sitting idle for several seconds afterward. 2. On mobile (<640px), the combat UI should keep the active player and action panel visible at all times. The current desktop layout (player card, enemy line, dialogue cue bubbles, bottom action panel) competes for the same vertical space and overlaps once round-2 panels render. 3. A page refresh during a fight should restore the live combat state (party, enemies, HP, mechanics) rather than dropping the player back into prose narration. 4. The player's combatant card in combat should show the configured persona name (whether the persona was picked globally via the active flag or chat-scoped via `chat.personaId`). ## Actual behavior 1. Sometimes the encounter overlay opens before any pre-fight prose has been revealed (player can't read what set up the fight). Other times it sits silent for several seconds after the GM typed `[combat:]` before opening. 2. On phones, mechanic cards / dialogue cue bubbles / the bottom action panel push each other off-screen as the fight progresses; prior CSS-only tweaks (sprite shrinks, max-h caps, mechanic-card stacking) did not hold up. 3. F5 during combat reverts to exploration prose — combat party/enemies/blueprint were component-local React state and not persisted. 4. The player's combatant card shows "User" (or "user" after LLM lowercasing) instead of the persona name. ## Steps to reproduce 1. Open Game Mode and start a chat where the GM is likely to escalate to combat. 2. Prompt the GM into a fight (the response should contain a `[combat: ...]` or `[state: combat]` tag). 3. Observe whether the encounter overlay opens before the typewriter finishes the pre-fight prose, or stalls after it. 4. While in combat, resize the browser to <640px (or test on a phone). Cycle through round 1 → round 2 and observe overlap of player card / enemies / dialogue cues / action panel. 5. While in combat, refresh the page (F5). Observe whether combat state is restored or whether the chat reverts to prose. 6. With a chat-scoped persona configured (via `chat.personaId`), enter combat and observe the player combatant's name on the card — it appears as "User" / "user" rather than the persona name. ## Environment - Marinara Engine version: 1.5.8 (upstream main) - Install type: docker - OS + version: any - Browser or app shell: Chrome desktop + mobile devtools / phone ## Logs, screenshots, or video <img width="479" height="829" alt="Image" src="https://github.com/user-attachments/assets/5f4e1a96-5242-4428-bc77-42241cc30fc1" /> <img width="487" height="818" alt="Image" src="https://github.com/user-attachments/assets/0ba70f1b-6be6-4be8-8631-c33e14f3d98e" /> ## Additional context - The combat-trigger timing race appears to be a stale `narrationDone === true` from the previous turn leaking past the encounter-trigger gate in `GameSurface.tsx` before the new assistant message's typewriter has a chance to push the value to false. - The mobile collision class of bug has been re-attempted three times with progressively tighter responsive CSS; a dedicated mobile render path is the next step. - The persona-name bug is in `encounter.routes.ts buildPersonaContext` — it only consults `isActive === "true"` and ignores `chat.personaId`. `chats.routes.ts:365-368` already does the right thing (prefer chat persona, fall back to active); the encounter routes need the same. Fixes are prepared in a follow-up PR. ## Template check - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-20 17:26:35 +07:00
  • closed this issue
  • added the
    bug
    label
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#232
No description provided.