Skip to content

feat(desktop): reusable AvatarUpload for onboarding and settings#502

Merged
wesbillman merged 2 commits into
mainfrom
desktop-avatar-upload
May 8, 2026
Merged

feat(desktop): reusable AvatarUpload for onboarding and settings#502
wesbillman merged 2 commits into
mainfrom
desktop-avatar-upload

Conversation

@wesbillman
Copy link
Copy Markdown
Collaborator

Summary

  • Extract avatar upload logic from onboarding into a shared useAvatarUpload hook and AvatarUpload component in features/profile/
  • Wire the new component into both the onboarding ProfileStep and the Settings ProfileSettingsCard
  • Settings now supports file upload for avatars (previously URL-only input)
  • Simplify onboarding state by removing avatar upload machinery from OnboardingFlow.tsx and types.ts

Files changed

  • NEW desktop/src/features/profile/useAvatarUpload.ts — Hook: MIME validation, uploadMediaBytes call, loading/error state
  • NEW desktop/src/features/profile/ui/AvatarUpload.tsx — Reusable component: avatar preview + upload button + URL input + error banner
  • MODIFIED desktop/src/features/onboarding/ui/ProfileStep.tsx — Replaced inline AvatarSection with AvatarUpload
  • MODIFIED desktop/src/features/onboarding/ui/OnboardingFlow.tsx — Removed avatar upload state/callbacks
  • MODIFIED desktop/src/features/onboarding/ui/types.ts — Simplified ProfileStepAvatarState and ProfileStepActions
  • MODIFIED desktop/src/features/settings/ui/ProfileSettingsCard.tsx — Replaced URL-only input with AvatarUpload

Test plan

  • Verify onboarding avatar upload still works (file pick, upload, preview, undo)
  • Verify Settings page now shows upload button + URL input for avatar
  • Verify existing test IDs preserved (onboarding-avatar-upload, onboarding-avatar-url, profile-avatar-url)
  • pnpm check and tsc --noEmit pass
  • Desktop and web builds succeed

🤖 Generated with Claude Code

wesbillman and others added 2 commits May 7, 2026 17:54
… and settings

Extract avatar upload logic from onboarding into a shared useAvatarUpload hook
and AvatarUpload component. Wire the new component into both the onboarding
ProfileStep and the Settings ProfileSettingsCard, replacing the URL-only input
in Settings with full file upload support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ettings avatar UX

- Expose isUploading from AvatarUpload via onUploadingChange callback so
  onboarding canSubmit gates on upload-in-progress (prevents submitting
  before upload completes)
- Add idleHint prop to AvatarUpload for context-appropriate helper text
- Restore ProfileAvatar in Settings header for visual consistency

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@wesbillman wesbillman merged commit 4723e59 into main May 8, 2026
15 checks passed
@wesbillman wesbillman deleted the desktop-avatar-upload branch May 8, 2026 01:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant