Skip to content

combobox: Add value-based selection API#2576

Open
suxiaoshao wants to merge 1 commit into
longbridge:mainfrom
suxiaoshao:codex/2575-combobox-value-selection
Open

combobox: Add value-based selection API#2576
suxiaoshao wants to merge 1 commit into
longbridge:mainfrom
suxiaoshao:codex/2575-combobox-value-selection

Conversation

@suxiaoshao

Copy link
Copy Markdown
Contributor

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

  • Reviewed AI-assisted changes for correctness.
  • [N/A] Story testing; no visual behavior changed.
  • [N/A] Platform testing; the API is platform-independent.

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.

Add value-based selection API to ComboboxState

1 participant