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:
Marshall Bowers 2025-04-05 13:10:39 -04:00 committed by GitHub
parent caf0d6c5fa
commit adbebb28dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17 additions and 12 deletions

View file

@ -17,7 +17,7 @@ use fs::Fs;
use gpui::{
Action, Animation, AnimationExt as _, AnyElement, App, AsyncWindowContext, Corner, Entity,
EventEmitter, FocusHandle, Focusable, FontWeight, KeyContext, Pixels, Subscription, Task,
UpdateGlobal, WeakEntity, action_with_deprecated_aliases, prelude::*, pulsating_between,
UpdateGlobal, WeakEntity, prelude::*, pulsating_between,
};
use language::LanguageRegistry;
use language_model::{LanguageModelProviderTosView, LanguageModelRegistry};
@ -34,7 +34,7 @@ use util::ResultExt as _;
use workspace::Workspace;
use workspace::dock::{DockPosition, Panel, PanelEvent};
use zed_actions::agent::OpenConfiguration;
use zed_actions::assistant::ToggleFocus;
use zed_actions::assistant::{OpenPromptLibrary, ToggleFocus};
use crate::active_thread::ActiveThread;
use crate::assistant_configuration::{AssistantConfiguration, AssistantConfigurationEvent};
@ -48,12 +48,6 @@ use crate::{
OpenAgentDiff, OpenHistory, ThreadEvent, ToggleContextPicker,
};
action_with_deprecated_aliases!(
assistant,
OpenPromptLibrary,
["assistant::DeployPromptLibrary"]
);
pub fn init(cx: &mut App) {
cx.observe_new(
|workspace: &mut Workspace, _window, _cx: &mut Context<Workspace>| {