Feat: Add more variable preset suggestions#1497
Conversation
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.
📝 WalkthroughWalkthroughThis 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. ChangesEnvironment Variable Suggestion Categories
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
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 |
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
There was a problem hiding this comment.
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 expandedWINEDLLOVERRIDESsuggestion 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.
| style = androidx.compose.material3.MaterialTheme.typography.labelSmall, | ||
| color = androidx.compose.material3.MaterialTheme.colorScheme.onSurfaceVariant.copy(alpha = 0.6f), |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
app/src/main/java/app/gamenative/ui/component/dialog/EnvironmentTab.kt (1)
179-201: 💤 Low valueConsider 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
📒 Files selected for processing (3)
app/src/main/java/app/gamenative/ui/component/dialog/EnvironmentTab.ktapp/src/main/java/app/gamenative/ui/component/settings/SettingsTextFieldWithSuggestions.ktapp/src/main/java/com/winlator/core/envvars/EnvVarInfo.kt
There was a problem hiding this comment.
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"
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
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
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
WINEDLLOVERRIDESpresets with Audio, Input, and Network options.VKD3D_CONFIGpresets,VKD3D_SWAPCHAIN_LATENCY_FRAMES, andMALLOC_CONFsuggestion.DXVK_DISABLE_TIMELINE_SEMAPHORESas a toggle (0/1).FD_DEV_FEATURESwith enable_tp_ubwc_flag_hint=1.Refactors
DXVK_FILTER_DEVICE_NAME(unsupported in GameNative).Written for commit 940be31. Summary will update on new commits.
Summary by CodeRabbit