Wire up AssistantPanelDelegate based on assistant2 feature flag (#23444)
This PR adjusts how the `AssistantPanelDelegate` global is set to be based on the state of the feature flag. This should prevent `assistant` and `assistant2` from potentially clobbering each other. Release Notes: - N/A
This commit is contained in:
@@ -28,7 +28,7 @@ use prompt_library::{PromptBuilder, PromptLoadingParams};
|
||||
use settings::Settings as _;
|
||||
use util::ResultExt;
|
||||
|
||||
pub use crate::assistant_panel::AssistantPanel;
|
||||
pub use crate::assistant_panel::{AssistantPanel, ConcreteAssistantPanelDelegate};
|
||||
pub use crate::inline_assistant::InlineAssistant;
|
||||
|
||||
actions!(
|
||||
|
||||
@@ -34,7 +34,6 @@ use crate::thread_store::ThreadStore;
|
||||
use crate::{NewPromptEditor, NewThread, OpenHistory, OpenPromptEditorHistory};
|
||||
|
||||
pub fn init(cx: &mut AppContext) {
|
||||
<dyn AssistantPanelDelegate>::set_global(Arc::new(ConcreteAssistantPanelDelegate), cx);
|
||||
cx.observe_new_views(
|
||||
|workspace: &mut Workspace, _cx: &mut ViewContext<Workspace>| {
|
||||
workspace
|
||||
@@ -811,7 +810,7 @@ impl Render for AssistantPanel {
|
||||
}
|
||||
}
|
||||
|
||||
struct ConcreteAssistantPanelDelegate;
|
||||
pub struct ConcreteAssistantPanelDelegate;
|
||||
|
||||
impl AssistantPanelDelegate for ConcreteAssistantPanelDelegate {
|
||||
fn active_context_editor(
|
||||
|
||||
Reference in New Issue
Block a user