Skip to content

feat: custom game import as steam based on PrefManager toggle in Settings#1531

Open
phobos665 wants to merge 7 commits into
utkarshdalal:masterfrom
phobos665:feat/custom-game-import-steam-toggle
Open

feat: custom game import as steam based on PrefManager toggle in Settings#1531
phobos665 wants to merge 7 commits into
utkarshdalal:masterfrom
phobos665:feat/custom-game-import-steam-toggle

Conversation

@phobos665

@phobos665 phobos665 commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Description

Updated the settings so that we can toggle/untoggle importing custom games as Steam games.

Recording

Type of Change

  • Bug fix
  • Performance / stability improvement
  • Compatibility improvements
  • Other (requires prior approval)

Checklist

  • If I have access to #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.
  • This change aligns with the current project scope (core functionality, stability, or performance). If not, it has been explicitly approved beforehand.
  • I have attached a recording of the change.
  • I have read and agree to the contribution guidelines in CONTRIBUTING.md.

Summary by cubic

Adds a Settings toggle to import custom games as Steam games (off by default). When enabled, the scanner maps matching folders to Steam entries.

  • New Features

    • Added importCustomGameAsSteamGame in PrefManager and a toggle under Custom Games in Settings.
    • Updated CustomGameScanner to link custom games to Steam only when the toggle is on.
  • Bug Fixes

    • Fixed the preference key so the toggle persists.
    • UI polish and copy: set the Custom Games settings group background to transparent, removed the toggle subtitle, added translations across locales, and fixed a label typo.

Written for commit e76fb3f. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features

    • Added a "Custom Games" section in Interface settings.
    • Toggle to import custom games as Steam games (persisted preference).
  • Localization

    • Added UI strings for the new settings in multiple languages.

@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f7ca2c5b-bdc8-421d-9de2-356f624a8bd7

📥 Commits

Reviewing files that changed from the base of the PR and between 671fe2d and e76fb3f.

📒 Files selected for processing (2)
  • app/src/main/java/app/gamenative/ui/screen/settings/SettingsGroupInterface.kt
  • app/src/main/res/values/strings.xml
🚧 Files skipped from review as they are similar to previous changes (2)
  • app/src/main/res/values/strings.xml
  • app/src/main/java/app/gamenative/ui/screen/settings/SettingsGroupInterface.kt

📝 Walkthrough

Walkthrough

Adds a persisted boolean preference importCustomGameAsSteamGame, exposes it as a settings toggle with localized strings across multiple languages, and gates CustomGameScanner's Steam lookup/import on that preference.

Changes

Custom Game Steam Import Preference

Layer / File(s) Summary
Preference contract and UI settings
app/src/main/java/app/gamenative/PrefManager.kt, app/src/main/java/app/gamenative/ui/screen/settings/SettingsGroupInterface.kt, app/src/main/res/values*/strings.xml
PrefManager adds boolean pref importCustomGameAsSteamGame (default false); SettingsGroupInterface adds a "Custom Game Settings" switch bound to the pref; localized strings added in values and 16 locale-specific strings.xml files.
Custom game scanning preference gate
app/src/main/java/app/gamenative/utils/CustomGameScanner.kt
CustomGameScanner updates conditional in createLibraryItemFromFolder to require PrefManager.importCustomGameAsSteamGame (in addition to SteamService.instance != null) before performing Steam app lookup/import.

Sequence Diagram(s)

sequenceDiagram
  participant SettingsUI as SettingsGroupInterface
  participant Pref as PrefManager
  participant Scanner as CustomGameScanner
  participant Steam as SteamService

  SettingsUI->>Pref: set importCustomGameAsSteamGame = true/false
  Scanner->>Pref: read importCustomGameAsSteamGame during scan
  Scanner->>Steam: if Pref && Steam.instance != null -> perform Steam lookup/import
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • utkarshdalal/GameNative#260: Also modifies PrefManager.kt to add persisted boolean preferences and gates Steam-related behavior in CustomGameScanner.
  • utkarshdalal/GameNative#1315: Adds localized strings in values resource files (zh-rCN/zh-rTW), overlapping the same resource documents.

