agent: Refine language model selector (#28597)

Release Notes:

- agent: Show recommended models in the agent model selector and display
the provider in the model selector's trigger.

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
This commit is contained in:
Bennet Bo Fenner 2025-04-11 17:02:50 -06:00 committed by GitHub
parent dafe994eef
commit b22faf96e0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 350 additions and 218 deletions

View file

@ -2133,18 +2133,28 @@ async fn test_repeat_toggle_action(cx: &mut gpui::TestAppContext) {
cx.dispatch_action(ToggleFileFinder::default());
let picker = active_file_picker(&workspace, cx);
picker.update_in(cx, |picker, window, cx| {
picker.update_matches(".txt".to_string(), window, cx)
});
cx.run_until_parked();
picker.update(cx, |picker, _| {
assert_eq!(picker.delegate.matches.len(), 6);
assert_eq!(picker.delegate.selected_index, 0);
assert_eq!(picker.logical_scroll_top_index(), 0);
});
// When toggling repeatedly, the picker scrolls to reveal the selected item.
cx.dispatch_action(ToggleFileFinder::default());
cx.dispatch_action(ToggleFileFinder::default());
cx.dispatch_action(ToggleFileFinder::default());
cx.run_until_parked();
picker.update(cx, |picker, _| {
assert_eq!(picker.delegate.matches.len(), 6);
assert_eq!(picker.delegate.selected_index, 3);
assert_eq!(picker.logical_scroll_top_index(), 3);
});
}