searchable_list: Store selection by item value - #2653
Open
suxiaoshao wants to merge 7 commits into
Open
Conversation
Contributor
Author
|
@codex review |
suxiaoshao
marked this pull request as ready for review
August 5, 2026 11:57
Contributor
Author
|
@codex review |
suxiaoshao
marked this pull request as draft
August 5, 2026 12:28
suxiaoshao
marked this pull request as ready for review
August 6, 2026 01:40
suxiaoshao
marked this pull request as draft
August 8, 2026 04:00
suxiaoshao
marked this pull request as ready for review
August 8, 2026 04:38
…-hidden-selection # Conflicts: # crates/ui/src/select.rs
…-hidden-selection # Conflicts: # crates/story/src/stories/combobox_story.rs
…-hidden-selection # Conflicts: # crates/story/src/stories/combobox_story.rs # crates/ui/src/combobox.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2652
Summary
Valueitem_by_value;SearchableVecsearches its complete sourceIndexPathonly for current visible cursor, click, and change positionsIndexPathidentifies a row in the current filtered view, not an option. Filtering can hide an item or make the same path refer to another item, while selection semantics already useValue.Breaking Changes
SearchableListState::remove_selected_indexresolves the current visible item and now requires the app context.Custom delegates that need to resolve filtered-out values should override
item_by_value.Validation
cargo test -p gpui-component test_select_hidden_value_notifies_triggercargo check -p gpui-component --testscargo clippy -p gpui-component --all-targets -- --deny warningsrustfmt --edition 2024 --check crates/ui/src/select.rsgit diff --check