Fix language model selector (#26138)
This PR fixes the language model selector.
I tried to piece together the state prior to #25697 (the state it was in
at 11838cf89e
) while retaining unrelated
changes that happened since then.
Release Notes:
- Fixed an issue where language models would not be authenticated until
after the model selector was opened (Preview only).
This commit is contained in:
parent
ad9c508a72
commit
66784c0b3f
7 changed files with 289 additions and 200 deletions
|
@ -857,6 +857,7 @@ impl PromptEditor<BufferCodegen> {
|
|||
editor
|
||||
});
|
||||
let context_picker_menu_handle = PopoverMenuHandle::default();
|
||||
let model_selector_menu_handle = PopoverMenuHandle::default();
|
||||
|
||||
let context_strip = cx.new(|cx| {
|
||||
ContextStrip::new(
|
||||
|
@ -880,7 +881,13 @@ impl PromptEditor<BufferCodegen> {
|
|||
context_strip,
|
||||
context_picker_menu_handle,
|
||||
model_selector: cx.new(|cx| {
|
||||
AssistantModelSelector::new(fs, prompt_editor.focus_handle(cx), window, cx)
|
||||
AssistantModelSelector::new(
|
||||
fs,
|
||||
model_selector_menu_handle,
|
||||
prompt_editor.focus_handle(cx),
|
||||
window,
|
||||
cx,
|
||||
)
|
||||
}),
|
||||
edited_since_done: false,
|
||||
prompt_history,
|
||||
|
@ -1005,6 +1012,7 @@ impl PromptEditor<TerminalCodegen> {
|
|||
editor
|
||||
});
|
||||
let context_picker_menu_handle = PopoverMenuHandle::default();
|
||||
let model_selector_menu_handle = PopoverMenuHandle::default();
|
||||
|
||||
let context_strip = cx.new(|cx| {
|
||||
ContextStrip::new(
|
||||
|
@ -1028,7 +1036,13 @@ impl PromptEditor<TerminalCodegen> {
|
|||
context_strip,
|
||||
context_picker_menu_handle,
|
||||
model_selector: cx.new(|cx| {
|
||||
AssistantModelSelector::new(fs, prompt_editor.focus_handle(cx), window, cx)
|
||||
AssistantModelSelector::new(
|
||||
fs,
|
||||
model_selector_menu_handle.clone(),
|
||||
prompt_editor.focus_handle(cx),
|
||||
window,
|
||||
cx,
|
||||
)
|
||||
}),
|
||||
edited_since_done: false,
|
||||
prompt_history,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue