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:
Agus Zubiaga 2025-01-13 18:00:20 -03:00 committed by GitHub
parent 7c2c409f6d
commit 4054d4a5b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 42 additions and 17 deletions

View file

@ -176,8 +176,7 @@ impl PickerDelegate for ThreadContextPickerDelegate {
fn dismissed(&mut self, cx: &mut ViewContext<Picker<Self>>) {
self.context_picker
.update(cx, |this, cx| {
this.reset_mode(cx);
.update(cx, |_, cx| {
cx.emit(DismissEvent);
})
.ok();