Implementing SettingsListDropdownSearchable.#1558
Conversation
A Searchable ListDropDown for Dropdowns with a lot of items. Exchanged SettingsListDropdown with SettingsListDropdownSearchable in following dialogs GraphicsTab->Graphic-Driver Winetab->Renderer WineTab->GPU-Name Added Translations for Label.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
✅ Files skipped from review due to trivial changes (4)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds a new SettingsListDropdownSearchable composable (searchable TextField + filtered DropdownMenuItems), integrates it into GraphicsTab and WineTab for GPU/driver selections, and adds localized search-label string resources across multiple locales. ChangesSearchable Dropdown Implementation and Integration
🎯 3 (Moderate) | ⏱️ ~20 minutes Sequence DiagramsequenceDiagram
participant User
participant GraphicsTab
participant WineTab
participant SettingsListDropdownSearchable
User->>GraphicsTab: open graphics settings
GraphicsTab->>SettingsListDropdownSearchable: show dropdown (open)
User->>SettingsListDropdownSearchable: type query / select item
SettingsListDropdownSearchable->>GraphicsTab: onItemSelected(index)
User->>WineTab: open GPU settings
WineTab->>SettingsListDropdownSearchable: show dropdown (open)
User->>SettingsListDropdownSearchable: type query / select item
SettingsListDropdownSearchable->>WineTab: onItemSelected(index)
Possibly related PRs
Suggested reviewers
🚥 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 |
There was a problem hiding this comment.
Actionable comments posted: 11
🤖 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/component/settings/SettingsListDropdownSearchable.kt`:
- Line 154: Replace the hardcoded contentDescription ("Dropdown arrow") in
SettingsListDropdownSearchable.kt with a localized string resource; update the
call site that sets contentDescription to use stringResource(R.string.some_name)
and add two string resources (e.g., dropdown_expanded and dropdown_collapsed) so
you can return the correct localized text based on the composable's expanded
state (use the current expanded boolean in the composable to pick which string).
Ensure you add the new entries to strings.xml and reference them via R.string
names in the composable where contentDescription is assigned.
In `@app/src/main/res/values-da/strings.xml`:
- Line 827: Update the Danish string value for
settings_interface_settingslistdropdownsearchable_searchlabel to match the
existing terminology/casing used elsewhere by replacing "søge" with "Søg";
locate the string named
settings_interface_settingslistdropdownsearchable_searchlabel and change its
text content to "Søg" so wording and capitalization are consistent across the
locale.
In `@app/src/main/res/values-fr/strings.xml`:
- Line 1002: The string resource
settings_interface_settingslistdropdownsearchable_searchlabel currently uses the
lowercase word "chercher"; update its value to the standard French UI label
"Rechercher" (capitalized) to match locale conventions and existing search
wording across the app by replacing the resource value for
settings_interface_settingslistdropdownsearchable_searchlabel.
In `@app/src/main/res/values-it/strings.xml`:
- Line 998: The translation for
settings_interface_settingslistdropdownsearchable_searchlabel is inconsistent
(uses "cercare"); update its value to the imperative form "Cerca" to match
existing search labels ("search" and "search_placeholder") for consistency and
UX—locate the string named
settings_interface_settingslistdropdownsearchable_searchlabel and replace the
current Italian text with "Cerca".
In `@app/src/main/res/values-ja/strings.xml`:
- Line 1042: Replace the inconsistent verb-form Japanese string for
settings_interface_settingslistdropdownsearchable_searchlabel ("検索する") with the
noun-form "検索" to match the existing search-related strings (e.g., search and
search_placeholder) and maintain consistent UX across the translations; update
the value of settings_interface_settingslistdropdownsearchable_searchlabel
accordingly.
In `@app/src/main/res/values-ko/strings.xml`:
- Line 1537: The string resource
settings_interface_settingslistdropdownsearchable_searchlabel contains an
erroneous leading '>' character in its value (">찾다"); remove the leading '>' so
the value is "찾다" to fix the displayed placeholder text for the Korean locale.
In `@app/src/main/res/values-pt-rBR/strings.xml`:
- Line 827: The new string
settings_interface_settingslistdropdownsearchable_searchlabel uses "procurar"
which is inconsistent with the existing search_placeholder ("Pesquisar…");
update settings_interface_settingslistdropdownsearchable_searchlabel to match
the same verb form, capitalization, and ellipsis pattern (e.g., "Pesquisar…") so
both search placeholders are consistent across the app.
In `@app/src/main/res/values-ro/strings.xml`:
- Line 1007: The string
settings_interface_settingslistdropdownsearchable_searchlabel uses "a căuta" but
should match the app's search placeholder style; update
settings_interface_settingslistdropdownsearchlabel to use the same grammatical
form and ellipsis as the existing search_placeholder (e.g., "Caută…") so the
wording and trailing ellipsis are consistent across the app.
In `@app/src/main/res/values-ru/strings.xml`:
- Line 1068: Replace the infinitive "искать" in the XML string resource
settings_interface_settingslistdropdownsearchable_searchlabel with the standard
Russian UI search label used elsewhere (e.g., "Поиск" or "Поиск…") to match
locale consistency; update the value of
settings_interface_settingslistdropdownsearchable_searchlabel accordingly and
ensure encoding/markup remains valid.
In `@app/src/main/res/values-zh-rTW/strings.xml`:
- Line 1000: Replace the translation value for the string resource
settings_interface_settingslistdropdownsearchable_searchlabel so it uses the
existing terminology "搜尋" instead of "尋找" to match other search-related strings
in the file; update the string resource value to "搜尋" for consistency across the
app.
In `@app/src/main/res/values/strings.xml`:
- Line 1057: The new string resource
settings_interface_settingslistdropdownsearchable_searchlabel uses lowercase
"search" which is inconsistent with existing UI labels; update the value of
settings_interface_settingslistdropdownsearchable_searchlabel to use "Search"
(capital S) so the dropdown placeholder matches other labels and maintains
consistent casing across the app.
🪄 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: b28b1a68-49f8-4662-a93d-a80e1e6c21f9
📒 Files selected for processing (18)
app/src/main/java/app/gamenative/ui/component/dialog/GraphicsTab.ktapp/src/main/java/app/gamenative/ui/component/dialog/WineTab.ktapp/src/main/java/app/gamenative/ui/component/settings/SettingsListDropdownSearchable.ktapp/src/main/res/values-da/strings.xmlapp/src/main/res/values-de/strings.xmlapp/src/main/res/values-es/strings.xmlapp/src/main/res/values-fr/strings.xmlapp/src/main/res/values-it/strings.xmlapp/src/main/res/values-ja/strings.xmlapp/src/main/res/values-ko/strings.xmlapp/src/main/res/values-pl/strings.xmlapp/src/main/res/values-pt-rBR/strings.xmlapp/src/main/res/values-ro/strings.xmlapp/src/main/res/values-ru/strings.xmlapp/src/main/res/values-uk/strings.xmlapp/src/main/res/values-zh-rCN/strings.xmlapp/src/main/res/values-zh-rTW/strings.xmlapp/src/main/res/values/strings.xml
| } else { | ||
| Icons.Filled.ArrowDropDown | ||
| }, | ||
| contentDescription = "Dropdown arrow", |
There was a problem hiding this comment.
Localize the dropdown icon accessibility text.
contentDescription = "Dropdown arrow" is hardcoded English, so TalkBack text won’t be localized. Move this to a string resource (ideally state-aware: expanded/collapsed).
Suggested fix
- contentDescription = "Dropdown arrow",
+ contentDescription = stringResource(
+ if (isDropdownExpanded) R.string.settings_dropdown_collapse
+ else R.string.settings_dropdown_expand
+ ),🤖 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/settings/SettingsListDropdownSearchable.kt`
at line 154, Replace the hardcoded contentDescription ("Dropdown arrow") in
SettingsListDropdownSearchable.kt with a localized string resource; update the
call site that sets contentDescription to use stringResource(R.string.some_name)
and add two string resources (e.g., dropdown_expanded and dropdown_collapsed) so
you can return the correct localized text based on the composable's expanded
state (use the current expanded boolean in the composable to pick which string).
Ensure you add the new entries to strings.xml and reference them via R.string
names in the composable where contentDescription is assigned.
| <string name="settings_text">Configurações</string> | ||
| <string name="download">Baixar</string> | ||
| <string name="install">Instalar</string> | ||
| <string name="settings_interface_settingslistdropdownsearchable_searchlabel">procurar</string> |
There was a problem hiding this comment.
Inconsistent placeholder formatting with existing search strings.
The new search placeholder uses "procurar" (lowercase, no ellipsis), but Line 281 defines search_placeholder as "Pesquisar…" (capitalized with ellipsis). For consistency, consider using the same verb, capitalization, and ellipsis pattern as other search placeholders in the application.
Suggestion:
- <string name="settings_interface_settingslistdropdownsearchable_searchlabel">procurar</string>
+ <string name="settings_interface_settingslistdropdownsearchable_searchlabel">Pesquisar…</string>📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| <string name="settings_interface_settingslistdropdownsearchable_searchlabel">procurar</string> | |
| <string name="settings_interface_settingslistdropdownsearchable_searchlabel">Pesquisar…</string> |
🤖 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/res/values-pt-rBR/strings.xml` at line 827, The new string
settings_interface_settingslistdropdownsearchable_searchlabel uses "procurar"
which is inconsistent with the existing search_placeholder ("Pesquisar…");
update settings_interface_settingslistdropdownsearchable_searchlabel to match
the same verb form, capitalization, and ellipsis pattern (e.g., "Pesquisar…") so
both search placeholders are consistent across the app.
| <string name="settings_select_language">Выберите язык</string> | ||
| <string name="settings_subtitle">Настройте ваш опыт</string> | ||
| <string name="settings_text">Настройки</string> | ||
| <string name="settings_interface_settingslistdropdownsearchable_searchlabel">искать</string> |
There was a problem hiding this comment.
Replace infinitive with standard Russian search label.
Line 1068 uses искать, which is grammatically awkward for a UI label. Please align with existing locale usage (Поиск or Поиск…) for consistency.
🤖 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/res/values-ru/strings.xml` at line 1068, Replace the infinitive
"искать" in the XML string resource
settings_interface_settingslistdropdownsearchable_searchlabel with the standard
Russian UI search label used elsewhere (e.g., "Поиск" or "Поиск…") to match
locale consistency; update the value of
settings_interface_settingslistdropdownsearchable_searchlabel accordingly and
ensure encoding/markup remains valid.
There was a problem hiding this comment.
4 issues found
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="app/src/main/res/values-ko/strings.xml">
<violation number="1" location="app/src/main/res/values-ko/strings.xml:1537">
P2: Korean search label string contains an unintended leading `>` character (`>찾다`), which will render visibly in the UI. The base English value is `search` and all other locale files have clean translations without any leading character. The correct Korean value should be `찾다`.</violation>
</file>
<file name="app/src/main/java/app/gamenative/ui/component/settings/SettingsListDropdownSearchable.kt">
<violation number="1" location="app/src/main/java/app/gamenative/ui/component/settings/SettingsListDropdownSearchable.kt:154">
P2: Hardcoded `contentDescription` string should be moved to a localized string resource.</violation>
</file>
<file name="app/src/main/res/values/strings.xml">
<violation number="1" location="app/src/main/res/values/strings.xml:1057">
P2: Duplicate generic string resource: a reusable `search` string already exists, making this component-specific key unnecessary and creating translation drift risk.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| <string name="screen_effects_scaling_mode_dls_desc">샤픈/선명도 패스.</string> | ||
| <string name="screen_effects_scaling_mode_natural">자연</string> | ||
| <string name="screen_effects_scaling_mode_natural_desc">더 따뜻한 색조.</string> | ||
| <string name="settings_interface_settingslistdropdownsearchable_searchlabel">>찾다</string> |
There was a problem hiding this comment.
P2: Korean search label string contains an unintended leading > character (>찾다), which will render visibly in the UI. The base English value is search and all other locale files have clean translations without any leading character. The correct Korean value should be 찾다.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/src/main/res/values-ko/strings.xml, line 1537:
<comment>Korean search label string contains an unintended leading `>` character (`>찾다`), which will render visibly in the UI. The base English value is `search` and all other locale files have clean translations without any leading character. The correct Korean value should be `찾다`.</comment>
<file context>
@@ -1534,4 +1534,5 @@
<string name="screen_effects_scaling_mode_dls_desc">샤픈/선명도 패스.</string>
<string name="screen_effects_scaling_mode_natural">자연</string>
<string name="screen_effects_scaling_mode_natural_desc">더 따뜻한 색조.</string>
+ <string name="settings_interface_settingslistdropdownsearchable_searchlabel">>찾다</string>
</resources>
</file context>
| <string name="settings_interface_settingslistdropdownsearchable_searchlabel">>찾다</string> | |
| <string name="settings_interface_settingslistdropdownsearchable_searchlabel">찾다</string> |
| } else { | ||
| Icons.Filled.ArrowDropDown | ||
| }, | ||
| contentDescription = "Dropdown arrow", |
There was a problem hiding this comment.
P2: Hardcoded contentDescription string should be moved to a localized string resource.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/src/main/java/app/gamenative/ui/component/settings/SettingsListDropdownSearchable.kt, line 154:
<comment>Hardcoded `contentDescription` string should be moved to a localized string resource.</comment>
<file context>
@@ -0,0 +1,163 @@
+ } else {
+ Icons.Filled.ArrowDropDown
+ },
+ contentDescription = "Dropdown arrow",
+ tint = MaterialTheme.colorScheme.onSurfaceVariant,
+ )
</file context>
| <string name="continue_action">Continue</string> | ||
| <string name="settings_text">Settings</string> | ||
|
|
||
| <string name="settings_interface_settingslistdropdownsearchable_searchlabel">search</string> |
There was a problem hiding this comment.
P2: Duplicate generic string resource: a reusable search string already exists, making this component-specific key unnecessary and creating translation drift risk.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/src/main/res/values/strings.xml, line 1057:
<comment>Duplicate generic string resource: a reusable `search` string already exists, making this component-specific key unnecessary and creating translation drift risk.</comment>
<file context>
@@ -1054,7 +1054,7 @@
<string name="continue_action">Continue</string>
<string name="settings_text">Settings</string>
-
+ <string name="settings_interface_settingslistdropdownsearchable_searchlabel">search</string>
<!-- Connecting to Servers Screen -->
</file context>
Description
A Searchable ListDropDown for Dropdowns with a lot of items to avoid endless scrolling.
Exchanged SettingsListDropdown with SettingsListDropdownSearchable in following dialogs
GraphicsTab->Graphic-Driver
Winetab->Renderer
WineTab->GPU-Name
Recording
https://drive.google.com/file/d/1Rp4XE5wZqRGVhZgcp2BDD1AqpfV0AfU5/view?usp=drive_link
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 a searchable dropdown to settings and replaces long lists in Graphics and Wine tabs to reduce scrolling and speed up selection.
Written for commit 4b77366. Summary will update on new commits.
Summary by CodeRabbit