Skip to content

Feat: Add more variable preset suggestions#1497

Merged
utkarshdalal merged 4 commits into
utkarshdalal:masterfrom
Catpotatos:Feat-add-suggestions-presets-preset-headers
Jun 2, 2026
Merged

Feat: Add more variable preset suggestions#1497
utkarshdalal merged 4 commits into
utkarshdalal:masterfrom
Catpotatos:Feat-add-suggestions-presets-preset-headers

Conversation

@Catpotatos
Copy link
Copy Markdown
Contributor

@Catpotatos Catpotatos commented May 31, 2026

Description

More Environment Variables preset suggestions added to Add "New Environment Variable" in Container Settings "Environment" tab to user to quick add when needed.

  • SettingsTextFieldWithSuggestions.kt
    Added MaterialTheme import
    Header-aware logic: suggestions prefixed with --- render as a disabled, greyed-out label (category header); all others render as normal clickable items

  • EnvironmentTab.kt
    Applied the same header-aware logic to the suggestions dropdown in the "Add environment variable" dialog

  • EnvVarInfo.kt
    Expanded WINEDLLOVERRIDES's possibleValues with a new ---Input category header and four input-related DLL override presets (dinput8, xinput variants), followed by the ---Audio header and the audio presets already present, and ---Network
    Added DXVK_DISABLE_TIMELINE_SEMAPHORES
    Added FD_DEV_FEATURES with enable_tp_ubwc_flag_hint=1
    Added MALLOC_CONF suggestion.
    Shuffled order around

Deleted variable that does not work currently in GameNative

Tested on Retroid Pocket 5.

Recording

image

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 categorized suggestions to environment variable dropdowns and expands presets to speed up adding common values in Container Settings. Adds VKD3D and memory tuning presets plus new network/input options for WINEDLLOVERRIDES.

  • New Features

    • Suggestions support category headers: items starting with '---' render as disabled headers in both the Environment dialog and settings fields.
    • Expanded WINEDLLOVERRIDES presets with Audio, Input, and Network options.
    • Added VKD3D_CONFIG presets, VKD3D_SWAPCHAIN_LATENCY_FRAMES, and MALLOC_CONF suggestion.
    • Added DXVK_DISABLE_TIMELINE_SEMAPHORES as a toggle (0/1).
    • Added FD_DEV_FEATURES with enable_tp_ubwc_flag_hint=1.
  • Refactors

    • Removed DXVK_FILTER_DEVICE_NAME (unsupported in GameNative).
    • Minor UI cleanup and variable reordering.

Written for commit 940be31. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features
    • Environment variable suggestion dropdowns now show categorized preset options with non-selectable section headers for clearer organization and styling.
    • Expanded and reorganized preset suggestions for key environment variables, including additional grouped options and new toggle-style choices.
    • Settings fields now consistently display and apply structured suggestion lists across the UI.

More Environment Variables preset suggestions added to "Add Environment Variable" in Container Settings "Environment" tab to user to quick add when needed.

SettingsTextFieldWithSuggestions.kt
Added MaterialTheme import
Replaced the simple forEach loop with header-aware logic: suggestions prefixed with --- render as a disabled, greyed-out label (category header); all others render as normal clickable items

EnvironmentTab.kt
Applied the same header-aware logic to the suggestions dropdown in the "Add environment variable" dialog

EnvVarInfo.kt
Expanded WINEDLLOVERRIDES's possibleValues with a new ---Input category header and four input-related DLL override presets (dinput8, xinput variants), followed by the ---Audio header and the audio presets already present

Shuffled order around

Deleted variable that does not work currently in GameNative

Tested on Retroid Pocket 5.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 31, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds support for categorical section headers in environment variable suggestion dropdowns. Suggestion entries prefixed with "—"—three dashes—are rendered as non-selectable, styled header rows across both the settings component and environment tab dialog; regular suggestions remain clickable to populate the field.

Changes

Environment Variable Suggestion Categories

