Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ dependencies {
// JavaSteam
val localBuild = false // Change to 'true' needed when building JavaSteam manually
if (localBuild) {
implementation(files("../../JavaSteam/build/libs/javasteam-1.8.0-5-SNAPSHOT.jar"))
implementation(files("../../JavaSteam/javasteam-depotdownloader/build/libs/javasteam-depotdownloader-1.8.0-5-SNAPSHOT.jar"))
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"))
implementation(libs.bundles.javasteam.dev)
} else {
implementation(libs.javasteam) {
Expand Down
1 change: 0 additions & 1 deletion app/src/main/java/app/gamenative/service/SteamService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2036,7 +2036,6 @@ class SteamService : Service(), IChallengeUrlChanged {
with(instance!!) {
scope.launch {
db.withTransaction {
appDao.deleteAll()
changeNumbersDao.deleteAll()
fileChangeListsDao.deleteAll()
licenseDao.deleteAll()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Button
import androidx.compose.material3.Checkbox
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.ListItem
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
Expand Down Expand Up @@ -109,7 +110,13 @@ fun GameManagerDialog(
allDownloadableApps.clear()

// Get Downloadable Depots
downloadableDepots.putAll(SteamService.getDownloadableDepots(gameId))
val allPossibleDownloadableDepots = SteamService.getDownloadableDepots(gameId)
downloadableDepots.putAll(allPossibleDownloadableDepots)

// Get Optional DLC IDs
val optionalDlcIds = allPossibleDownloadableDepots
.filter { it.value.optionalDlcId == it.value.dlcAppId }
.map { it.value.dlcAppId }

// Add DLCs
downloadableDepots
Expand All @@ -123,7 +130,11 @@ fun GameManagerDialog(
.forEach { (_, depotInfo) ->
allDownloadableApps.add(Pair(depotInfo.dlcAppId, depotInfo))
val installed = SteamService.getInstalledApp(depotInfo.dlcAppId)
selectedAppIds[depotInfo.dlcAppId] = !indirectDlcAppIds.contains(depotInfo.dlcAppId) || installedDlcIds.contains(depotInfo.dlcAppId) || installed != null
selectedAppIds[depotInfo.dlcAppId] =
installed != null || // For installed Base Game and Indirect DLC App
installedDlcIds.contains(depotInfo.dlcAppId) || // For installed DLC from Main Depot
( !indirectDlcAppIds.contains(depotInfo.dlcAppId) && !optionalDlcIds.contains(depotInfo.dlcAppId) ) // Not in indirect DLC and not in optional DLC ids

enabledAppIds[depotInfo.dlcAppId] = !installedDlcIds.contains(depotInfo.dlcAppId) && installed == null
}

Expand Down Expand Up @@ -230,6 +241,18 @@ fun GameManagerDialog(
)
}

val selectableAppIds by remember(enabledAppIds.toMap()) {
derivedStateOf {
enabledAppIds.filter { it.value }.keys.toList()
}
}

val allSelectableSelected by remember(selectedAppIds.toMap(), selectableAppIds) {
derivedStateOf {
selectableAppIds.isNotEmpty() && selectableAppIds.all { selectedAppIds[it] == true }
}
}

val installSizeInfo by remember(downloadableDepots.keys.toSet(), selectedAppIds.toMap(), enabledAppIds.toMap()) {
derivedStateOf { getInstallSizeInfo() }
}
Expand Down Expand Up @@ -372,6 +395,29 @@ fun GameManagerDialog(
Column(
modifier = Modifier.fillMaxWidth()
) {
// 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"
)
}
}
}
Comment on lines +398 to +419
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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.


allDownloadableApps.forEach { (dlcAppId, depotInfo) ->
val checked = selectedAppIds[dlcAppId] ?: false
val enabled = enabledAppIds[dlcAppId] ?: false
Expand Down Expand Up @@ -406,6 +452,12 @@ fun GameManagerDialog(
selectedAppIds[dlcAppId] = !checked
}
)

HorizontalDivider(
modifier = Modifier.padding(horizontal = 16.dp),
thickness = 0.5.dp,
color = MaterialTheme.colorScheme.outline.copy(alpha = 0.3f)
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,8 +609,9 @@ class SteamAppScreen : BaseAppScreen() {
val gameId = libraryItem.gameId
val appId = libraryItem.appId
val appInfo = SteamService.getAppInfoOf(gameId) ?: return emptyList()
val isDownloadInProgress = SteamService.getDownloadingAppInfoOf(gameId) != null

if (!isInstalled) {
if (!isInstalled || isDownloadInProgress) {
return emptyList()
}
Comment on lines +612 to 616
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 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 5

Repository: 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.kt

Repository: utkarshdalal/GameNative

Length of output: 1094


🏁 Script executed:

# Check what DownloadingAppInfo and DownloadInfo types are
rg "data class DownloadingAppInfo|data class DownloadInfo" -A 3

Repository: utkarshdalal/GameNative

Length of output: 721


🏁 Script executed:

# Verify what getDownloadingAppInfoOf is used for elsewhere
rg "getDownloadingAppInfoOf" -B 2 -A 2

Repository: 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.


Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dataStore = "1.1.2" # https://mvnrepository.com/artifact/androidx.datastore/data
espressoCore = "3.6.1" # https://mvnrepository.com/artifact/androidx.test.espresso/espresso-core
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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 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 -20

Repository: 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
fi

Repository: 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 -5

Repository: 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:

  1. Javasteam listings (in.dragonbra) — mvnrepository.com. [1]
  2. Maven Central / artifact pages for javasteam (in.dragonbra). [2]
  3. 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.kts

Repository: 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 -30

Repository: 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 -20

Repository: 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.

json = "1.8.0" # https://mvnrepository.com/artifact/org.jetbrains.kotlinx/kotlinx-serialization-json
junit = "4.13.2" # https://mvnrepository.com/artifact/junit/junit
junitVersion = "1.2.1" # https://mvnrepository.com/artifact/androidx.test.ext/junit
Expand Down
Loading