combobox: Add value-based selection API (#2576)
Closes #2575 ## Description Adds `ComboboxState::set_selected_values` to resolve values through the current delegate and replace the committed selection without emitting user-originated events. This keeps programmatic selection aligned after `set_items`, synchronizes the adapter snapshot, ignores unknown values, and preserves caller order. Includes focused tests for current delegate resolution, missing and empty values, snapshot synchronization, and event behavior, plus English and Simplified Chinese documentation. ## How to Test - `cargo check -p gpui-component --tests` - `cargo clippy -p gpui-component --all-targets -- --deny warnings` - `rustfmt --edition 2024 --check crates/ui/src/combobox.rs` - `git diff --check` ## Checklist - [x] Reviewed AI-assisted changes for correctness. - [N/A] Story testing; no visual behavior changed. - [N/A] Platform testing; the API is platform-independent.
S
suxiaoshao committed
5b45bcb26b9343d91a123a4d5ed8a654360512e5
Parent: 0315556
Committed by GitHub <noreply@github.com>
on 7/20/2026, 3:15:35 AM