Layer / File(s) Summary
Environment variable data structure updates
app/src/main/java/com/winlator/core/envvars/EnvVarInfo.kt
KNOWN_ENV_VARS map import added; VKD3D_CONFIG updated with SUGGESTIONS; adds DXVK_DISABLE_TIMELINE_SEMAPHORES toggle; expands WINEDLLOVERRIDES possibleValues into categorized ----prefixed headers and presets; adds FD_DEV_FEATURES.
Settings component dropdown header rendering
app/src/main/java/app/gamenative/ui/component/settings/SettingsTextFieldWithSuggestions.kt
Dropdown now treats suggestions starting with "---" as disabled, styled category headers (prefix removed, greyed smaller text). Other suggestions remain clickable to set value and close the menu. Adds MaterialTheme import for styling.
Environment tab dialog integration
app/src/main/java/app/gamenative/ui/component/dialog/EnvironmentTab.kt
Environment variable value suggestions dropdown applies identical header rendering: "---" prefixed entries show as disabled, styled section headers; normal suggestions populate envVarValue and dismiss the dropdown.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • utkarshdalal
  • phobos665

Poem

🐰 The dropdown now groups its suggestions so neat,
With headers in dashes—a categorical treat!
Settings and dialogs both render with flair,
Greyed section headers float gently through air.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.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 'Feat: Add more variable preset suggestions' accurately reflects the main changes: adding preset suggestions for environment variables with categorized headers.
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.
Description check ✅ Passed PR description is well-structured with clear sections covering changes, type of change, checklist completion, and includes a recording. However, some details from commits are missing or understated.

✏️ 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.

More Environment Variables preset suggestions added to "Add Environment Variable" in Container Settings "Environment" tab to user to quick add when needed.

SettingsTextFieldWithSuggestions.kt
Added MaterialTheme import
Replaced the simple forEach loop with header-aware logic: suggestions prefixed with --- render as a disabled, greyed-out label (category header); all others render as normal clickable items

EnvironmentTab.kt
Applied the same header-aware logic to the suggestions dropdown in the "Add environment variable" dialog

EnvVarInfo.kt
Expanded WINEDLLOVERRIDES's possibleValues with a new ---Input category header and four input-related DLL override presets (dinput8, xinput variants), followed by the ---Audio header and the audio presets already present

Shuffled order around

Deleted variable that does not work currently in GameNative

Tested on Retroid Pocket 5.
added:
WINEDLLOVERRIDES
"wininet=n,b"
FOR NETWORK
@Catpotatos Catpotatos marked this pull request as ready for review June 1, 2026 19:40
@Catpotatos Catpotatos requested a review from utkarshdalal as a code owner June 1, 2026 19:40
Copilot AI review requested due to automatic review settings June 1, 2026 19:40
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds more environment-variable options and improves the suggestions dropdown UX by introducing non-clickable category headers.

Changes:

  • Added new env var definitions (e.g., VKD3D_CONFIG, DXVK_DISABLE_TIMELINE_SEMAPHORES, FD_DEV_FEATURES) and expanded WINEDLLOVERRIDES suggestion presets with categories.
  • Updated suggestions dropdown rendering to support non-clickable section headers (prefixed with ---) in two UI components.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
app/src/main/java/com/winlator/core/envvars/EnvVarInfo.kt Adds env var entries and categorized suggestion strings for WINEDLLOVERRIDES.
app/src/main/java/app/gamenative/ui/component/settings/SettingsTextFieldWithSuggestions.kt Renders ----prefixed suggestions as disabled category headers using Material theme styling.
app/src/main/java/app/gamenative/ui/component/dialog/EnvironmentTab.kt Applies the same category-header dropdown behavior for env var value suggestions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/src/main/java/com/winlator/core/envvars/EnvVarInfo.kt
Comment thread app/src/main/java/com/winlator/core/envvars/EnvVarInfo.kt Outdated
Comment on lines +185 to +186
style = androidx.compose.material3.MaterialTheme.typography.labelSmall,
color = androidx.compose.material3.MaterialTheme.colorScheme.onSurfaceVariant.copy(alpha = 0.6f),
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a 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

🧹 Nitpick comments (1)
app/src/main/java/app/gamenative/ui/component/dialog/EnvironmentTab.kt (1)

179-201: 💤 Low value

Consider extracting the shared header rendering pattern.

This header rendering logic is nearly identical to the implementation in SettingsTextFieldWithSuggestions.kt (lines 86-109). While the contexts differ slightly (different state updates and data sources), you could consider extracting the header styling logic into a shared composable to reduce duplication.

