-
-
Notifications
You must be signed in to change notification settings - Fork 91
Improves DLC selection and download status #406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improves DLC selection and download status #406
Conversation
Adds a "Select All/Deselect All" button to the game manager dialog for easier DLC selection. Shows installed DLC even if a download is in progress for the base game. This improves the user experience by allowing users to quickly select or deselect all available DLCs and clarifies the download status of apps.
📝 WalkthroughWalkthroughRemoved one DAO cleanup call from SteamService, added optional-DLC handling, selectable-app bulk toggle, and UI dividers in GameManagerDialog, and hid Steam-specific menu options during active downloads in SteamAppScreen. Changes
Sequence Diagram(s)(Skipped — changes are localized and do not introduce a new multi-component sequential flow requiring visualization.) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
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
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 |
Addresses an issue where DLCs were not correctly identified as installed, particularly concerning optional and indirect DLCs. Updates the logic to accurately determine the installation state of DLCs based on their type and installation status, ensuring a more reliable user experience.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In @app/src/main/java/app/gamenative/ui/component/dialog/GameManagerDialog.kt:
- Around line 398-419: Replace the hardcoded button labels in the select-all
toggle with string resources: use stringResource(R.string.select_all) when
allSelectableSelected is false and stringResource(R.string.deselect_all) when
true (the UI code affecting selectableAppIds, allSelectableSelected and
selectedAppIds). Add entries to strings.xml: <string name="select_all">Select
all</string> and <string name="deselect_all">Deselect all</string>, and ensure
stringResource is imported (androidx.compose.ui.res.stringResource) in
GameManagerDialog.kt.
In
@app/src/main/java/app/gamenative/ui/screen/library/appscreen/SteamAppScreen.kt:
- Around line 612-616: The code is using
SteamService.getDownloadingAppInfoOf(...) which checks persistent DB records
instead of the in-memory active download job; replace that call with
SteamService.getAppDownloadInfo(gameId) when computing isDownloadInProgress so
the UI only hides options for actually running downloads. Update the variable
assignment for isDownloadInProgress to call getAppDownloadInfo with gameId and
keep the existing null-check logic (i.e., compare to null) so behavior matches
other uses at lines where getAppDownloadInfo is used.
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
app/src/main/java/app/gamenative/service/SteamService.ktapp/src/main/java/app/gamenative/ui/component/dialog/GameManagerDialog.ktapp/src/main/java/app/gamenative/ui/screen/library/appscreen/SteamAppScreen.kt
💤 Files with no reviewable changes (1)
- app/src/main/java/app/gamenative/service/SteamService.kt
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2025-09-19T17:07:27.941Z
Learnt from: utkarshdalal
Repo: utkarshdalal/GameNative PR: 159
File: app/src/main/java/app/gamenative/service/DownloadService.kt:6-6
Timestamp: 2025-09-19T17:07:27.941Z
Learning: In app/src/main/java/app/gamenative/service/DownloadService.kt, the getSizeFromStoreDisplay() function uses runBlocking to call SteamService.getDownloadableDepots() because the latter was converted from synchronous to suspend in this PR. The user confirmed the previous synchronous implementation worked fine, and if performance is acceptable, keeping runBlocking is a valid approach.
Applied to files:
app/src/main/java/app/gamenative/ui/screen/library/appscreen/SteamAppScreen.ktapp/src/main/java/app/gamenative/ui/component/dialog/GameManagerDialog.kt
📚 Learning: 2025-09-28T13:56:06.888Z
Learnt from: utkarshdalal
Repo: utkarshdalal/GameNative PR: 176
File: app/src/main/java/app/gamenative/service/SteamService.kt:179-180
Timestamp: 2025-09-28T13:56:06.888Z
Learning: In the GameNative project, the AppInfo table (with AppInfoDao) tracks local game installation state including which apps are downloaded and which depots were installed. This data should NOT be cleared during logout in clearDatabase() because games remain physically installed on the device and users should see their installed games when logging back in. Only user-specific Steam account data should be cleared on logout.
Applied to files:
app/src/main/java/app/gamenative/ui/screen/library/appscreen/SteamAppScreen.ktapp/src/main/java/app/gamenative/ui/component/dialog/GameManagerDialog.kt
📚 Learning: 2025-09-28T13:54:16.048Z
Learnt from: utkarshdalal
Repo: utkarshdalal/GameNative PR: 176
File: app/src/main/java/app/gamenative/utils/SteamUtils.kt:651-655
Timestamp: 2025-09-28T13:54:16.048Z
Learning: In the GameNative project, when creating depots.txt files in SteamUtils.ensureSteamSettings, only create the file when SteamService.getInstalledDepotsOf() returns actual data (non-null). Don't create empty files or write empty strings when no data is available.
Applied to files:
app/src/main/java/app/gamenative/ui/component/dialog/GameManagerDialog.kt
🔇 Additional comments (5)
app/src/main/java/app/gamenative/ui/component/dialog/GameManagerDialog.kt (5)
21-21: LGTM!Standard import for the
HorizontalDividercomposable used in the list UI.
113-119: LGTM!The logic correctly identifies optional DLCs by filtering depots where
optionalDlcId == dlcAppId. This is then used to exclude these DLCs from being pre-selected, which aligns with the expected behavior for optional content.
133-137: LGTM!The updated selection logic correctly handles three DLC categories:
- Pre-selects installed content (base game, installed DLCs)
- Pre-selects "regular" DLCs that are neither optional nor indirect
- Leaves optional and indirect DLCs unchecked by default
This aligns with user expectations where optional content should require explicit selection.
244-254: LGTM!The derived states are well-implemented:
selectableAppIdscorrectly identifies enabled (toggleable) DLCsallSelectableSelectedefficiently checks if all selectable items are selected- Using
derivedStateOfwith.toMap()as keys ensures proper recomposition when the underlying state changes
455-460: LGTM!The divider styling is appropriate—thin (0.5dp) and subtle (0.3 alpha) to separate list items without being visually heavy.
| // Select All toggle | ||
| if (selectableAppIds.isNotEmpty()) { | ||
| Row( | ||
| modifier = Modifier | ||
| .fillMaxWidth() | ||
| .padding(horizontal = 16.dp, vertical = 8.dp), | ||
| horizontalArrangement = Arrangement.End | ||
| ) { | ||
| Button( | ||
| onClick = { | ||
| val newState = !allSelectableSelected | ||
| selectableAppIds.forEach { appId -> | ||
| selectedAppIds[appId] = newState | ||
| } | ||
| } | ||
| ) { | ||
| Text( | ||
| text = if (allSelectableSelected) "Deselect all" else "Select all" | ||
| ) | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hardcoded strings should use string resources for localization.
The button labels "Deselect all" and "Select all" are hardcoded. For consistency with the rest of the codebase (which uses stringResource(R.string.xxx)), these should be moved to string resources.
Suggested fix
Button(
onClick = {
val newState = !allSelectableSelected
selectableAppIds.forEach { appId ->
selectedAppIds[appId] = newState
}
}
) {
Text(
- text = if (allSelectableSelected) "Deselect all" else "Select all"
+ text = stringResource(if (allSelectableSelected) R.string.deselect_all else R.string.select_all)
)
}Add corresponding entries to strings.xml:
<string name="select_all">Select all</string>
<string name="deselect_all">Deselect all</string>Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In @app/src/main/java/app/gamenative/ui/component/dialog/GameManagerDialog.kt
around lines 398 - 419, Replace the hardcoded button labels in the select-all
toggle with string resources: use stringResource(R.string.select_all) when
allSelectableSelected is false and stringResource(R.string.deselect_all) when
true (the UI code affecting selectableAppIds, allSelectableSelected and
selectedAppIds). Add entries to strings.xml: <string name="select_all">Select
all</string> and <string name="deselect_all">Deselect all</string>, and ensure
stringResource is imported (androidx.compose.ui.res.stringResource) in
GameManagerDialog.kt.
| val isDownloadInProgress = SteamService.getDownloadingAppInfoOf(gameId) != null | ||
|
|
||
| if (!isInstalled) { | ||
| if (!isInstalled || isDownloadInProgress) { | ||
| return emptyList() | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
# Find SteamService file
fd -t f -i "SteamService"Repository: utkarshdalal/GameNative
Length of output: 123
🏁 Script executed:
# Search for both methods to understand their semantics
rg "fun getDownloadingAppInfoOf|fun getAppDownloadInfo" -A 5Repository: utkarshdalal/GameNative
Length of output: 1368
🏁 Script executed:
# Examine the usages in SteamAppScreen.kt at the mentioned lines
sed -n '315,325p' app/src/main/java/app/gamenative/ui/screen/library/appscreen/SteamAppScreen.kt
sed -n '427,437p' app/src/main/java/app/gamenative/ui/screen/library/appscreen/SteamAppScreen.ktRepository: utkarshdalal/GameNative
Length of output: 1094
🏁 Script executed:
# Check what DownloadingAppInfo and DownloadInfo types are
rg "data class DownloadingAppInfo|data class DownloadInfo" -A 3Repository: utkarshdalal/GameNative
Length of output: 721
🏁 Script executed:
# Verify what getDownloadingAppInfoOf is used for elsewhere
rg "getDownloadingAppInfoOf" -B 2 -A 2Repository: utkarshdalal/GameNative
Length of output: 2369
Use getAppDownloadInfo instead of getDownloadingAppInfoOf to check if a download is actively in progress.
The two methods have different semantics:
getDownloadingAppInfoOf()queries the database for a persistent download record (used for detecting incomplete downloads on disk for resume logic)getAppDownloadInfo()checks the in-memory active download job (used throughout SteamAppScreen at lines 320-321 and 432-433 to determine if a download is currently running)
Using getDownloadingAppInfoOf() at line 612 would hide menu options for any app with a partial download record in the database, not just those with actively running downloads. This differs from the consistent pattern established elsewhere in the file and could cause poor UX (e.g., options hidden after a cancelled or failed download).
🤖 Prompt for AI Agents
In
@app/src/main/java/app/gamenative/ui/screen/library/appscreen/SteamAppScreen.kt
around lines 612 - 616, The code is using
SteamService.getDownloadingAppInfoOf(...) which checks persistent DB records
instead of the in-memory active download job; replace that call with
SteamService.getAppDownloadInfo(gameId) when computing isDownloadInProgress so
the UI only hides options for actually running downloads. Update the variable
assignment for isDownloadInProgress to call getAppDownloadInfo with gameId and
keep the existing null-check logic (i.e., compare to null) so behavior matches
other uses at lines where getAppDownloadInfo is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @gradle/libs.versions.toml:
- Line 14: The libs.versions.toml entry for the javasteam alias currently
references a non-published SNAPSHOT and misdocuments the groupId; replace the
SNAPSHOT version with a published release (e.g., change javasteam =
"1.8.0-6-SNAPSHOT" to the published version like "1.8.0-6" or another released
tag) and update the inline comment to reflect the correct coordinates
(io.github.joshuatam/javasteam) so dependency resolution succeeds when
localBuild = false; alternatively, if you must keep a SNAPSHOT, configure and
document a repository that actually hosts that SNAPSHOT (e.g., GitHub Packages
or your snapshot repo) and ensure build.gradle.kts includes that repository.
🧹 Nitpick comments (1)
app/build.gradle.kts (1)
229-233: Use version catalog to reduce duplication in local jar filenamesThe JavaSteam version string is currently maintained in both
gradle/libs.versions.toml(1.8.0-6-SNAPSHOT) and these hardcoded jar paths, making it easy to bump one and forget the other during future updates.Suggested refactor (use version catalog accessor)
// JavaSteam val localBuild = false // Change to 'true' needed when building JavaSteam manually if (localBuild) { - implementation(files("../../JavaSteam/build/libs/javasteam-1.8.0-6-SNAPSHOT.jar")) - implementation(files("../../JavaSteam/javasteam-depotdownloader/build/libs/javasteam-depotdownloader-1.8.0-6-SNAPSHOT.jar")) + val javasteamVersion = libs.versions.javasteam.get() + implementation(files("../../JavaSteam/build/libs/javasteam-$javasteamVersion.jar")) + implementation(files("../../JavaSteam/javasteam-depotdownloader/build/libs/javasteam-depotdownloader-$javasteamVersion.jar")) implementation(libs.bundles.javasteam.dev) } else {
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
app/build.gradle.ktsgradle/libs.versions.toml
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: utkarshdalal
Repo: utkarshdalal/GameNative PR: 176
File: app/src/main/java/app/gamenative/utils/SteamUtils.kt:651-655
Timestamp: 2025-09-28T13:54:16.048Z
Learning: In the GameNative project, when creating depots.txt files in SteamUtils.ensureSteamSettings, only create the file when SteamService.getInstalledDepotsOf() returns actual data (non-null). Don't create empty files or write empty strings when no data is available.
Learnt from: utkarshdalal
Repo: utkarshdalal/GameNative PR: 176
File: app/src/main/java/app/gamenative/service/SteamService.kt:179-180
Timestamp: 2025-09-28T13:56:06.888Z
Learning: In the GameNative project, the AppInfo table (with AppInfoDao) tracks local game installation state including which apps are downloaded and which depots were installed. This data should NOT be cleared during logout in clearDatabase() because games remain physically installed on the device and users should see their installed games when logging back in. Only user-specific Steam account data should be cleared on logout.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
| feature-delivery = "2.1.0" # https://mvnrepository.com/artifact/com.google.android.play/feature-delivery | ||
| hiltNavigationCompose = "1.2.0" # https://mvnrepository.com/artifact/androidx.hilt/hilt-navigation-compose | ||
| javasteam = "1.8.0-5-SNAPSHOT" # https://mvnrepository.com/artifact/in.dragonbra/javasteam | ||
| javasteam = "1.8.0-6-SNAPSHOT" # https://mvnrepository.com/artifact/in.dragonbra/javasteam |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
# First, let's examine the gradle/libs.versions.toml file to understand the context better
find . -name "libs.versions.toml" -o -name "build.gradle*" -o -name "settings.gradle*" | head -20Repository: utkarshdalal/GameNative
Length of output: 186
🏁 Script executed:
# Search for the gradle/libs.versions.toml file and read it
if [ -f "gradle/libs.versions.toml" ]; then
echo "=== gradle/libs.versions.toml ==="
cat -n gradle/libs.versions.toml | head -100
fiRepository: utkarshdalal/GameNative
Length of output: 10070
🏁 Script executed:
# Look for Gradle repository definitions
find . -name "build.gradle" -o -name "build.gradle.kts" -o -name "settings.gradle" -o -name "settings.gradle.kts" | xargs grep -l "repositories" 2>/dev/null | head -5Repository: utkarshdalal/GameNative
Length of output: 88
🌐 Web query:
io.github.joshuatam javasteam 1.8.0-6-SNAPSHOT Maven artifact repository
💡 Result:
I couldn't find any published Maven artifact with coordinates io.github.joshuatam:javasteam:1.8.0-6-SNAPSHOT. Public javasteam artifacts appear under groupId in.dragonbra on Maven Central (e.g. javasteam versions listed). [1][2]
If you need that specific SNAPSHOT you can:
- Check the project's GitHub repo or its GitHub Packages (SNAPSHOTs are often published there). See GitHub Packages Maven docs. [3]
- Build & install locally (mvn install) or publish to a repository you control (GitHub Packages, Nexus/OSSRH, or JitPack). [3]
Sources:
- Javasteam listings (in.dragonbra) — mvnrepository.com. [1]
- Maven Central / artifact pages for javasteam (in.dragonbra). [2]
- Publishing Java packages with Maven — GitHub Docs (publishing SNAPSHOTs to GitHub Packages). [3]
If you want, I can: search the project's GitHub for tags/releases, check GitHub Packages for that owner, or show pom/deployment steps to publish the SNAPSHOT.
🏁 Script executed:
cat -n settings.gradle.ktsRepository: utkarshdalal/GameNative
Length of output: 897
🏁 Script executed:
# Check if there are references to GitHub Packages or snapshot repositories
grep -r "repositories\|maven\|github\|snapshot" settings.gradle.kts build.gradle.kts 2>/dev/null | head -30Repository: utkarshdalal/GameNative
Length of output: 436
🌐 Web query:
io.github.joshuatam javasteam GitHub Packages releases published
💡 Result:
Do you mean the Maven/Gradle package coordinates "io.github.joshuatam:javasteam" and whether any versions are published to GitHub Packages (or Maven Central)? If so, do you want (a) a list of published versions, (b) confirmation that none exist, or (c) help publishing a release?
🌐 Web query:
Longi94 JavaSteam io.github.joshuatam 1.8.0-6-SNAPSHOT Maven artifact where published
💡 Result:
I couldn't find that exact artifact on Maven Central. Artifacts with groupId pattern io.github.* and SNAPSHOT versions are most commonly published via JitPack or GitHub Packages (Maven). Check those two places first:
- JitPack (lookup by GitHub repo; supports snapshot builds). [1][2]
- GitHub Packages (Apache Maven registry; supports SNAPSHOTs with auth). [3]
If you want, I can look up the exact io.github.joshuatam:javasteam:1.8.0-6-SNAPSHOT coordinates on JitPack/GitHub Packages—shall I search them now?
Sources:
[1] JitPack docs — building & snapshots.
[2] JitPack API/docs.
[3] GitHub Packages — Maven registry (SNAPSHOT support).
🌐 Web query:
Longi94 JavaSteam GitHub repository io.github.joshuatam artifact publishing Maven
💡 Result:
Do you want instructions to publish JavaSteam from Longi94 under the groupId io.github.joshuatam to a Maven registry (Maven Central or GitHub Packages)? If so, confirm which registry (Maven Central or GitHub Packages) and whether you prefer Maven or Gradle—then I’ll give step-by-step instructions.
References: GitHub publishing guide (Maven) [1], JavaSteam repo (Longi94) [2].
🌐 Web query:
site:maven.org OR site:oss.sonatype.org "io.github.joshuatam" "javasteam"
💡 Result:
I searched Maven Central and Sonatype OSS (the query you provided) and found no results for site:maven.org OR site:oss.sonatype.org "io.github.joshuatam" "javasteam".
No matching artifacts or pages were returned. Would you like me to:
- broaden the search (remove the site: filter), or
- search GitHub and other code hosting for "io.github.joshuatam" / "javasteam"?
🏁 Script executed:
# Check if there are any comments or docs in the repo about building/publishing javasteam
grep -r "javasteam\|JavaSteam" . --include="*.md" --include="*.txt" --include="*.gradle*" 2>/dev/null | grep -i "build\|publish\|snapshot\|version" | head -20Repository: utkarshdalal/GameNative
Length of output: 827
Fix artifact coordinates and documentation; SNAPSHOT is not published
The SNAPSHOT artifact io.github.joshuatam:javasteam:1.8.0-6-SNAPSHOT does not exist on Maven Central, Sonatype snapshots, or any standard public repository. The build will fail during dependency resolution when localBuild = false (the current default in app/build.gradle.kts).
Additionally, the comment on line 14 points to in.dragonbra/javasteam but the actual library coordinates use io.github.joshuatam (lines 72–73). Update the comment to reflect the correct groupId to avoid future confusion, or publish the SNAPSHOT to a configured repository (GitHub Packages, local Maven repo, etc.).
🤖 Prompt for AI Agents
In @gradle/libs.versions.toml at line 14, The libs.versions.toml entry for the
javasteam alias currently references a non-published SNAPSHOT and misdocuments
the groupId; replace the SNAPSHOT version with a published release (e.g., change
javasteam = "1.8.0-6-SNAPSHOT" to the published version like "1.8.0-6" or
another released tag) and update the inline comment to reflect the correct
coordinates (io.github.joshuatam/javasteam) so dependency resolution succeeds
when localBuild = false; alternatively, if you must keep a SNAPSHOT, configure
and document a repository that actually hosts that SNAPSHOT (e.g., GitHub
Packages or your snapshot repo) and ensure build.gradle.kts includes that
repository.
* Improves DLC selection and download status Adds a "Select All/Deselect All" button to the game manager dialog for easier DLC selection. Shows installed DLC even if a download is in progress for the base game. This improves the user experience by allowing users to quickly select or deselect all available DLCs and clarifies the download status of apps. * Corrects DLC installation logic in game manager Addresses an issue where DLCs were not correctly identified as installed, particularly concerning optional and indirect DLCs. Updates the logic to accurately determine the installation state of DLCs based on their type and installation status, ensuring a more reliable user experience. * does not delete app_info data when login or steam login has error * updates JavaSteam to add delay on large depots size
Updates:
Ref:
joshuatam/JavaSteam@554f8cb
Summary by CodeRabbit
New Features
Bug Fixes
Chores
✏️ Tip: You can customize this high-level summary in your review settings.