[PR #6058] [MERGED] fix(roleplay): apply avatar crop to Visual Novel portrait (#6044) #7043

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6058
Author: @Promansis
Created: 9/11/2026
Status: ✅ Merged
Merged: 9/11/2026
Merged by: @Promansis

Base: staging ← Head: fix/6044-roleplay-vn-popout-crop


📝 Commits (3)

  • 41e4b3c fix(roleplay): apply avatar crop to Visual Novel portrait (#6044)
  • 902c90a Merge branch 'staging' into fix/6044-roleplay-vn-popout-crop
  • 15de8f2 test(roleplay): assert inline style on vn avatar crop in e2e

📊 Changes

3 files changed (+42 additions, -1 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 e2e/roleplay-vn.e2e.ts (+38 -0)
📝 packages/client/src/components/chat/ChatMessage.tsx (+3 -1)

📄 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 #6044

Why this change

In Roleplay's Visual Novel presentation mode, character and persona avatars with custom Avatar Crops were ignoring the configured crop and rendering uncropped/stretched. This occurred because the VN portrait container was applying panelAvatarCropStyle, which bypasses source-rectangle crops intended for wide rectangular panels.

What changed

  • Updated ChatMessage.tsx (Visual Novel branch) to use vnAvatarCropStyle (expressionAvatarUrl ? {} : avatarCropStyle), correctly applying getAvatarCropStyle directly to the square Visual Novel avatar portrait.
  • Added E2E regression test in e2e/roleplay-vn.e2e.ts verifying that avatar crops are preserved and applied to the VN portrait, and that the chat history popout remains expandable.
  • Updated CHANGELOG.md under [Unreleased].

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

Manual verification notes

  • Manually verify that custom cropped avatars render correctly in Roleplay Visual Novel mode.
  • Manually verify that expanding chat history displays previous messages.

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)

Summary by CodeRabbit

  • Bug Fixes

    • Visual Novel mode portraits now correctly honor configured character and persona avatar crops.
    • Cropped portraits display with the intended positioning and sizing, including when expression avatars are shown.
    • Expanded chat history in Visual Novel mode continues to display seeded messages correctly.
  • Tests

    • Added coverage to verify avatar crop rendering and chat history expansion in Visual Novel mode.

🔄 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/6058 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 9/11/2026 **Status:** ✅ Merged **Merged:** 9/11/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `fix/6044-roleplay-vn-popout-crop` --- ### 📝 Commits (3) - [`41e4b3c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/41e4b3cf52262967a1cb9ee05fca81f2a321e0c3) fix(roleplay): apply avatar crop to Visual Novel portrait (#6044) - [`902c90a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/902c90a7d87b926500f2e42143a83481b23fa506) Merge branch 'staging' into fix/6044-roleplay-vn-popout-crop - [`15de8f2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/15de8f273c17253077320b616891ec52559d1613) test(roleplay): assert inline style on vn avatar crop in e2e ### 📊 Changes **3 files changed** (+42 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `e2e/roleplay-vn.e2e.ts` (+38 -0) 📝 `packages/client/src/components/chat/ChatMessage.tsx` (+3 -1) </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 #6044 ## Why this change In Roleplay's Visual Novel presentation mode, character and persona avatars with custom Avatar Crops were ignoring the configured crop and rendering uncropped/stretched. This occurred because the VN portrait container was applying `panelAvatarCropStyle`, which bypasses source-rectangle crops intended for wide rectangular panels. ## What changed - Updated `ChatMessage.tsx` (Visual Novel branch) to use `vnAvatarCropStyle` (`expressionAvatarUrl ? {} : avatarCropStyle`), correctly applying `getAvatarCropStyle` directly to the square Visual Novel avatar portrait. - Added E2E regression test in `e2e/roleplay-vn.e2e.ts` verifying that avatar crops are preserved and applied to the VN portrait, and that the chat history popout remains expandable. - Updated `CHANGELOG.md` under `[Unreleased]`. ## 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` ### Manual verification notes - Manually verify that custom cropped avatars render correctly in Roleplay Visual Novel mode. - Manually verify that expanding chat history displays previous messages. ## 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) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Visual Novel mode portraits now correctly honor configured character and persona avatar crops. - Cropped portraits display with the intended positioning and sizing, including when expression avatars are shown. - Expanded chat history in Visual Novel mode continues to display seeded messages correctly. - **Tests** - Added coverage to verify avatar crop rendering and chat history expansion in Visual Novel mode. <!-- 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:16:00 +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#7043
No description provided.