Skip to content

feat(profile): port the cu-15 profile screen#34

Merged
netqo merged 2 commits into
devfrom
feat/profile-screen
Jun 11, 2026
Merged

feat(profile): port the cu-15 profile screen#34
netqo merged 2 commits into
devfrom
feat/profile-screen

Conversation

@netqo

@netqo netqo commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Summary

Ports the cu-15 profile screen (mockup/js/screens/profile.js) and wires it into the nav graph in place of the placeholder. 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 (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: initialsOf and the GameKey -> drawable mapping were duplicated across login / lobby / history, so they were extracted into util/Initials.kt and ui/GameKeyIcon.kt and the existing call sites routed through them (first commit).

Rationale

  • Identity is real (from AuthRepository); stats are placeholders because the stats source is a later entrega. The Error state is functional via a refresh() retry trigger, which is also the seam the Firestore stats load will plug into.
  • Sign Out is fire-and-forget (viewModel.signOut()) followed by navigation; the nav host clears the whole graph with popUpTo(graph) { inclusive = true } so Back cannot return to an authenticated screen.
  • Per-section composables live in their own files to keep each focused, matching the Wallet / News / Lobby layout.
  • The settings sheet toggles and the cache-clear action are visual stubs; persisting settings and wiping the Room cache ship with the data layer.

Verification

  • ./gradlew ktlintCheck detekt testDebugUnitTest -> BUILD SUCCESSFUL
  • ./gradlew assembleDebug -> BUILD SUCCESSFUL
  • ./gradlew compileDebugAndroidTestKotlin -> BUILD SUCCESSFUL
  • On device: Login -> Profile tab shows the real Google identity; P&L / game activity / account sections render; the gear opens the settings sheet; Verify Identity and House Wallet navigate; Sign Out returns to Login and Back does not re-enter Profile.

Test plan

  • ktlint + detekt clean
  • ProfileViewModelTest green (mapping, name fallback, error, signOut)
  • ProfileScreenTest compiles (instrumented; not run in the CI matrix)
  • Debug APK assembles
  • Manual device walkthrough of the five states / flows above

Checklist

  • Commit messages follow Conventional Commits (see CONTRIBUTING.md).
  • Branch name follows the naming convention (feat/).
  • The change is scoped: the only non-profile change is the shared-helper extraction the screen depends on (its own commit).
  • If user-visible behavior changed, CHANGELOG.md has been updated under [Unreleased].
  • If a new dependency was added, it is justified in the PR description. (No new dependency; ModalBottomSheet ships with the existing Material3 BoM.)

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.

netqo added 2 commits June 11, 2026 02:38
`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).
@netqo netqo merged commit 17a5e95 into dev Jun 11, 2026
3 checks passed
@netqo netqo deleted the feat/profile-screen branch June 11, 2026 16:29
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