[PR #676] [MERGED] fix(avatar-crop): bypass new-format crops on RP rectangle avatars #4725

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/676
Author: @Romuromylus
Created: 5/11/2026
Status: ✅ Merged
Merged: 5/11/2026
Merged by: @Romuromylus

Base: main ← Head: fix/rectangle-avatar-object-top


📝 Commits (1)

  • 0e31ca3 fix(avatar-crop): bypass new-format crops on RP rectangle avatars

📊 Changes

1 file changed (+7 additions, -8 deletions)

View changed files

📝 packages/client/src/components/chat/ChatMessage.tsx (+7 -8)

📄 Description

Linked issue

Closes #675

Why this change

PR #674 mapped the new-format avatar crop center to object-position on RP rectangle sites (compact "rectangles" style and the glued side panel). On a SHORT user message the glued panel becomes a wide rectangle, and object-cover of a tall portrait into a wide rectangle then crops the top off — any centered focal point (50%/50% for a face at top-of-source) lands on chin/chest instead of the face.

Reported in #675 as a follow-up regression to PR #674.

What changed

  • packages/client/src/components/chat/ChatMessage.tsx — rectangleSafeCropStyle now returns {} for new-format crops on RP rectangle sites instead of computing an objectPosition. This lets the <img>'s existing className (object-cover [object-top]) govern, which is the pre-PR #674 baseline that handled the short-message wide-rectangle case correctly.
  • Legacy {zoom, offsetX, offsetY} crops still pass through unchanged (they compose with object-cover as a CSS transform).
  • The rectangleSafeCropStyle helper indirection is kept so the legacy passthrough remains correct on rectangle sites.

This is a partial revert of PR #674 — only the new-format branch reverts; the legacy passthrough that PR #674 also covered is preserved.

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 a short user message (e.g. test) with a persona that has a saved new-format avatarCrop whose subject is at the top of the source — in Glued Side Panel mode, the panel should show the persona's face/head, not chin/chest. Spot-check the same with Small Rectangles compact style.
  • Manually verify a longer assistant message in Glued Side Panel with a character avatar — the panel is now tall and should still render the face/upper body without distortion (parity with pre-PR-#674 behavior on tall panels).
  • Manually verify a character or persona with a legacy {zoom, offsetX, offsetY} crop — the transform should still apply on rectangles (this PR does not change the legacy path).

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

Reporter screenshot in #675 shows the pre-fix Glued Side Panel cutting off the face on a short user message ("Oh right, the ritual…what's the ritual?"). Post-fix, the panel uses object-cover object-top on the raw source, restoring the head/face visibility.


🔄 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/676 **Author:** [@Romuromylus](https://github.com/Romuromylus) **Created:** 5/11/2026 **Status:** ✅ Merged **Merged:** 5/11/2026 **Merged by:** [@Romuromylus](https://github.com/Romuromylus) **Base:** `main` ← **Head:** `fix/rectangle-avatar-object-top` --- ### 📝 Commits (1) - [`0e31ca3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0e31ca3ecbf0577ff890fcbaa12b7321885a2701) fix(avatar-crop): bypass new-format crops on RP rectangle avatars ### 📊 Changes **1 file changed** (+7 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/chat/ChatMessage.tsx` (+7 -8) </details> ### 📄 Description ## Linked issue Closes #675 ## Why this change PR #674 mapped the new-format avatar crop center to `object-position` on RP rectangle sites (compact "rectangles" style and the glued side panel). On a SHORT user message the glued panel becomes a wide rectangle, and `object-cover` of a tall portrait into a wide rectangle then crops the top off — any centered focal point (50%/50% for a face at top-of-source) lands on chin/chest instead of the face. Reported in #675 as a follow-up regression to PR #674. ## What changed - `packages/client/src/components/chat/ChatMessage.tsx` — `rectangleSafeCropStyle` now returns `{}` for new-format crops on RP rectangle sites instead of computing an `objectPosition`. This lets the `<img>`'s existing className (`object-cover [object-top]`) govern, which is the pre-PR #674 baseline that handled the short-message wide-rectangle case correctly. - Legacy `{zoom, offsetX, offsetY}` crops still pass through unchanged (they compose with `object-cover` as a CSS transform). - The `rectangleSafeCropStyle` helper indirection is kept so the legacy passthrough remains correct on rectangle sites. This is a partial revert of PR #674 — only the new-format branch reverts; the legacy passthrough that PR #674 also covered is preserved. ## Validation - [x] `pnpm check` passes locally - [x] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [x] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes - Manually verify a short user message (e.g. `test`) with a persona that has a saved new-format `avatarCrop` whose subject is at the top of the source — in **Glued Side Panel** mode, the panel should show the persona's face/head, not chin/chest. Spot-check the same with **Small Rectangles** compact style. - Manually verify a longer assistant message in **Glued Side Panel** with a character avatar — the panel is now tall and should still render the face/upper body without distortion (parity with pre-PR-#674 behavior on tall panels). - Manually verify a character or persona with a legacy `{zoom, offsetX, offsetY}` crop — the transform should still apply on rectangles (this PR does not change the legacy path). ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) Reporter screenshot in #675 shows the pre-fix Glued Side Panel cutting off the face on a short user message ("Oh right, the ritual…what's the ritual?"). Post-fix, the panel uses `object-cover object-top` on the raw source, restoring the head/face visibility. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:10:07 +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#4725
No description provided.