fix: clear persona state and hide status picker on sign out#1312
Conversation
📝 WalkthroughWalkthroughThe changes add logout-related persona state cleanup across the Steam service and UI layers. SteamService now resets its cached Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@app/src/main/java/app/gamenative/ui/screen/library/components/SystemMenu.kt`:
- Around line 286-288: onLoggedOut currently clears persona but doesn't close
the status picker, so update the onLoggedOut handler (the lambda assigned to
onLoggedOut) to also set showStatusPicker = false when clearing persona; this
ensures the DropdownMenu (which uses expanded = showStatusPicker) is collapsed
on logout and the status controls are fully hidden.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 7b150687-08a3-463a-9523-05897a9a1395
📒 Files selected for processing (2)
app/src/main/java/app/gamenative/service/SteamService.ktapp/src/main/java/app/gamenative/ui/screen/library/components/SystemMenu.kt
There was a problem hiding this comment.
1 issue found across 2 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="app/src/main/java/app/gamenative/ui/screen/library/components/SystemMenu.kt">
<violation number="1" location="app/src/main/java/app/gamenative/ui/screen/library/components/SystemMenu.kt:287">
P2: Logout handler does not clear `showStatusPicker`, so the status dropdown can remain open after sign-out.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
|
nice fix, thanks |
Description
When signing out of Steam via the system menu, the games list cleared correctly but the profile picture, account name, online status, and status picker dropdown remained visible with the previous user's data.
(This is the view after I've signed out)
Root cause:
SystemMenuseedspersonastate once on composition fromSteamService.localPersonaand updates it viaPersonaStateReceivedevents, but had no handler forSteamEvent.LoggedOutto clear it. Additionally,_localPersonainSteamServiceis an in-memoryStateFlownot reset on logout, so ifSystemMenure-enters composition (e.g. after a game session),LaunchedEffect(Unit)would re-read the stale persona.Changes:
SteamService.kt- reset_localPersonatoSteamFriend()inperformLogOffDuties, so the in-memory state matches the cleared preferencesSystemMenu.kt- addSteamEvent.LoggedOuthandler to setpersona = SteamFriend()(blank name, offline state, no avatar), matching the appearance when skipping loginSystemMenu.kt- gate the status picker click handler and dropdown arrow onSteamService.isLoggedIn, consistent with the existing pattern at line 613Recording
trim.991ABAA0-2532-479B-9B6B-D62CC33BFA09.MOV
Type of Change
Checklist
#code-changes, I have discussed this change there and it has been green-lighted. If I do not have access, I have still provided clear context in this PR. If I skip both, I accept that this change may face delays in review, may not be reviewed at all, or may be closed.CONTRIBUTING.md.Summary by cubic
Clear persona UI and close/hide the status picker on sign out so the System Menu doesn’t show the previous user’s avatar, name, or status. The menu now reflects the logged-out state immediately and after recomposition.
_localPersonatoSteamFriend()on logout inSteamService.SteamEvent.LoggedOutinSystemMenuto setpersona = SteamFriend()andshowStatusPicker = false.SteamService.isLoggedInso they’re hidden when logged out.Written for commit 5330ac1. Summary will update on new commits. Review in cubic
Summary by CodeRabbit