Suggested reviewers

  • utkarshdalal

Poem

🐰 A preference hops in to save the day,
Custom games can now choose their own way—
To Steam or stay true, the choice is yours,
Labels in many tongues open the doors,
A tiny toggle makes the scanner sway.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding a PrefManager toggle in Settings to control custom game import as Steam games.
Description check ✅ Passed The description covers the main change, includes type classification, completes all checklist items, and provides a detailed summary by cubic with feature details.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@phobos665 phobos665 marked this pull request as ready for review June 6, 2026 22:14
@phobos665 phobos665 requested a review from utkarshdalal as a code owner June 6, 2026 22:14

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 3

🤖 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/screen/settings/SettingsGroupInterface.kt`:
- Around line 421-423: Replace the hardcoded Modifier.background(Color.Cyan)
used on the settings group (the call that also passes title = { Text(text =
stringResource(R.string.settings_interface_custom_games)) }) with a theme-driven
or transparent background; either remove the background modifier entirely so the
group inherits surrounding styling or use
Modifier.background(MaterialTheme.colorScheme.surfaceVariant) /
Modifier.background(Color.Transparent) to preserve theming and readability
across themes.
- Around line 427-429: The subtitle currently duplicates the title in the
composable (title = { Text(text =
stringResource(R.string.settings_interface_custom_game_import_as_steam)) },
subtitle = { ... }) creating UI noise; update the subtitle in
SettingsGroupInterface.kt — referencing the same setting state
importCustomGameAsSteamGame — to either remove the subtitle lambda entirely or
replace it with a distinct explanatory string resource (e.g.
R.string.settings_interface_custom_game_import_as_steam_subtitle) that clarifies
the behavior, and ensure the subtitle Text uses stringResource(...) for
localization.

In `@app/src/main/res/values/strings.xml`:
- Line 946: Update the string resource named
settings_interface_custom_game_import_as_steam to use the plural form for
clarity; change the value from "Import custom games as Steam game" to "Import
custom games as Steam games" so the label correctly reflects multiple games.
🪄 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: 915d1a8c-8dfe-4537-ba8e-b4e1b7da61bb

📥 Commits

Reviewing files that changed from the base of the PR and between 59159ee and 671fe2d.

📒 Files selected for processing (18)
  • app/src/main/java/app/gamenative/PrefManager.kt
  • app/src/main/java/app/gamenative/ui/screen/settings/SettingsGroupInterface.kt
  • app/src/main/java/app/gamenative/utils/CustomGameScanner.kt
  • app/src/main/res/values-da/strings.xml
  • app/src/main/res/values-de/strings.xml
  • app/src/main/res/values-es/strings.xml
  • app/src/main/res/values-fr/strings.xml
  • app/src/main/res/values-it/strings.xml
  • app/src/main/res/values-ja/strings.xml
  • app/src/main/res/values-ko/strings.xml
  • app/src/main/res/values-pl/strings.xml
  • app/src/main/res/values-pt-rBR/strings.xml
  • app/src/main/res/values-ro/strings.xml
  • app/src/main/res/values-ru/strings.xml
  • app/src/main/res/values-uk/strings.xml
  • app/src/main/res/values-zh-rCN/strings.xml
  • app/src/main/res/values-zh-rTW/strings.xml
  • app/src/main/res/values/strings.xml

Comment thread app/src/main/java/app/gamenative/ui/screen/settings/SettingsGroupInterface.kt Outdated
Comment thread app/src/main/res/values/strings.xml Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

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.

4 issues found across 18 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread app/src/main/java/app/gamenative/ui/screen/settings/SettingsGroupInterface.kt Outdated
Comment thread app/src/main/java/app/gamenative/utils/CustomGameScanner.kt
Comment thread app/src/main/java/app/gamenative/ui/screen/settings/SettingsGroupInterface.kt Outdated
Comment thread app/src/main/res/values/strings.xml Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant