[GH-ISSUE #675] [Issue]: Wide-rectangle glued panel cuts off face on short messages with top-of-source avatars #320

Closed
opened 2026-10-20 17:27:36 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Romuromylus on GitHub (May 11, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/675

Summary

Follow-up to #673 / PR #674. On SHORT messages in Glued Side Panel mode, the panel adapts to bubble height and becomes a wide rectangle. PR #674 routes the new-format avatar crop center to object-position, but object-cover of a tall portrait into a wide rectangle crops the top off — and a centered focal point (50%/50% for a face at top-of-source) lands on chin/chest instead of the face. The Small Rectangles compact style is similarly affected for any persona/character whose face lives near the top of the source.

Expected behavior

For new-format crops on RP rectangle sites, the head/face area of a top-of-source portrait should remain visible regardless of bubble height (i.e. the wide-rectangle short-message case should not cut the face off). Pre-PR #671 behavior — object-cover object-top on the raw source — handled this correctly.

Actual behavior

Short user message (e.g. test) + persona with a saved new-format avatarCrop whose subject is at the top of the source → Glued Side Panel renders only chin/neck/chest of the persona. Longer messages render fine because the panel grows tall and object-cover then preserves the top.

Steps to reproduce

  1. Set up a persona (or character) whose portrait has the face near the top of the image and whose saved avatarCrop is the new-format {srcX, srcY, srcWidth, srcHeight} shape.
  2. Open a Roleplay chat with Avatar Style: Glued Side Panel.
  3. Send a short user message (e.g. one word).
  4. Observe the side panel: shows the chin/chest area instead of the face.
  5. Send a longer message and observe that the same panel, now taller, renders the face correctly.

Environment

  • Marinara Engine version: main (post-PR #674, base 6369722e)
  • Install type: source / docker (autoDeploy)
  • OS + version: any (browser layout issue)
  • Browser or app shell: Chromium-based browsers

Logs, screenshots, or video

Pre-fix screenshot of the Glued Side Panel: short user message ("Oh right, the ritual…what's the ritual?") shows only chin/chest of the persona, while the character's panel (longer message) renders normally.

Additional context

  • Parent issue: #673
  • Parent fix: PR #674 (this regression was introduced by PR #674's object-position mapping)
  • The simplest fix is a partial revert of PR #674's new-format branch in rectangleSafeCropStyle (in packages/client/src/components/chat/ChatMessage.tsx): return {} instead of { objectPosition } so the <img> className object-cover object-top governs. Legacy {zoom, offsetX, offsetY} crops still pass through unchanged because they compose with object-cover as a CSS transform.

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Romuromylus on GitHub (May 11, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/675 ## Summary Follow-up to #673 / PR #674. On SHORT messages in **Glued Side Panel** mode, the panel adapts to bubble height and becomes a wide rectangle. PR #674 routes the new-format avatar crop center to `object-position`, but `object-cover` of a tall portrait into a wide rectangle crops the top off — and a centered focal point (50%/50% for a face at top-of-source) lands on chin/chest instead of the face. The **Small Rectangles** compact style is similarly affected for any persona/character whose face lives near the top of the source. ## Expected behavior For new-format crops on RP rectangle sites, the head/face area of a top-of-source portrait should remain visible regardless of bubble height (i.e. the wide-rectangle short-message case should not cut the face off). Pre-PR #671 behavior — `object-cover object-top` on the raw source — handled this correctly. ## Actual behavior Short user message (e.g. `test`) + persona with a saved new-format `avatarCrop` whose subject is at the top of the source → Glued Side Panel renders only chin/neck/chest of the persona. Longer messages render fine because the panel grows tall and `object-cover` then preserves the top. ## Steps to reproduce 1. Set up a persona (or character) whose portrait has the face near the top of the image and whose saved `avatarCrop` is the new-format `{srcX, srcY, srcWidth, srcHeight}` shape. 2. Open a Roleplay chat with **Avatar Style: Glued Side Panel**. 3. Send a short user message (e.g. one word). 4. Observe the side panel: shows the chin/chest area instead of the face. 5. Send a longer message and observe that the same panel, now taller, renders the face correctly. ## Environment - Marinara Engine version: main (post-PR #674, base `6369722e`) - Install type: source / docker (autoDeploy) - OS + version: any (browser layout issue) - Browser or app shell: Chromium-based browsers ## Logs, screenshots, or video Pre-fix screenshot of the Glued Side Panel: short user message ("Oh right, the ritual…what's the ritual?") shows only chin/chest of the persona, while the character's panel (longer message) renders normally. ## Additional context - Parent issue: #673 - Parent fix: PR #674 (this regression was introduced by PR #674's `object-position` mapping) - The simplest fix is a partial revert of PR #674's new-format branch in `rectangleSafeCropStyle` (in `packages/client/src/components/chat/ChatMessage.tsx`): return `{}` instead of `{ objectPosition }` so the `<img>` className `object-cover object-top` governs. Legacy `{zoom, offsetX, offsetY}` crops still pass through unchanged because they compose with object-cover as a CSS transform. ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-20 17:27:36 +07:00
  • closed this issue
  • added the
    bug
    label
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#320
No description provided.