From 3b7f45831d6f506703eefe14e2451cd05adbc96e Mon Sep 17 00:00:00 2001 From: npub19x6jnl6rhepymwyl2xlltz3ce7rfg2ktllle3g2vu59n3s490k8s9n40l3 <29b529ff43be424db89f51bff58a38cf86942acbffff98a14ce50b38c2a57d8f@sprout-oss.stage.blox.sqprod.co> Date: Tue, 21 Jul 2026 09:25:35 -0700 Subject: [PATCH 1/6] Show uploaded avatar in onboarding modal Co-authored-by: npub19x6jnl6rhepymwyl2xlltz3ce7rfg2ktllle3g2vu59n3s490k8s9n40l3 <29b529ff43be424db89f51bff58a38cf86942acbffff98a14ce50b38c2a57d8f@sprout-oss.stage.blox.sqprod.co> Signed-off-by: npub19x6jnl6rhepymwyl2xlltz3ce7rfg2ktllle3g2vu59n3s490k8s9n40l3 <29b529ff43be424db89f51bff58a38cf86942acbffff98a14ce50b38c2a57d8f@sprout-oss.stage.blox.sqprod.co> --- .../profile/ui/ProfileAvatarEditor.pending.ts | 15 +++++++ .../profile/ui/ProfileAvatarEditor.tsx | 26 +++++------- .../profile/ui/ProfileAvatarUploadPreview.tsx | 23 ++++++++++ desktop/tests/e2e/onboarding.spec.ts | 42 +++++++++++++++++-- 4 files changed, 86 insertions(+), 20 deletions(-) create mode 100644 desktop/src/features/profile/ui/ProfileAvatarEditor.pending.ts create mode 100644 desktop/src/features/profile/ui/ProfileAvatarUploadPreview.tsx diff --git a/desktop/src/features/profile/ui/ProfileAvatarEditor.pending.ts b/desktop/src/features/profile/ui/ProfileAvatarEditor.pending.ts new file mode 100644 index 0000000000..f642dd83a5 --- /dev/null +++ b/desktop/src/features/profile/ui/ProfileAvatarEditor.pending.ts @@ -0,0 +1,15 @@ +export function waitForPendingButtonPaint() { + return new Promise((resolve) => { + if ( + typeof window === "undefined" || + typeof window.requestAnimationFrame !== "function" + ) { + setTimeout(resolve, 0); + return; + } + + window.requestAnimationFrame(() => { + window.requestAnimationFrame(() => setTimeout(resolve, 0)); + }); + }); +} diff --git a/desktop/src/features/profile/ui/ProfileAvatarEditor.tsx b/desktop/src/features/profile/ui/ProfileAvatarEditor.tsx index 84347d7527..23822cff10 100644 --- a/desktop/src/features/profile/ui/ProfileAvatarEditor.tsx +++ b/desktop/src/features/profile/ui/ProfileAvatarEditor.tsx @@ -7,12 +7,14 @@ import { flushSync } from "react-dom"; import { AnimatedAvatarCapture } from "@/features/profile/ui/AnimatedAvatarCapture"; import { AvatarCustomColorPanel } from "@/features/profile/ui/AvatarCustomColorPanel"; +import { ProfileAvatarUploadPreview } from "@/features/profile/ui/ProfileAvatarUploadPreview"; import { ProfileAvatarModeTabs } from "@/features/profile/ui/ProfileAvatarModeTabs"; import { useAvatarUpload } from "@/features/profile/useAvatarUpload"; import { cn } from "@/shared/lib/cn"; import { Button } from "@/shared/ui/button"; import { useEmojiBurst } from "@/shared/ui/EmojiBurstProvider"; import { Spinner } from "@/shared/ui/spinner"; +import { waitForPendingButtonPaint } from "./ProfileAvatarEditor.pending"; import { AVATAR_COLORS, AVATAR_COLOR_SWATCHES, @@ -49,22 +51,6 @@ const DONE_BUTTON_SHELL_TRANSITION = { ease: [0.23, 1, 0.32, 1], } as const; -function waitForPendingButtonPaint() { - return new Promise((resolve) => { - if ( - typeof window === "undefined" || - typeof window.requestAnimationFrame !== "function" - ) { - setTimeout(resolve, 0); - return; - } - - window.requestAnimationFrame(() => { - window.requestAnimationFrame(() => setTimeout(resolve, 0)); - }); - }); -} - type EmojiMartEmoji = { native?: string; }; @@ -97,6 +83,7 @@ export function ProfileAvatarEditor({ onAnimatedAvatarApply, onDone, onUploadingChange, + previewName, showEmojiColorControlsWhenEmpty = false, disabled, testIdPrefix = "profile-avatar", @@ -624,6 +611,13 @@ export function ProfileAvatarEditor({ onClick={openPicker} type="button" > + {isOnboardingModal && avatarUrl ? ( + + ) : null}