feat(profile): port the cu-15 profile screen#34
Merged
Conversation
`initialsOf` was duplicated in LoginScreen and the lobby header, and the `GameKey -> drawable` mapping in both the lobby and history screens. With the profile screen about to need both, pull them into single homes (`util/Initials.kt` and `ui/GameKeyIcon.kt`) and route the existing call sites through them. No behavior change; pure deduplication.
ProfileViewModel observes AuthRepository.currentUser and maps the signed-in user into the identity block (name, email, Google provider, avatar monogram); the P&L summary and game-activity breakdown render as static placeholders until the Firestore/Room stats layer lands. The screen covers all three states (Success, Loading skeleton, Error retry), the settings sheet (ModalBottomSheet, visual stub), deep links to KYC and the House Wallet, and Sign Out, which tears down the session and lets the nav host clear the back stack to Login. Replaces the Profile placeholder in StackNavHost. Per-section composables live in their own files to keep each focused. Tests: ProfileViewModelTest (Success mapping, name fallback, Error on a failing stream, signOut delegation) and ProfileScreenTest (the three states plus the Sign Out callback).
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
Ports the cu-15 profile screen (mockup/js/screens/profile.js) and wires it into the nav graph in place of the placeholder.
ProfileViewModelobservesAuthRepository.currentUserand maps the signed-in user into the identity block (name, email, Google provider, avatar monogram); the P&L summary and game-activity breakdown render as static placeholders until the Firestore/Room stats layer lands (same approach as Lobby and Wallet). The screen covers Success, the Loading skeleton and the Error retry card, plus the settings sheet (ModalBottomSheet), deep links to KYC and the House Wallet, and Sign Out.This branch also lands a small prep refactor:
initialsOfand theGameKey -> drawablemapping were duplicated across login / lobby / history, so they were extracted intoutil/Initials.ktandui/GameKeyIcon.ktand the existing call sites routed through them (first commit).Rationale
AuthRepository); stats are placeholders because the stats source is a later entrega. The Error state is functional via arefresh()retry trigger, which is also the seam the Firestore stats load will plug into.viewModel.signOut()) followed by navigation; the nav host clears the whole graph withpopUpTo(graph) { inclusive = true }so Back cannot return to an authenticated screen.Verification
./gradlew ktlintCheck detekt testDebugUnitTest-> BUILD SUCCESSFUL./gradlew assembleDebug-> BUILD SUCCESSFUL./gradlew compileDebugAndroidTestKotlin-> BUILD SUCCESSFULTest plan
ProfileViewModelTestgreen (mapping, name fallback, error, signOut)ProfileScreenTestcompiles (instrumented; not run in the CI matrix)Checklist
feat/).[Unreleased].Notes
The README status table is stale beyond this PR (it lists Lobby / Wallet / History / News / Assistant as "not implemented yet" although they shipped). Refreshing it is left to a dedicated docs pass rather than partially editing one grouped cell here.