feat(experience,account): add image crop for avatar upload#8914
Merged
Conversation
COMPARE TO
|
| Name | Diff |
|---|---|
| packages/account/package.json | 📈 +33 Bytes |
| packages/account/src/components/AvatarUploadField/index.test.tsx | 📈 +5.66 KB |
| packages/account/src/components/AvatarUploadField/index.tsx | 📈 +1.96 KB |
| packages/account/src/pages/Profile/index.test.tsx | 📈 +3.54 KB |
| packages/account/src/pages/Profile/index.tsx | 📈 +90 Bytes |
| packages/core/src/middleware/koa-security-headers.ts | 📈 +304 Bytes |
| packages/experience/jest.config.ts | 📈 +131 Bytes |
| packages/experience/package.json | 📈 +33 Bytes |
| packages/experience/src/components/AvatarCropModal/index.module.scss | 📈 +1.39 KB |
| packages/experience/src/components/AvatarCropModal/index.tsx | 📈 +6.63 KB |
| packages/experience/src/components/InputFields/AvatarUploadField/index.test.tsx | 📈 +2.02 KB |
| packages/experience/src/components/InputFields/AvatarUploadField/index.tsx | 📈 +1.83 KB |
| packages/experience/src/hooks/use-avatar-crop-upload.ts | 📈 +6.58 KB |
| packages/experience/src/utils/avatar-upload.test.ts | 📈 +1.16 KB |
| packages/experience/src/utils/avatar-upload.ts | 📈 +797 Bytes |
| packages/experience/src/utils/image-crop.ts | 📈 +2.28 KB |
| packages/phrases-experience/src/locales/ar/profile.ts | 📈 +257 Bytes |
| packages/phrases-experience/src/locales/cs/profile.ts | 📈 +216 Bytes |
| packages/phrases-experience/src/locales/de/profile.ts | 📈 +236 Bytes |
| packages/phrases-experience/src/locales/en/profile.ts | 📈 +180 Bytes |
| packages/phrases-experience/src/locales/es/profile.ts | 📈 +190 Bytes |
| packages/phrases-experience/src/locales/fr/profile.ts | 📈 +207 Bytes |
| packages/phrases-experience/src/locales/it/profile.ts | 📈 +175 Bytes |
| packages/phrases-experience/src/locales/ja/profile.ts | 📈 +266 Bytes |
| packages/phrases-experience/src/locales/ko/profile.ts | 📈 +237 Bytes |
| packages/phrases-experience/src/locales/pl-pl/profile.ts | 📈 +210 Bytes |
| packages/phrases-experience/src/locales/pt-br/profile.ts | 📈 +187 Bytes |
| packages/phrases-experience/src/locales/pt-pt/profile.ts | 📈 +202 Bytes |
| packages/phrases-experience/src/locales/ru/profile.ts | 📈 +292 Bytes |
| packages/phrases-experience/src/locales/th/profile.ts | 📈 +370 Bytes |
| packages/phrases-experience/src/locales/tr-tr/profile.ts | 📈 +209 Bytes |
| packages/phrases-experience/src/locales/uk-ua/profile.ts | 📈 +290 Bytes |
| packages/phrases-experience/src/locales/zh-cn/profile.ts | 📈 +158 Bytes |
| packages/phrases-experience/src/locales/zh-hk/profile.ts | 📈 +158 Bytes |
| packages/phrases-experience/src/locales/zh-tw/profile.ts | 📈 +158 Bytes |
| pnpm-lock.yaml | 📈 +820 Bytes |
charIeszhao
approved these changes
May 31, 2026
ada14e7 to
ff24a42
Compare
simeng-li
reviewed
Jun 1, 2026
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Autofix Details
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed:
handleRemoveno longer clears stale upload error- Exposed clearUploadError from useAvatarCropUpload and call it in handleRemove so stale upload errors are cleared when the avatar is removed.
You can send follow-ups to the cloud agent here.
Base automatically changed from
wangsijie-log-13217-avatar-in-account-center-profile-page
to
master
June 1, 2026 08:52
3edb4a6 to
880d235
Compare
880d235 to
65cced8
Compare
65cced8 to
23ff9ad
Compare
simeng-li
reviewed
Jun 2, 2026
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Reviewed by Cursor Bugbot for commit be4d2c9. Configure here.
Add a square crop and zoom step to the avatar upload flow in Experience sign-up and Account Center profile. Selecting an image opens a crop modal; the cropped result is exported as a JPEG blob before upload. - Share select→crop→upload orchestration via useAvatarCropUpload - Scope blob: img-src CSP to experience and account apps only - Keep the crop modal open on upload or persist failure with inline errors - Retry profile persist without re-uploading the asset - Export square JPEGs using a single crop dimension
be4d2c9 to
7da0e5c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Add a square crop + zoom step to the avatar upload flow in Experience sign-up (Collect User Profile) and Account Center profile. Selecting an image opens a crop modal; the cropped result is exported as a JPEG blob before upload.
useAvatarCropUploadhook for select → crop → upload orchestrationAvatarCropModalwith square crop, zoom slider, and inline error displayblob:inimg-srcCSP for Experience and Account Center onlyerror_savein the modal and retry without re-uploading the assetTesting
Tested locally
Unit tests