assistant: Fix assistant: open prompt library not opening the prompt library (#28156)
This PR fixes the `assistant: open prompt library` action in the command palette not opening the prompt library when the Assistant Panel did not have focus. Fixes https://github.com/zed-industries/zed/issues/28058. Release Notes: - assistant: Fixed `assistant: open prompt library` not opening the prompt library when the Assistant Panel was not focused.
This commit is contained in:
@@ -54,7 +54,15 @@ pub fn init(cx: &mut App) {
|
||||
.register_action(ContextEditor::insert_dragged_files)
|
||||
.register_action(AssistantPanel::show_configuration)
|
||||
.register_action(AssistantPanel::create_new_context)
|
||||
.register_action(AssistantPanel::restart_context_servers);
|
||||
.register_action(AssistantPanel::restart_context_servers)
|
||||
.register_action(|workspace, _: &OpenPromptLibrary, window, cx| {
|
||||
if let Some(panel) = workspace.panel::<AssistantPanel>(cx) {
|
||||
workspace.focus_panel::<AssistantPanel>(window, cx);
|
||||
panel.update(cx, |panel, cx| {
|
||||
panel.deploy_prompt_library(&OpenPromptLibrary, window, cx)
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
)
|
||||
.detach();
|
||||
|
||||
Reference in New Issue
Block a user