assistant2: Fix inline context picker and handle dismiss (#23081)
The new `ContextMenu`-based `ContextPicker` requires initialization when opened, but we were only doing this for the `ContextStrip` picker, not the inline one. Additionally, because we have a wrapper element around ContextMenu, we need to propagate the `DismissEvent` so that it properly closes when Escape is pressed. Release Notes: - N/A
This commit is contained in:
parent
7c2c409f6d
commit
4054d4a5b7
8 changed files with 42 additions and 17 deletions
|
@ -281,7 +281,13 @@ impl Render for MessageEditor {
|
|||
})
|
||||
.child(
|
||||
PopoverMenu::new("inline-context-picker")
|
||||
.menu(move |_cx| Some(inline_context_picker.clone()))
|
||||
.menu(move |cx| {
|
||||
inline_context_picker.update(cx, |this, cx| {
|
||||
this.init(cx);
|
||||
});
|
||||
|
||||
Some(inline_context_picker.clone())
|
||||
})
|
||||
.attach(gpui::Corner::TopLeft)
|
||||
.anchor(gpui::Corner::BottomLeft)
|
||||
.offset(gpui::Point {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue