[PR #6612] [MERGED] feat: show only active Expression Engine sprites in Roleplay #7252

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6612
Author: @SpicyMarinara
Created: 9/24/2026
Status: ✅ Merged
Merged: 9/24/2026
Merged by: @SpicyMarinara

Base: staging ← Head: codex/active-expression-sprites


📝 Commits (7)

  • 1f873c0 feat: define optional active expression sprite visibility
  • 95f92a4 Merge branch 'staging' into codex/active-expression-sprites
  • 63bc02f feat: retain active sprites until the next expression result completes
  • 31f9e55 Merge remote-tracking branch 'origin/staging' into codex/active-expression-sprites
  • d68fe5a Merge remote-tracking branch 'origin/codex/active-expression-sprites' into codex/active-expression-sprites
  • f6ccebb fix: retain pending expression sprites across chat switches
  • 6a8480f test: await expression processing before reload checks

📊 Changes

13 files changed (+513 additions, -11 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
➕ e2e/expression-active-sprites.e2e.ts (+339 -0)
📝 packages/client/src/components/chat/ChatArea.tsx (+30 -1)
📝 packages/client/src/components/chat/ChatRoleplaySurface.tsx (+6 -1)
📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+10 -0)
📝 packages/client/src/components/chat/ExpressionSpriteSettings.tsx (+13 -0)
📝 packages/client/src/components/chat/SpriteOverlay.tsx (+5 -0)
📝 packages/client/src/lib/sprite-expression-state.ts (+33 -0)
📝 packages/client/src/localization/locales/en.json (+2 -0)
📝 packages/server/src/routes/generate.routes.ts (+6 -5)
📝 packages/server/src/routes/generate/retry-agents-route.ts (+6 -2)
📝 packages/shared/src/types/chat.ts (+4 -0)
📝 scripts/regressions/open-issues.regression.ts (+57 -2)

📄 Description

Linked issue

Closes #6611

Why this change

Roleplay scenes can keep every enabled sprite visible even when only a few characters are active. The new Only show active sprites option under Chat Settings → Agents → Expression Engine shows the owners returned by the latest completed expression result. It is off by default.

What changed

  • Reuse the existing localized settings switch and sprite overlay. Filtering preserves the remaining sprites' positions and works in classic Roleplay and Visual Novel mode.
  • Save the completed owner list with the message/swipe on normal generation and retries, including persona owners and valid empty results. Keep the previous scene while expressions are pending, including during regeneration. Before the first completed result, keep the existing scene.
  • Preserve sparse expression appearances independently of visibility, so switching the option off restores existing behavior. Older chats fall back to their saved assistant expression maps. A legacy persona map on a user message alone is not treated as completion evidence, because it survives regeneration; new persona-only results carry an explicit completion marker.

Validation

Automated validation:

  • pnpm install, pnpm check (including localization, formatting, TypeScript, lint, and production builds), and pnpm version:check passed. The existing unrelated GameNarration hook-dependency warning remains; there are no lint errors.
  • node scripts/run-regressions.mjs --filter open-issues.regression.ts passed, covering pending results, empty results overriding retained appearances, and legacy character/persona maps.
  • pnpm smoke:ui e2e/expression-active-sprites.e2e.ts passed 6/6: classic/dark and Visual Novel/light across desktop Chromium, Android-sized Chromium, and iPhone-sized WebKit. A local controlled provider exercises the real generation/retry routes, separate main/expression waits, regenerated swipes, switching chats during pending expressions, reloads, fresh retry owners, empty results, and restoring all sprites when disabled. The fixture serializes access to the global Expression Engine config shared by mobile projects.
  • Full Linux ARM64 Docker image built and passed API, frontend, native-binding, and persistent-volume restart smoke checks before the client review follow-up. GitHub validates the final images on AMD64 and ARM64.
  • Local CodeRabbit completed with one finding. Its suggestion to clear retained spriteExpressions on an empty retry was rejected: those are sparse appearance state, while expressionSpriteIds: [] is the authoritative completed visibility result. Clearing appearances would change the established toggle-off behavior. The regression and browser tests verify empty visibility with a retained appearance map; code comments explain the separation. A follow-up local review identified a transient loading reset, which was corrected by retaining each chat’s selection in ChatArea above the Roleplay view’s loading/remount boundary. The final follow-up local review of the application changes completed with no additional findings. The subsequent test-only reload guard passed E2E type checking and all six browser cases.

GitHub review follow-up: reproduced the pending chat-switch failure, retained selection per chat above the loading boundary, and strengthened nonempty retries by seeding a different saved owner before asserting the fresh response. The legacy persona-only inference suggestion was declined: user appearances survive regeneration and cannot prove that the assistant result completed. Added regressions for that ambiguity and for explicit persona-only completion markers. The later test-readiness suggestion was fixed by polling generation/translation status and agent processing before reload. The minor Visual Novel dimming suggestion was declined: this enabled filter intentionally keeps visible sprites at their configured opacity, including before its first completed result; disabling it retains the existing dimming policy.

The final hosted review completed on 6a8480f9c with no additional actionable comments. Its informational warnings were triaged: the Termux assertion only received Prettier line wrapping in the touched regression file (identical call and arguments), and the generic docstring percentage does not justify boilerplate for the existing UI/test helpers; the new resolver and persisted fields already have focused documentation.

Human verification checklist (left unchecked):

  • 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

  • Manually verify the toggle in a typical multi-character chat using your Expression Engine prompt and provider.
  • Manually verify the current scene stays visible through normal generation and regeneration, then changes to the returned characters; disabling the option should restore all enabled sprites.
  • Browser verification above is automated and uses a deterministic local provider, not physical devices or an external model.

Docs and release impact

An Unreleased changelog entry is included. No version bump or user-facing documentation files changed.

  • 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

Default/off, pending, completed, and settings screenshots in desktop/mobile and light/dark themes. Download the self-contained HTML using Raw / Save As and open it in a browser. All chats and provider responses are synthetic; artwork is the repository's Mari sprite.


🔄 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/6612 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 9/24/2026 **Status:** ✅ Merged **Merged:** 9/24/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `codex/active-expression-sprites` --- ### 📝 Commits (7) - [`1f873c0`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1f873c029fec76d986134a9f66ee1f46dcc0ec33) feat: define optional active expression sprite visibility - [`95f92a4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/95f92a40c79c4bd6bde37d0866eed5ffcc2f9de0) Merge branch 'staging' into codex/active-expression-sprites - [`63bc02f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/63bc02f00937270184fa8aa261d10f49de2f8fe2) feat: retain active sprites until the next expression result completes - [`31f9e55`](https://github.com/Pasta-Devs/Marinara-Engine/commit/31f9e55ed0cb4339474f510f4d7279171ba61071) Merge remote-tracking branch 'origin/staging' into codex/active-expression-sprites - [`d68fe5a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d68fe5a24668bd5d138f275e95342ea51b5b402d) Merge remote-tracking branch 'origin/codex/active-expression-sprites' into codex/active-expression-sprites - [`f6ccebb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f6ccebb95b0fa4880d3a02dd9e6c59265ca8e816) fix: retain pending expression sprites across chat switches - [`6a8480f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6a8480f9c0ced041c8e179f16e047613bc7d22a3) test: await expression processing before reload checks ### 📊 Changes **13 files changed** (+513 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) ➕ `e2e/expression-active-sprites.e2e.ts` (+339 -0) 📝 `packages/client/src/components/chat/ChatArea.tsx` (+30 -1) 📝 `packages/client/src/components/chat/ChatRoleplaySurface.tsx` (+6 -1) 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+10 -0) 📝 `packages/client/src/components/chat/ExpressionSpriteSettings.tsx` (+13 -0) 📝 `packages/client/src/components/chat/SpriteOverlay.tsx` (+5 -0) 📝 `packages/client/src/lib/sprite-expression-state.ts` (+33 -0) 📝 `packages/client/src/localization/locales/en.json` (+2 -0) 📝 `packages/server/src/routes/generate.routes.ts` (+6 -5) 📝 `packages/server/src/routes/generate/retry-agents-route.ts` (+6 -2) 📝 `packages/shared/src/types/chat.ts` (+4 -0) 📝 `scripts/regressions/open-issues.regression.ts` (+57 -2) </details> ### 📄 Description ## Linked issue Closes #6611 ## Why this change Roleplay scenes can keep every enabled sprite visible even when only a few characters are active. The new **Only show active sprites** option under Chat Settings → Agents → Expression Engine shows the owners returned by the latest completed expression result. It is off by default. ## What changed - Reuse the existing localized settings switch and sprite overlay. Filtering preserves the remaining sprites' positions and works in classic Roleplay and Visual Novel mode. - Save the completed owner list with the message/swipe on normal generation and retries, including persona owners and valid empty results. Keep the previous scene while expressions are pending, including during regeneration. Before the first completed result, keep the existing scene. - Preserve sparse expression appearances independently of visibility, so switching the option off restores existing behavior. Older chats fall back to their saved assistant expression maps. A legacy persona map on a user message alone is not treated as completion evidence, because it survives regeneration; new persona-only results carry an explicit completion marker. ## Validation Automated validation: - `pnpm install`, `pnpm check` (including localization, formatting, TypeScript, lint, and production builds), and `pnpm version:check` passed. The existing unrelated GameNarration hook-dependency warning remains; there are no lint errors. - `node scripts/run-regressions.mjs --filter open-issues.regression.ts` passed, covering pending results, empty results overriding retained appearances, and legacy character/persona maps. - `pnpm smoke:ui e2e/expression-active-sprites.e2e.ts` passed **6/6**: classic/dark and Visual Novel/light across desktop Chromium, Android-sized Chromium, and iPhone-sized WebKit. A local controlled provider exercises the real generation/retry routes, separate main/expression waits, regenerated swipes, switching chats during pending expressions, reloads, fresh retry owners, empty results, and restoring all sprites when disabled. The fixture serializes access to the global Expression Engine config shared by mobile projects. - Full Linux ARM64 Docker image built and passed API, frontend, native-binding, and persistent-volume restart smoke checks before the client review follow-up. GitHub validates the final images on AMD64 and ARM64. - Local CodeRabbit completed with one finding. Its suggestion to clear retained `spriteExpressions` on an empty retry was rejected: those are sparse appearance state, while `expressionSpriteIds: []` is the authoritative completed visibility result. Clearing appearances would change the established toggle-off behavior. The regression and browser tests verify empty visibility with a retained appearance map; code comments explain the separation. A follow-up local review identified a transient loading reset, which was corrected by retaining each chat’s selection in ChatArea above the Roleplay view’s loading/remount boundary. The final follow-up local review of the application changes completed with no additional findings. The subsequent test-only reload guard passed E2E type checking and all six browser cases. GitHub review follow-up: reproduced the pending chat-switch failure, retained selection per chat above the loading boundary, and strengthened nonempty retries by seeding a different saved owner before asserting the fresh response. The legacy persona-only inference suggestion was declined: user appearances survive regeneration and cannot prove that the assistant result completed. Added regressions for that ambiguity and for explicit persona-only completion markers. The later test-readiness suggestion was fixed by polling generation/translation status and agent processing before reload. The minor Visual Novel dimming suggestion was declined: this enabled filter intentionally keeps visible sprites at their configured opacity, including before its first completed result; disabling it retains the existing dimming policy. The final hosted review completed on `6a8480f9c` with no additional actionable comments. Its informational warnings were triaged: the Termux assertion only received Prettier line wrapping in the touched regression file (identical call and arguments), and the generic docstring percentage does not justify boilerplate for the existing UI/test helpers; the new resolver and persisted fields already have focused documentation. Human verification checklist (left unchecked): - [ ] `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 - Manually verify the toggle in a typical multi-character chat using your Expression Engine prompt and provider. - Manually verify the current scene stays visible through normal generation and regeneration, then changes to the returned characters; disabling the option should restore all enabled sprites. - Browser verification above is automated and uses a deterministic local provider, not physical devices or an external model. ## Docs and release impact An Unreleased changelog entry is included. No version bump or user-facing documentation files changed. - [ ] 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 [Default/off, pending, completed, and settings screenshots in desktop/mobile and light/dark themes](https://gist.github.com/SpicyMarinara/dc9ebb32853a0719591f70aaa8794a57). Download the self-contained HTML using Raw / Save As and open it in a browser. All chats and provider responses are synthetic; artwork is the repository's Mari sprite. --- <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: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#7252
No description provided.