[PR #4455] [MERGED] Preserve Expression Engine sprites across sparse group-chat rounds #6386

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4455
Author: @SpicyMarinara
Created: 8/2/2026
Status: ✅ Merged
Merged: 8/2/2026
Merged by: @SpicyMarinara

Base: staging ← Head: agent/fix-retained-group-chat-sprites


📝 Commits (1)

  • 4bb031a fix: preserve sparse sprite expression state

📊 Changes

5 files changed (+88 additions, -60 deletions)

View changed files

📝 packages/client/src/components/chat/ChatArea.tsx (+11 -29)
📝 packages/client/src/features/tracker-panel/hooks/use-tracker-panel-model.ts (+7 -5)
📝 packages/client/src/features/tracker-panel/lib/sprite-expressions.ts (+0 -26)
➕ packages/client/src/lib/sprite-expression-state.ts (+39 -0)
📝 scripts/regressions/open-issues.regression.ts (+31 -0)

📄 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

Closes #4454

Why this change

  • Expression Engine stores per-turn sprite selections as sparse updates. The Roleplay UI treated the latest message as a complete snapshot, so an empty round—or a round that selected only another character—discarded a character's previously selected full-body sprite and allowed the fallback logic to reset it to neutral.

What changed

  • Fold loaded per-message sprite updates chronologically into cumulative per-character state, preserving omitted characters while allowing explicit later values such as neutral to override them.
  • Reuse the same resolver in the Roleplay stage and Tracker panel, including string-backed message metadata and correctly ordered paginated tracker history.
  • Consolidate duplicate sprite-expression normalization and add regressions for empty rounds, sparse multi-character updates, fallbacks, and explicit neutral resets.

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

Automated verification notes

  • pnpm check — passed (localization, ESLint, TypeScript, server build, production client build).
  • pnpm --filter @marinara-engine/server exec tsx ../../scripts/regressions/open-issues.regression.ts — passed.
  • pnpm smoke:ui — 181 passed, 95 skipped, 4 unrelated failures: stale What's New copy on desktop/mobile, a character-row pointer-interception timeout, and a Roleplay panel-animation timing assertion.

Manual verification notes

  • Manually verify in a Roleplay group chat that character A retains its selected full-body sprite after character B, who has no sprites, responds and Expression Engine selects no sprites for that round.
  • Manually verify that a later explicit expression selection for character A still replaces the retained sprite.

Docs and release impact

  • 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 (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

No user-facing copy, documentation contract, or release metadata changed.

UI evidence (if applicable)

Not included: this is a state-retention correction with no visual layout or styling changes.

Summary by CodeRabbit

  • Bug Fixes

    • Improved sprite expression handling across chat and tracker views.
    • Preserved existing character expressions when later updates omit them.
    • Ensured newer expression updates correctly override older values.
    • Added support for expression data stored in JSON-encoded metadata.
  • Tests

    • Added regression coverage for expression extraction, fallback state, merging, and update precedence.

🔄 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/4455 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 8/2/2026 **Status:** ✅ Merged **Merged:** 8/2/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `agent/fix-retained-group-chat-sprites` --- ### 📝 Commits (1) - [`4bb031a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4bb031a6b601e56aeb2bb3085eb7fb5d9335d936) fix: preserve sparse sprite expression state ### 📊 Changes **5 files changed** (+88 additions, -60 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/chat/ChatArea.tsx` (+11 -29) 📝 `packages/client/src/features/tracker-panel/hooks/use-tracker-panel-model.ts` (+7 -5) 📝 `packages/client/src/features/tracker-panel/lib/sprite-expressions.ts` (+0 -26) ➕ `packages/client/src/lib/sprite-expression-state.ts` (+39 -0) 📝 `scripts/regressions/open-issues.regression.ts` (+31 -0) </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`. ## Linked issue Closes #4454 ## Why this change - Expression Engine stores per-turn sprite selections as sparse updates. The Roleplay UI treated the latest message as a complete snapshot, so an empty round—or a round that selected only another character—discarded a character's previously selected full-body sprite and allowed the fallback logic to reset it to neutral. ## What changed - Fold loaded per-message sprite updates chronologically into cumulative per-character state, preserving omitted characters while allowing explicit later values such as `neutral` to override them. - Reuse the same resolver in the Roleplay stage and Tracker panel, including string-backed message metadata and correctly ordered paginated tracker history. - Consolidate duplicate sprite-expression normalization and add regressions for empty rounds, sparse multi-character updates, fallbacks, and explicit neutral resets. ## 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` ### Automated verification notes - `pnpm check` — passed (localization, ESLint, TypeScript, server build, production client build). - `pnpm --filter @marinara-engine/server exec tsx ../../scripts/regressions/open-issues.regression.ts` — passed. - `pnpm smoke:ui` — 181 passed, 95 skipped, 4 unrelated failures: stale What's New copy on desktop/mobile, a character-row pointer-interception timeout, and a Roleplay panel-animation timing assertion. ### Manual verification notes - Manually verify in a Roleplay group chat that character A retains its selected full-body sprite after character B, who has no sprites, responds and Expression Engine selects no sprites for that round. - Manually verify that a later explicit expression selection for character A still replaces the retained sprite. ## Docs and release impact - [ ] 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 (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) No user-facing copy, documentation contract, or release metadata changed. ## UI evidence (if applicable) Not included: this is a state-retention correction with no visual layout or styling changes. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved sprite expression handling across chat and tracker views. * Preserved existing character expressions when later updates omit them. * Ensured newer expression updates correctly override older values. * Added support for expression data stored in JSON-encoded metadata. * **Tests** * Added regression coverage for expression extraction, fallback state, merging, and update precedence. <!-- 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:09: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#6386
No description provided.