feat(android): improve profile avatar parity

This commit is contained in:
Daniel Arantes Loverde
2026-04-17 14:41:19 -03:00
parent 9b00c472dc
commit 3c78f2558e
2 changed files with 26 additions and 3 deletions

View File

@@ -35,10 +35,16 @@ struct UserProfileView: View {
.fill(AppColors.brandSoft)
.frame(width: 110, height: 110)
.overlay {
if let imageSource = resolvedProfilePicture {
AsyncStoreImage(imageURL: imageSource)
.frame(width: 104, height: 104)
.clipShape(Circle())
} else {
Text(initials)
.font(.system(size: 32, weight: .bold))
.foregroundStyle(AppColors.primary)
}
}
Button("Remover") {
profilePicture = ""
@@ -66,6 +72,13 @@ struct UserProfileView: View {
}
}
.appNoAutoCap()
textFieldSection(
title: "Foto (URL/Base64)",
placeholder: "https://... ou data:image/jpeg;base64,...",
text: $profilePicture
)
.appNoAutoCap()
}
.padding(16)
.background(AppColors.surface)
@@ -95,6 +108,12 @@ struct UserProfileView: View {
return letters.isEmpty ? "PF" : letters.uppercased()
}
private var resolvedProfilePicture: String? {
let trimmed = profilePicture.trimmingCharacters(in: .whitespacesAndNewlines)
guard trimmed.isEmpty == false else { return nil }
return ImageSourceResolver.resolve(trimmed)
}
private var canSave: Bool {
let cleanName = name.trimmingCharacters(in: .whitespacesAndNewlines)
let cleanEmail = email.trimmingCharacters(in: .whitespacesAndNewlines)

View File

@@ -323,3 +323,7 @@ Legenda:
- `SnackbarOverlay` Android passou a renderizar o banner visual e reagir a mudanças de estado.
- `swift build` validado com sucesso após a alteração.
- A validação `skip export` desta rodada ficou bloqueada por erro pré-existente em `Vendor/skip-fuse-ui` (`onGeometryChangeErased`) e em código gerado `SkipUI`, sem relação direta com a task de snackbar.
7. Ajuste incremental de paridade no perfil Android concluído.
- `UserProfileView+Android` agora mostra preview de avatar quando `profilePicture` está preenchido.
- Campo de edição de foto por URL/Base64 adicionado apenas no Android.
- `swift build` validado com sucesso após o ajuste.