fix: Show "Opening container" on loading screen when opening a container instead of saying "Launching Game"#1563
Conversation
…nstead of saying "Launching Game"
📝 WalkthroughWalkthroughThe PR makes boot splash text context-aware by checking the ChangesBoot Splash Context-Aware Messaging
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
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 |
|
Trying to fix an issue where "Launching game" still appears for a second when opening a container and where "Opening Container" appears for a second when launching a game. Seen in this video Screen_Recording_20260609_165248_GameNative.mp4 |
|
Fixed, video is larger than 10mb so i cant upload it uncompressed, here's the zip. |
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/xserver/XServerScreen.kt">
<violation number="1" location="app/src/main/java/app/gamenative/ui/screen/xserver/XServerScreen.kt:3245">
P2: Hardcoded UI splash text literals should be moved to string resources and deduplicated</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| if (preInstallCommands.isNotEmpty()) { | ||
| PluviaApp.events.emit(AndroidEvent.SetBootingSplashText("Installing prerequisites...")) | ||
| } else if (bootToContainer) { | ||
| PluviaApp.events.emit(AndroidEvent.SetBootingSplashText("Opening container...")) |
There was a problem hiding this comment.
P2: Hardcoded UI splash text literals should be moved to string resources and deduplicated
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/src/main/java/app/gamenative/ui/screen/xserver/XServerScreen.kt, line 3245:
<comment>Hardcoded UI splash text literals should be moved to string resources and deduplicated</comment>
<file context>
@@ -3239,8 +3239,10 @@ private fun setupXEnvironment(
+ if (preInstallCommands.isNotEmpty()) {
PluviaApp.events.emit(AndroidEvent.SetBootingSplashText("Installing prerequisites..."))
+ } else if (bootToContainer) {
+ PluviaApp.events.emit(AndroidEvent.SetBootingSplashText("Opening container..."))
} else {
PluviaApp.events.emit(AndroidEvent.SetBootingSplashText("Launching game..."))
</file context>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/src/main/java/app/gamenative/ui/model/MainViewModel.kt`:
- Around line 452-455: The two separate state updates (setShowBootingSplash and
setBootingSplashText) can cause a one-frame flash of stale text; change the code
to perform a single atomic state update on _state (e.g., use _state.update {
it.copy(showBootingSplash = true, bootingSplashText = if (it.bootToContainer)
"Opening container..." else "Launching game...") }) so both visibility and text
change together; update the call site where setShowBootingSplash and
setBootingSplashText are invoked to use this single _state.update to avoid
intermediate state.
🪄 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: 42c871ea-e786-4a0c-8f43-ebead076f88b
📒 Files selected for processing (2)
app/src/main/java/app/gamenative/ui/model/MainViewModel.ktapp/src/main/java/app/gamenative/ui/screen/xserver/XServerScreen.kt
| setShowBootingSplash(true) | ||
| + // Set the correct splash text immediately so it doesn't flash stale text from a previous session | ||
| + setBootingSplashText(if (_state.value.bootToContainer) "Opening container..." else "Launching game...") | ||
| PluviaApp.events.emit(AndroidEvent.SetAllowedOrientation(PrefManager.allowedOrientation)) |
There was a problem hiding this comment.
Make splash visibility+text update atomic to fully eliminate stale-text flash.
Line 452 and Line 454 emit two separate state updates, so the splash can still appear for one frame with old text. Update both fields in a single _state.update (or set text before visibility in one transaction path).
Suggested fix
- setShowBootingSplash(true)
- // Set the correct splash text immediately so it doesn't flash stale text from a previous session
- setBootingSplashText(if (_state.value.bootToContainer) "Opening container..." else "Launching game...")
+ _state.update {
+ it.copy(
+ showBootingSplash = true,
+ bootingSplashText = if (it.bootToContainer) "Opening container..." else "Launching game...",
+ )
+ }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@app/src/main/java/app/gamenative/ui/model/MainViewModel.kt` around lines 452
- 455, The two separate state updates (setShowBootingSplash and
setBootingSplashText) can cause a one-frame flash of stale text; change the code
to perform a single atomic state update on _state (e.g., use _state.update {
it.copy(showBootingSplash = true, bootingSplashText = if (it.bootToContainer)
"Opening container..." else "Launching game...") }) so both visibility and text
change together; update the call site where setShowBootingSplash and
setBootingSplashText are invoked to use this single _state.update to avoid
intermediate state.
Description
Previously when opening a container for any game would give a loading screen saying "Launching game" which doesn't correspond to what is actually happening, this changes the loading screen to instead say "Opening container" ONLY when the "Open Container" option is pressed, this has no effect on any other loading screen.
Recording
Screen_Recording_20260609_220114_GameNative.zip
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
Show “Opening container...” on the splash screen when using Open Container, instead of “Launching game...”.
Set the correct splash text immediately on launch to avoid flashing stale text; other states still use “Installing prerequisites...” and “Launching game...”.
Written for commit dcdcffd. Summary will update on new commits.
Summary by CodeRabbit