fix: allow state and page to resume on app refocus instead of rerouting to login and library#604
fix: allow state and page to resume on app refocus instead of rerouting to login and library#604xXJSONDeruloXx wants to merge 3 commits intoutkarshdalal:masterfrom
Conversation
…ng to login and library
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a lifecycle-scoped boolean guard in PluviaMain.kt to ensure the initial Steam connectivity check and potential foreground SteamService start run only once, adjusts navigation conditions after intent launches to require LoginUser for certain Home navigations, and removes an automatic per-cycle Home navigation when SteamService is logged in but not kept alive. Changes
Sequence Diagram(s)sequenceDiagram
participant Lifecycle as LifecycleOwner
participant UI as PluviaMain UI
participant Steam as SteamService
participant Nav as NavController
Lifecycle->>UI: on first lifecycle pass
UI->>UI: check hasAttemptedInitialSteamConnect (false)
UI->>Steam: perform initial connectivity check
alt Steam not connected
UI->>Steam: startForegroundService (initial attempt)
Steam-->>UI: started / attempting
else Steam connected
Steam-->>UI: already logged in
end
UI->>Nav: handle pending intent / evaluate destination
alt current == LoginUser and xEnvironment == null
Nav-->>UI: navigate to Home
else
Nav-->>UI: keep current route
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 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/PluviaMain.kt`:
- Line 124: The saved-instance-state use of hasAttemptedInitialSteamConnect via
rememberSaveable prevents SteamService restart after system-initiated process
death; change the declaration using rememberSaveable to use remember so the flag
is ephemeral (reset on fresh process/composition) — update the var
hasAttemptedInitialSteamConnect by rememberSaveable { mutableStateOf(false) } to
use remember { mutableStateOf(false) } (also apply the same change to the other
occurrences noted around the 402-409 block) so the startForegroundService guard
doesn't short-circuit after process restore.
|
So the UI overhaul work already does this as far as I remember :) |
|
@phobos665 yeah but not sure how long it will be before that merges, lots to review and discuss. any merrit to taking this for current state in mean time? and if I recall from discord discussions, we probably want to merge in amazon games first, then another round of conflict resolution to ui overhaul as a result. |
|
@phobos665 yeah but not sure how long it will be before that merges, lots to review and discuss. any merrit to taking this for current state in mean time? I'm in favour of it, I think I was slightly awkward in what I meant here. Is this consistent with how the UI overhaul does the same functionality? Just so you don't need to compete with 2 differing implementations |
|
@phobos665 yes, shouldn't conflict |
https://discord.com/channels/1378308569287622737/1474986033031544972
Summary by cubic
Keep the current screen and state when returning to the app, instead of redirecting to Login/Library. Settings and Edit Container now stay open while multitasking.
Written for commit d79536f. Summary will update on new commits.
Summary by CodeRabbit