[GH-ISSUE #2150] [Issue]: Game mode — legacy Narration: / Dialogue [Name]: formats no longer parsed (display + segment-edit divergence) #1061

Closed
opened 2026-10-21 05:26:05 +07:00 by bsakaguchi · 0 comments
Owner

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

Originally assigned to: @cha1latte on GitHub.

Summary

Severity: minor (affects pre-existing legacy histories). The narration display parser dropped the legacy Narration: and Dialogue [Name] [expr]: formats. Old saved turns render with leaked prefixes and lose their speaker box/sprite — and because the engine's edit parser still recognizes those formats, display and edit segment indices diverge, so edit/delete/interrupt can target the wrong segment.

Expected behavior

As in main: parseNarrationSegments and truncateMessageContentAtSegment recognize Narration: text and Dialogue [Name] [expr]: "text" (alongside the compact [Name] [expr]: form), matching the engine's segment-edits.ts parser.

Actual behavior

The two client parsers keep only compactDialogueRegex (which requires a leading [), so a legacy Dialogue [Alice] [happy]: "Hi" line falls through to raw narration with the prefix leaked, and Narration: lines leak their prefix. Meanwhile segment-edits.ts still emits these as distinct segments, so the display segment list and the edit segment list no longer share indices.

Steps to reproduce

  1. Open a game chat whose saved history contains Narration: ... and/or Dialogue [Name] [expr]: "..." lines (old prompt format).
  2. Display: the dialogue line shows as flat narration with the literal Dialogue [Name] [expr]: prefix (no speaker box/sprite); the narration line leaks Narration:.
  3. Edit/delete/interrupt a segment near those lines -> the wrong segment is changed/truncated.

Impact area

  • Game mode

Environment

  • Branch or commit: refactor @ 14894608
  • Run mode: Tauri desktop
  • Compared against: main @ c49f1d95 (legacy web app)

Regression notes

Worked in the legacy web app.

  • main: packages/client/src/components/game/GameNarration.tsx:5316-5319 (legacy regexes), used at :5416-5456 and in truncateMessageContentAtSegment :5495-5523.
  • refactor: src/features/modes/game/components/GameNarration.tsx:5174-5175/:5330 keep only compactDialogueRegex; engine src/engine/modes/game/state/segment-edits.ts:233-234 still matches legacy forms. Fix: restore the legacy regexes in both client parsers (or drop them from segment-edits.ts so all three agree).
Originally created by @Romuromylus on GitHub (Jun 4, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2150 Originally assigned to: @cha1latte on GitHub. ## Summary **Severity: minor (affects pre-existing legacy histories).** The narration display parser dropped the legacy `Narration:` and `Dialogue [Name] [expr]:` formats. Old saved turns render with leaked prefixes and lose their speaker box/sprite — and because the engine's edit parser still recognizes those formats, display and edit segment indices diverge, so edit/delete/interrupt can target the wrong segment. ## Expected behavior As in main: `parseNarrationSegments` and `truncateMessageContentAtSegment` recognize `Narration: text` and `Dialogue [Name] [expr]: "text"` (alongside the compact `[Name] [expr]:` form), matching the engine's `segment-edits.ts` parser. ## Actual behavior The two client parsers keep only `compactDialogueRegex` (which requires a leading `[`), so a legacy `Dialogue [Alice] [happy]: "Hi"` line falls through to raw narration with the prefix leaked, and `Narration:` lines leak their prefix. Meanwhile `segment-edits.ts` still emits these as distinct segments, so the display segment list and the edit segment list no longer share indices. ## Steps to reproduce 1. Open a game chat whose saved history contains `Narration: ...` and/or `Dialogue [Name] [expr]: "..."` lines (old prompt format). 2. Display: the dialogue line shows as flat narration with the literal `Dialogue [Name] [expr]:` prefix (no speaker box/sprite); the narration line leaks `Narration:`. 3. Edit/delete/interrupt a segment near those lines -> the wrong segment is changed/truncated. ## Impact area - [x] Game mode ## Environment - Branch or commit: `refactor` @ `14894608` - Run mode: Tauri desktop - Compared against: `main` @ `c49f1d95` (legacy web app) ## Regression notes Worked in the legacy web app. - main: `packages/client/src/components/game/GameNarration.tsx:5316-5319` (legacy regexes), used at :5416-5456 and in `truncateMessageContentAtSegment` :5495-5523. - refactor: `src/features/modes/game/components/GameNarration.tsx:5174-5175`/:5330 keep only `compactDialogueRegex`; engine `src/engine/modes/game/state/segment-edits.ts:233-234` still matches legacy forms. Fix: restore the legacy regexes in both client parsers (or drop them from `segment-edits.ts` so all three agree).
bsakaguchi 2026-10-21 05:26:05 +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#1061
No description provided.