[GH-ISSUE #669] [Feature]: Complete the chat-side avatar-crop propagation deferred from PR #661 #316

Closed
opened 2026-10-20 17:27:34 +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/669

What problem does this solve?

PR #661 shipped the new full-image avatar cropper and persona crop UI but explicitly deferred propagation through chat-side render sites. With #661 live, four chat surfaces rendered broken avatars on any saved new-format crop, so PR #666 reverted it. The full-image cropper is now back on the shelf until the deferred scope lands.

The problem: the avatar cropper UX upgrade (#658 → #661) is fully designed and reviewed, but can't ship in its current shape because chat-side getAvatarCropStyle consumers — ChatMessage, ConversationMessage, QuickPersonaSwitcher, the chat header avatars, the game-mode party widgets, and ~17 other render sites — were never wired up. Re-applying #661 without that wiring would just bring back the four regressions documented in #665.

Proposed solution

Re-apply PR #661 in a single follow-up PR that also lands the deferred chat-side propagation. Two-commit shape so the reviewer can see the delta clearly:

  1. Commit 1 — git revert -m 1 <PR #666 merge>. Brings back PR #661 exactly as it was reviewed and merged, no changes.
  2. Commit 2 — feat(avatar-crop): propagate new-format crop through chat surfaces. The new work, structured as:
    • Part A — data plumbing. Widen CharacterMap.avatarCrop and add PersonaInfo.avatarCrop in chat-area.types.ts; thread avatarCrop from the persona row through ChatArea.tsx's userPersonaInfo; snapshot it on user messages (client + server + shared types) so re-edits don't restyle past messages; resolve a persona crop style in ChatMessage / ConversationMessage user bubbles; apply the crop in QuickPersonaSwitcher + QuickSwitcherMobile. Move parsePersonaAvatarCrop from PersonasPanel into lib/utils.ts (rename parseAvatarCropJson) and introduce an AvatarCropValue alias so 17 narrow inline types across client files can carry the new shape too.
    • Part B — container clipping. Sweep all parent containers of <img style={getAvatarCropStyle(...)}> for position: relative (needed because the new-format crop renders the img with position: absolute). Adds relative to 22 surfaces spanning chat, settings, sidebar, and game-mode widgets.

No data migration; legacy crops keep rendering via the legacy transform path.

Alternatives considered

  • Stay reverted indefinitely. Loses the better cropper UX users asked for in #658.
  • Land the data plumbing and clipping fixes piecemeal in separate PRs. Too noisy for a feature whose halves don't make sense apart — the chat-side propagation depends on #661's data shape, and the cropper UI without the chat-side fix is exactly what #665 documented.
  • Forward-port via a new design that doesn't need position: relative on parents (e.g. fixed-aspect wrappers, or a <picture> element with a background-image crop). Heavier change with worse compatibility against the existing wide variety of avatar surfaces. The relative-parent sweep is mechanical and one-shot.

Additional context

  • Original feature request: #658
  • Original PR (now reverted): #661
  • Regression report: #665
  • Revert PR: #666
  • Defensive post-revert patch (orthogonal, unblocks anyone who saved a new-format crop during the #661 window): #668

The follow-up PR will be opened with this issue linked. Pre-merge, the work has been validated end-to-end on a fork deployment with all four #665 surfaces verified clean.

Template check

  • 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/669 ## What problem does this solve? PR #661 shipped the new full-image avatar cropper and persona crop UI but explicitly deferred propagation through chat-side render sites. With #661 live, four chat surfaces rendered broken avatars on any saved new-format crop, so PR #666 reverted it. The full-image cropper is now back on the shelf until the deferred scope lands. The problem: the avatar cropper UX upgrade (#658 → #661) is fully designed and reviewed, but can't ship in its current shape because chat-side `getAvatarCropStyle` consumers — `ChatMessage`, `ConversationMessage`, `QuickPersonaSwitcher`, the chat header avatars, the game-mode party widgets, and ~17 other render sites — were never wired up. Re-applying #661 without that wiring would just bring back the four regressions documented in #665. ## Proposed solution Re-apply PR #661 in a single follow-up PR that also lands the deferred chat-side propagation. Two-commit shape so the reviewer can see the delta clearly: 1. **Commit 1** — `git revert -m 1 <PR #666 merge>`. Brings back PR #661 exactly as it was reviewed and merged, no changes. 2. **Commit 2** — `feat(avatar-crop): propagate new-format crop through chat surfaces`. The new work, structured as: - **Part A — data plumbing.** Widen `CharacterMap.avatarCrop` and add `PersonaInfo.avatarCrop` in `chat-area.types.ts`; thread `avatarCrop` from the persona row through `ChatArea.tsx`'s `userPersonaInfo`; snapshot it on user messages (client + server + shared types) so re-edits don't restyle past messages; resolve a persona crop style in `ChatMessage` / `ConversationMessage` user bubbles; apply the crop in `QuickPersonaSwitcher` + `QuickSwitcherMobile`. Move `parsePersonaAvatarCrop` from `PersonasPanel` into `lib/utils.ts` (rename `parseAvatarCropJson`) and introduce an `AvatarCropValue` alias so 17 narrow inline types across client files can carry the new shape too. - **Part B — container clipping.** Sweep all parent containers of `<img style={getAvatarCropStyle(...)}>` for `position: relative` (needed because the new-format crop renders the img with `position: absolute`). Adds `relative` to 22 surfaces spanning chat, settings, sidebar, and game-mode widgets. No data migration; legacy crops keep rendering via the legacy transform path. ## Alternatives considered - **Stay reverted indefinitely.** Loses the better cropper UX users asked for in #658. - **Land the data plumbing and clipping fixes piecemeal in separate PRs.** Too noisy for a feature whose halves don't make sense apart — the chat-side propagation depends on #661's data shape, and the cropper UI without the chat-side fix is exactly what #665 documented. - **Forward-port via a new design that doesn't need `position: relative` on parents (e.g. fixed-aspect wrappers, or a `<picture>` element with a background-image crop).** Heavier change with worse compatibility against the existing wide variety of avatar surfaces. The relative-parent sweep is mechanical and one-shot. ## Additional context - Original feature request: #658 - Original PR (now reverted): #661 - Regression report: #665 - Revert PR: #666 - Defensive post-revert patch (orthogonal, unblocks anyone who saved a new-format crop during the #661 window): #668 The follow-up PR will be opened with this issue linked. Pre-merge, the work has been validated end-to-end on a fork deployment with all four #665 surfaces verified clean. ## Template check - [ ] I DID NOT read this template and provide the requested details.
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#316
No description provided.