mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2003] [Issue]: Character editor Avatar Crop image briefly flashes oversized #982
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#982
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Promansis on GitHub (Jun 3, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2003
Originally assigned to: @cha1latte on GitHub.
Summary
Opening the character editor can show a brief layout flicker in the Metadata tab's Avatar Crop area: the crop image/canvas appears large first, then snaps down to the intended measured size.
Expected behavior
The Avatar Crop widget should mount at its final bounded size, or reserve a stable skeleton/placeholder size until the image is measured. The character editor page should not visibly jump when the crop image initializes.
Actual behavior
The Avatar Crop widget appears to render with fallback dimensions before the image measurement is available, then updates after
handleImgLoadcomputes the natural-image scale. On affected character editor opens, the image under Avatar Crop briefly appears too large and then resizes correctly.Steps to reproduce
Impact area
Environment
mainas inspected on 2026-06-03Logs, screenshots, or video
No recording attached. Source evidence:
src/features/catalog/characters/components/CharacterMetadataTab.tsxmountsAvatarCropWidgetwheneveravatarPreviewis present.src/shared/components/ui/AvatarCropWidget.tsxinitializes withimgRect == null, so the crop canvas reservesMAX_DISPLAY_W/MAX_DISPLAY_Hfallback dimensions, thenhandleImgLoadcomputes the measured natural-image dimensions and updates state.className="block h-full w-full"andobjectFit: "fill"; if the fallback box and the measured box differ, the visible canvas can snap after load.getAvatarCropStyleinsrc/shared/lib/utils.tscan also position cropped preview images absolutely once a crop is present, which makes stable container sizing important.Regression notes
Not confirmed as a regression. The issue appears to be a current character editor layout stability bug.
Additional context
Suggested repair: make
AvatarCropWidgetreserve a stable bounded aspect-ratio/size before measurement, or hide/skeleton the crop canvas untilimgRectis known. Verification should include browser proof on a large avatar and a small avatar, plus switching between characters to ensure the crop area does not flash oversized.Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: