Skip to content

fix(ui): show selected label in Language dropdown when set to Auto#7675

Merged
markijbema merged 2 commits intomainfrom
mark/fix-language-dropdown-empty-display
Mar 26, 2026
Merged

fix(ui): show selected label in Language dropdown when set to Auto#7675
markijbema merged 2 commits intomainfrom
mark/fix-language-dropdown-empty-display

Conversation

@markijbema
Copy link
Copy Markdown
Contributor

@markijbema markijbema commented Mar 26, 2026

Summary

  • Fix the Language settings dropdown showing an empty trigger when set to "Auto (VS Code language)"
  • The Select component's <Kobalte.Value> used !selected (falsy check) to determine if no value was selected, which incorrectly treated empty string "" as "no selection"
  • Changed to selected == null (nullish check) so empty string is recognized as a valid value and the label function renders "Auto (VS Code language)" correctly

Before

CleanShot 2026-03-26 at 11 26 31@2x

After

CleanShot 2026-03-26 at 12 02 28@2x

The Select component used a falsy check (!selected) to determine if no
value was selected, which caused empty string "" to be treated as "no
selection". This made the Language settings dropdown appear empty when
set to "Auto (VS Code language)" since the auto option uses "" as its
value.

Changed to a nullish check (== null) so empty string is treated as a
valid selected value and the label function is called correctly.
Kobalte Select treats empty string "" as an empty selection and renders
the placeholder instead of calling the label function. Changed the Auto
option to use "auto" as its value instead of "", and map it back to ""
when calling setLocale. This ensures the dropdown trigger displays
"Auto (VS Code language)" when the dropdown is closed.

Also reverts the ineffective select.tsx nullish check since Kobalte
short-circuits before the render function is called.
@markijbema markijbema marked this pull request as ready for review March 26, 2026 11:03
@markijbema markijbema enabled auto-merge March 26, 2026 11:04
@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot bot commented Mar 26, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 files)
  • packages/kilo-vscode/webview-ui/src/components/settings/LanguageTab.tsx

Reviewed by gpt-5.4-20260305 · 309,637 tokens

@markijbema markijbema merged commit da48f21 into main Mar 26, 2026
17 checks passed
@markijbema markijbema deleted the mark/fix-language-dropdown-empty-display branch March 26, 2026 11:06
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.

2 participants