💡 Example extraction approach

You could create a helper composable like:

`@Composable`
private fun SuggestionDropdownItem(
    suggestion: String,
    onSelect: (String) -> Unit
) {
    if (suggestion.startsWith("---")) {
        DropdownMenuItem(
            text = {
                Text(
                    text = suggestion.removePrefix("---"),
                    style = MaterialTheme.typography.labelSmall,
                    color = MaterialTheme.colorScheme.onSurfaceVariant.copy(alpha = 0.6f),
                )
            },
            onClick = {},
            enabled = false,
        )
    } else {
        DropdownMenuItem(
            text = { Text(suggestion) },
            onClick = { onSelect(suggestion) },
        )
    }
}

Then use it in both locations.

🤖 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/component/dialog/EnvironmentTab.kt`
around lines 179 - 201, The dropdown header rendering in EnvironmentTab.kt
duplicates logic from SettingsTextFieldWithSuggestions; extract the shared UI
into a private composable (e.g., SuggestionDropdownItem(suggestion: String,
onSelect: (String) -> Unit)) that renders the "---" header as a disabled styled
DropdownMenuItem and normal suggestions as selectable items, then replace the
two in-file DropdownMenuItem blocks in EnvironmentTab (where you currently set
envVarValue and suggestionsExpanded) and the implementation in
SettingsTextFieldWithSuggestions to call SuggestionDropdownItem and pass an
onSelect that updates the respective state (for EnvironmentTab set envVarValue
and collapse suggestions).
🤖 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/com/winlator/core/envvars/EnvVarInfo.kt`:
- Line 302: Replace the vague comment "ONE UI BUG VARIABLE" with a concise,
descriptive comment near FD_DEV_FEATURES in EnvVarInfo.kt that explains the
affected device or UI scenario, the specific issue the variable addresses (e.g.,
workaround for One UI rendering/feature flag bug), and include a reference to
any related bug ticket or docs (if available) so future maintainers can trace
the rationale; update the comment directly above or next to the FD_DEV_FEATURES
declaration and keep it short (one or two sentences) describing purpose and
reference ID.

---

Nitpick comments:
In `@app/src/main/java/app/gamenative/ui/component/dialog/EnvironmentTab.kt`:
- Around line 179-201: The dropdown header rendering in EnvironmentTab.kt
duplicates logic from SettingsTextFieldWithSuggestions; extract the shared UI
into a private composable (e.g., SuggestionDropdownItem(suggestion: String,
onSelect: (String) -> Unit)) that renders the "---" header as a disabled styled
DropdownMenuItem and normal suggestions as selectable items, then replace the
two in-file DropdownMenuItem blocks in EnvironmentTab (where you currently set
envVarValue and suggestionsExpanded) and the implementation in
SettingsTextFieldWithSuggestions to call SuggestionDropdownItem and pass an
onSelect that updates the respective state (for EnvironmentTab set envVarValue
and collapse suggestions).
🪄 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: 096cc827-2faa-43d3-9102-fba13dc1454b

📥 Commits

Reviewing files that changed from the base of the PR and between 2bea2aa and df92ecd.

📒 Files selected for processing (3)
  • app/src/main/java/app/gamenative/ui/component/dialog/EnvironmentTab.kt
  • app/src/main/java/app/gamenative/ui/component/settings/SettingsTextFieldWithSuggestions.kt
  • app/src/main/java/com/winlator/core/envvars/EnvVarInfo.kt

Comment thread app/src/main/java/com/winlator/core/envvars/EnvVarInfo.kt Outdated
Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

1 issue found across 3 files

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

Re-trigger cubic

// Releases unused memory in background threads, per sec, reducing micro-stutters
 "MALLOC_CONF"

 "no_upload_hvv,nodxr", //prevents free use of vram as memory, disables Ray Tracing
                     "skip_application_workarounds", //disables x86 fixes that are mostly not in android

// 0 to 16 values can be used to trade latency for smooth fps
 "VKD3D_SWAPCHAIN_LATENCY_FRAMES"
@utkarshdalal utkarshdalal merged commit 5ac8a54 into utkarshdalal:master Jun 2, 2026
3 checks passed
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.

3 participants