[PR #6436] [CLOSED] Fix missing portraits for dialogue speakers outside the presence snapshot #7177

Closed
opened 2026-10-23 04:17:15 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6436
Author: @SirAdoni
Created: 9/20/2026
Status: ❌ Closed

Base: staging ← Head: contrib/dialogue-speaker-avatar


📝 Commits (1)

  • 04b1975 Resolve dialogue speaker portraits independently of scene presence

📊 Changes

4 files changed (+134 additions, -24 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 packages/client/src/components/game/GameSurface.tsx (+35 -24)
➕ packages/client/src/components/game/game-speaker-avatar.ts (+31 -0)
➕ scripts/regressions/game-speaker-avatar.regression.ts (+66 -0)

📄 Description

Linked issue

Closes #6430

Why this change

A character can speak before the scene-presence snapshot catches up. Previously, a speaker outside the selected party displayed a placeholder even when a unique character-library card already had an avatar. The portrait should resolve independently of that delayed presence update.

What changed

  • Parse visible assistant narration with the existing dialogue parser and collect its named speakers.
  • Fill missing speaker portraits only when exactly one normalized library name matches and that card has an avatar; retain its saved avatar crop.
  • Preserve explicit experience, selected-character, NPC and persona portrait precedence. Ambiguous names keep the placeholder instead of borrowing another character's image.
  • Add a small resolver regression and an Unreleased changelog entry.

This does not alter presence, character records, generated images, or saved campaign data. It is a focused bug fix separated from the broader portrait-viewer and profile-link contributions.

Validation

Completed on the current staging-based branch: full pnpm check, focused game-speaker-avatar regression, privacy scan and git diff --check. The Windows checkout represented the skills symlink as a text file; validation temporarily materialized its existing target, then restored the original bytes. No skill or environment changes are included.

A generic isolated desktop Chromium component proof exercised a missing-presence speaker, saved crop styling, explicit portrait precedence, and ambiguous-name refusal. It used no private campaign data or provider calls. The committed regression tests the resolver; static assertions separately check production parser/visibility wiring. Full live-campaign reproduction on this standalone branch, mobile, WebKit and container validation remain manual tasks.

This AI-assisted PR remains draft pending those manual checks and review. Boxes below are intentionally left unchecked for the human contributor.

  • 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

Manual verification notes

  • Verify an out-of-party dialogue speaker with a library portrait while the presence snapshot is still old.
  • Verify the saved face crop, selected-character/NPC/persona precedence, and duplicate-name placeholders.
  • Verify Logs and active dialogue in light/dark modes and mobile layouts.
  • Complete required CI and CodeRabbit review before merge.

Docs and release impact

The changelog explains the user-visible fix. No configuration, release version, translated docs, or public API changes.

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

Private campaign screenshots and transcript content are excluded. The browser proof uses synthetic avatars and generic character names.

Summary by CodeRabbit

  • New Features

    • Current-turn dialogue speakers can now display a unique matching library portrait and saved crop, even before appearing in the scene timeline.
    • Existing character and player portraits retain priority.
    • Ambiguous or unmatched speaker names remain without a library portrait.
  • Tests

    • Added regression coverage for portrait precedence, crop preservation, excluded speakers, and ambiguous names.

🔄 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/6436 **Author:** [@SirAdoni](https://github.com/SirAdoni) **Created:** 9/20/2026 **Status:** ❌ Closed **Base:** `staging` ← **Head:** `contrib/dialogue-speaker-avatar` --- ### 📝 Commits (1) - [`04b1975`](https://github.com/Pasta-Devs/Marinara-Engine/commit/04b1975eb508ba3570771a621b27ddc09764e708) Resolve dialogue speaker portraits independently of scene presence ### 📊 Changes **4 files changed** (+134 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `packages/client/src/components/game/GameSurface.tsx` (+35 -24) ➕ `packages/client/src/components/game/game-speaker-avatar.ts` (+31 -0) ➕ `scripts/regressions/game-speaker-avatar.regression.ts` (+66 -0) </details> ### 📄 Description ## Linked issue Closes #6430 ## Why this change A character can speak before the scene-presence snapshot catches up. Previously, a speaker outside the selected party displayed a placeholder even when a unique character-library card already had an avatar. The portrait should resolve independently of that delayed presence update. ## What changed - Parse visible assistant narration with the existing dialogue parser and collect its named speakers. - Fill missing speaker portraits only when exactly one normalized library name matches and that card has an avatar; retain its saved avatar crop. - Preserve explicit experience, selected-character, NPC and persona portrait precedence. Ambiguous names keep the placeholder instead of borrowing another character's image. - Add a small resolver regression and an Unreleased changelog entry. This does not alter presence, character records, generated images, or saved campaign data. It is a focused bug fix separated from the broader portrait-viewer and profile-link contributions. ## Validation Completed on the current staging-based branch: full `pnpm check`, focused `game-speaker-avatar` regression, privacy scan and `git diff --check`. The Windows checkout represented the skills symlink as a text file; validation temporarily materialized its existing target, then restored the original bytes. No skill or environment changes are included. A generic isolated desktop Chromium component proof exercised a missing-presence speaker, saved crop styling, explicit portrait precedence, and ambiguous-name refusal. It used no private campaign data or provider calls. The committed regression tests the resolver; static assertions separately check production parser/visibility wiring. Full live-campaign reproduction on this standalone branch, mobile, WebKit and container validation remain manual tasks. This AI-assisted PR remains draft pending those manual checks and review. Boxes below are intentionally left unchecked for the human contributor. - [ ] `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` ### Manual verification notes - [ ] Verify an out-of-party dialogue speaker with a library portrait while the presence snapshot is still old. - [ ] Verify the saved face crop, selected-character/NPC/persona precedence, and duplicate-name placeholders. - [ ] Verify Logs and active dialogue in light/dark modes and mobile layouts. - [ ] Complete required CI and CodeRabbit review before merge. ## Docs and release impact The changelog explains the user-visible fix. No configuration, release version, translated docs, or public API changes. - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) Private campaign screenshots and transcript content are excluded. The browser proof uses synthetic avatars and generic character names. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Current-turn dialogue speakers can now display a unique matching library portrait and saved crop, even before appearing in the scene timeline. * Existing character and player portraits retain priority. * Ambiguous or unmatched speaker names remain without a library portrait. * **Tests** * Added regression coverage for portrait precedence, crop preservation, excluded speakers, and ambiguous names. <!-- 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-23 04:17:15 +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#7177
No description provided.