Add profile picture upload, crop, and profile rendering#592
Conversation
Agent-Logs-Url: https://github.com/benckx/elephantchess/sessions/8c4f078d-a734-4468-9066-5914ffa4ded7 Co-authored-by: benckx <8626080+benckx@users.noreply.github.com>
Agent-Logs-Url: https://github.com/benckx/elephantchess/sessions/8c4f078d-a734-4468-9066-5914ffa4ded7 Co-authored-by: benckx <8626080+benckx@users.noreply.github.com>
Agent-Logs-Url: https://github.com/benckx/elephantchess/sessions/8c4f078d-a734-4468-9066-5914ffa4ded7 Co-authored-by: benckx <8626080+benckx@users.noreply.github.com>
Agent-Logs-Url: https://github.com/benckx/elephantchess/sessions/8c4f078d-a734-4468-9066-5914ffa4ded7 Co-authored-by: benckx <8626080+benckx@users.noreply.github.com>
Agent-Logs-Url: https://github.com/benckx/elephantchess/sessions/8c4f078d-a734-4468-9066-5914ffa4ded7 Co-authored-by: benckx <8626080+benckx@users.noreply.github.com>
benckx
left a comment
There was a problem hiding this comment.
I think we should create different folders on the CDN by "profile" (dev, prod, local-backup) on the CDN (because we only have 1). We need to add this folder to the key. Re-use the profile used in "parse configs" in the Main.
Agent-Logs-Url: https://github.com/benckx/elephantchess/sessions/5ad7d2dc-8e4b-4e6e-adfd-ea3e4c32010b Co-authored-by: benckx <8626080+benckx@users.noreply.github.com>
Agent-Logs-Url: https://github.com/benckx/elephantchess/sessions/5ad7d2dc-8e4b-4e6e-adfd-ea3e4c32010b Co-authored-by: benckx <8626080+benckx@users.noreply.github.com>
Agent-Logs-Url: https://github.com/benckx/elephantchess/sessions/5ad7d2dc-8e4b-4e6e-adfd-ea3e4c32010b Co-authored-by: benckx <8626080+benckx@users.noreply.github.com>
Agent-Logs-Url: https://github.com/benckx/elephantchess/sessions/5ad7d2dc-8e4b-4e6e-adfd-ea3e4c32010b Co-authored-by: benckx <8626080+benckx@users.noreply.github.com>
Agent-Logs-Url: https://github.com/benckx/elephantchess/sessions/5ad7d2dc-8e4b-4e6e-adfd-ea3e4c32010b Co-authored-by: benckx <8626080+benckx@users.noreply.github.com>
Updated in 12e7966. Profile pictures now use the runtime app profile as a CDN path prefix, so keys/URLs resolve like Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot resolve the merge conflicts in this pull request |
Agent-Logs-Url: https://github.com/benckx/elephantchess/sessions/4040ffc1-ccbe-4495-abb9-1044d0c08efb Co-authored-by: benckx <8626080+benckx@users.noreply.github.com>
Resolved and merged in a1b99c9. I fetched Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot resolve the merge conflicts in this pull request |
|
@copilot resolve the merge conflicts in this pull request |
…-picture-upload # Conflicts: # webapp-dao-migration/src/main/resources/liquibase-changelog-generation.xml # webapp-dao-migration/src/main/resources/liquibase-changelog.xml
Resolved in |
| } | ||
| } | ||
|
|
||
| suspend fun fetchPublicProfile(username: String): Record6<String, String, String?, String?, Int, String?>? { |
There was a problem hiding this comment.
@copilot instead of Record6, map to User (jOOQ generated pojo)
There was a problem hiding this comment.
Addressed in 738980b. fetchPublicProfile() now maps directly to the generated jOOQ User POJO, UserService.fetchProfile() reads named properties from that POJO, and I added a focused regression test for the mapping.
| UI.pushInfoNotification('Profile picture successfully updated!', UI_NOTIFICATION_TIMEOUT); | ||
| }); | ||
|
|
||
| fetch(PROFILE_PICTURE_UPLOAD_URL, { |
There was a problem hiding this comment.
@copilot we should we able to re-use postAndHandle (api.js)
There was a problem hiding this comment.
Fixed in 0064e81. postAndHandle now supports FormData payloads without forcing a JSON content type, and the profile-picture upload now reuses that helper directly.
|
@copilot resolve the merge conflicts in this pull request |
Resolved in |
|
@copilot resolve the merge conflicts in this pull request |
Resolved in |
|
@copilot resolve the merge conflicts in this pull request |
Resolved in |
This adds first-class profile picture support for user profiles. Users can choose and crop a square image in settings, upload it to the CDN under a profile-scoped path, and have it rendered on their public profile.
Changes Made
Settings UI
masterwhile resolving merge conflicts.Upload pipeline
/api/user/settings/profile-pictureupload endpoint.<profile>/profile-pictures/<userId>.<original extension>dev,prod, andlocal-backupdo not share the same CDN folder.Persistence and profile data
profile_picture_extensioncolumn via Liquibase.profile + userId + extension.Public profile rendering
masterduring conflict resolution.Merge resolution follow-up
masterand kept the profile picture feature intact while preserving newer upstream changes.master's new0105/0106/0107changesets remain in place, and the profile-picture migration is applied as0108.master'sappConfig.saltrefactor inUserServicewhile retaining the profile field, and added the new requiredsymmetricKey/saltAppConfigparameters toUserProfilePictureServiceTest.Testing
JAVA_HOME=/usr/lib/jvm/temurin-21-jdk-amd64 ./gradlew --no-daemon liquibaseGeneration :webapp-service-layer:test --tests io.elephantchess.servicelayer.services.UserServiceTest --tests io.elephantchess.servicelayer.services.UserProfilePictureServiceTest --tests io.elephantchess.db.services.UserDaoServiceTest :webapp:test --tests io.elephantchess.webapp.rendering.UserProfilePageRendererTestcd webapp/src/test/js && node --testExample storage/public path convention: