[GH-ISSUE #658] [Feature]: Avatar crop widget should operate on the full image (and Personas should have one too) #310

Closed
opened 2026-10-20 17:27:31 +07:00 by bsakaguchi · 1 comment
Owner

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

Originally assigned to: @Romuromylus on GitHub.

What problem does this solve?

In the Character editor, the avatar zoom/position widget operates on what is effectively the already-cover-cropped view of the character image, not the full source image. Tall portraits (anything significantly taller than wide) are auto-cropped to their vertical center by object-fit: cover, and the user has no way to:

  • zoom out below 1x to see the whole image, or
  • pan vertically at zoom 1x to choose, say, a face-centered crop higher up the portrait.

The result: users with great-looking 2:3 / 9:16 portraits end up with circle avatars stuck at the chest/midriff with no recourse, even though the full portrait stays available for the Roleplay glued side panel and other "full" views.

Personas have the same avatar upload flow but no crop UI at all in PersonasPanel.tsx — so persona circle avatars can't be re-framed in any way.

Reported by a Marinara user on Windows 11, installer .exe, v1.5.9. Affects circle avatars in all chat modes and in the persona chooser.

Proposed solution

  1. Allow zoom OUT below 1x in the Character editor crop widget so the full image can fit inside the circle (letterboxed), giving users a true "full image" starting point for framing.
  2. Allow panning at all zoom levels, not just zoom > 1, so users can re-center the crop on a face / focal point even without zooming in.
  3. Bring the same crop widget to Personas, with the same avatarCrop extension model and the same render-side helper, closing the customization gap.

Backward compatibility: existing characters/personas with no crop data (or the legacy { zoom: 1, offsetX: 0, offsetY: 0 }) should keep rendering identically — no surprise visual shifts in chat sidebars, notifications, or browser tiles for already-shipped avatars.

Alternatives considered

  • Pulling in react-easy-crop for a more standard cropper UX. Rejected as a much heavier dependency change for a feature that is already ~95% implemented locally.
  • Auto-detecting tall portraits and switching to object-contain globally. Rejected because it would silently change the appearance of already-shipped avatars in every render site.

Additional context

Relevant code today:

  • Crop widget: packages/client/src/components/characters/CharacterEditor.tsx — the MetadataTab "Avatar Zoom & Position" block (around line 1012). Min zoom hard-coded to 1, drag handler gated by if (crop.zoom <= 1) return;.
  • Render helper: packages/client/src/lib/utils.ts — getAvatarCropStyle() returns {} when zoom <= 1, so the legacy object-cover path takes over for any non-zoomed-in crop.
  • Render call sites (~14): chat sidebar, chat messages, conversation messages, chat notifications, chat input, conversation input, character library, bot browser, roleplay surface, etc.
  • Persona panel currently lacking the widget: packages/client/src/components/panels/PersonasPanel.tsx — the avatar upload at handleAvatarUpload has no follow-on crop UI.

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 10, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/658 Originally assigned to: @Romuromylus on GitHub. ## What problem does this solve? In the Character editor, the avatar zoom/position widget operates on what is effectively the already-cover-cropped view of the character image, not the full source image. Tall portraits (anything significantly taller than wide) are auto-cropped to their vertical center by `object-fit: cover`, and the user has no way to: - zoom **out** below 1x to see the whole image, or - pan vertically at zoom 1x to choose, say, a face-centered crop higher up the portrait. The result: users with great-looking 2:3 / 9:16 portraits end up with circle avatars stuck at the chest/midriff with no recourse, even though the full portrait stays available for the Roleplay glued side panel and other "full" views. Personas have the same avatar upload flow but **no crop UI at all** in `PersonasPanel.tsx` — so persona circle avatars can't be re-framed in any way. Reported by a Marinara user on Windows 11, installer .exe, v1.5.9. Affects circle avatars in all chat modes and in the persona chooser. ## Proposed solution 1. **Allow zoom OUT below 1x** in the Character editor crop widget so the full image can fit inside the circle (letterboxed), giving users a true "full image" starting point for framing. 2. **Allow panning at all zoom levels**, not just `zoom > 1`, so users can re-center the crop on a face / focal point even without zooming in. 3. **Bring the same crop widget to Personas**, with the same `avatarCrop` extension model and the same render-side helper, closing the customization gap. Backward compatibility: existing characters/personas with no crop data (or the legacy `{ zoom: 1, offsetX: 0, offsetY: 0 }`) should keep rendering identically — no surprise visual shifts in chat sidebars, notifications, or browser tiles for already-shipped avatars. ## Alternatives considered - Pulling in `react-easy-crop` for a more standard cropper UX. Rejected as a much heavier dependency change for a feature that is already ~95% implemented locally. - Auto-detecting tall portraits and switching to `object-contain` globally. Rejected because it would silently change the appearance of already-shipped avatars in every render site. ## Additional context Relevant code today: - Crop widget: `packages/client/src/components/characters/CharacterEditor.tsx` — the `MetadataTab` "Avatar Zoom & Position" block (around line 1012). Min zoom hard-coded to 1, drag handler gated by `if (crop.zoom <= 1) return;`. - Render helper: `packages/client/src/lib/utils.ts` — `getAvatarCropStyle()` returns `{}` when `zoom <= 1`, so the legacy `object-cover` path takes over for any non-zoomed-in crop. - Render call sites (~14): chat sidebar, chat messages, conversation messages, chat notifications, chat input, conversation input, character library, bot browser, roleplay surface, etc. - Persona panel currently lacking the widget: `packages/client/src/components/panels/PersonasPanel.tsx` — the avatar upload at `handleAvatarUpload` has no follow-on crop UI. ## 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:31 +07:00
Author
Owner

@Romuromylus commented on GitHub (May 10, 2026):

Planned Approach:

  • Add an opt-in fullImage: true flag to the existing AvatarCrop shape so the editor / render path can switch to object-contain semantics (zoom out below 1x, pan at any zoom). Existing crops stay on the current cover-mode codepath, so already-shipped avatars don't shift visually anywhere they're rendered.
  • Surface the same widget in the Persona editor with the same data shape.

Will hold the PR in draft until manually verified on the running app.

<!-- gh-comment-id:4416558078 --> @Romuromylus commented on GitHub (May 10, 2026): Planned Approach: - Add an opt-in `fullImage: true` flag to the existing `AvatarCrop` shape so the editor / render path can switch to `object-contain` semantics (zoom out below 1x, pan at any zoom). Existing crops stay on the current cover-mode codepath, so already-shipped avatars don't shift visually anywhere they're rendered. - Surface the same widget in the Persona editor with the same data shape. Will hold the PR in draft until manually verified on the running app.
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#310
No description provided.