agent_ui: Show keybindings for NewThread and NewTextThread in new thread button (#34967)
I believe in this PR: #34829 we moved to context menu entry from action but the side effect of that was we also removed the Keybindings from showing it in the new thread button dropdown. This PR fixes that. cc @danilo-leal | Before | After | |--------|--------| | <img width="900" height="1962" alt="CleanShot 2025-07-23 at 23 36 28@2x" src="https://github.com/user-attachments/assets/760cbe75-09b9-404b-9d33-1db73785234f" /> | <img width="850" height="1964" alt="CleanShot 2025-07-23 at 23 37 17@2x" src="https://github.com/user-attachments/assets/24a7e871-aebc-475c-845f-b76f02527b8f" /> | Release Notes: - N/A
This commit is contained in:
parent
a48247a313
commit
9863c8a44e
1 changed files with 89 additions and 78 deletions
|
@ -1901,10 +1901,13 @@ impl AgentPanel {
|
||||||
)
|
)
|
||||||
.anchor(Corner::TopRight)
|
.anchor(Corner::TopRight)
|
||||||
.with_handle(self.new_thread_menu_handle.clone())
|
.with_handle(self.new_thread_menu_handle.clone())
|
||||||
.menu(move |window, cx| {
|
.menu({
|
||||||
|
let focus_handle = focus_handle.clone();
|
||||||
|
move |window, cx| {
|
||||||
let active_thread = active_thread.clone();
|
let active_thread = active_thread.clone();
|
||||||
Some(ContextMenu::build(window, cx, |mut menu, _window, cx| {
|
Some(ContextMenu::build(window, cx, |mut menu, _window, cx| {
|
||||||
menu = menu
|
menu = menu
|
||||||
|
.context(focus_handle.clone())
|
||||||
.when(cx.has_flag::<feature_flags::AcpFeatureFlag>(), |this| {
|
.when(cx.has_flag::<feature_flags::AcpFeatureFlag>(), |this| {
|
||||||
this.header("Zed Agent")
|
this.header("Zed Agent")
|
||||||
})
|
})
|
||||||
|
@ -1912,14 +1915,19 @@ impl AgentPanel {
|
||||||
ContextMenuEntry::new("New Thread")
|
ContextMenuEntry::new("New Thread")
|
||||||
.icon(IconName::NewThread)
|
.icon(IconName::NewThread)
|
||||||
.icon_color(Color::Muted)
|
.icon_color(Color::Muted)
|
||||||
|
.action(NewThread::default().boxed_clone())
|
||||||
.handler(move |window, cx| {
|
.handler(move |window, cx| {
|
||||||
window.dispatch_action(NewThread::default().boxed_clone(), cx);
|
window.dispatch_action(
|
||||||
|
NewThread::default().boxed_clone(),
|
||||||
|
cx,
|
||||||
|
);
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
.item(
|
.item(
|
||||||
ContextMenuEntry::new("New Text Thread")
|
ContextMenuEntry::new("New Text Thread")
|
||||||
.icon(IconName::NewTextThread)
|
.icon(IconName::NewTextThread)
|
||||||
.icon_color(Color::Muted)
|
.icon_color(Color::Muted)
|
||||||
|
.action(NewTextThread.boxed_clone())
|
||||||
.handler(move |window, cx| {
|
.handler(move |window, cx| {
|
||||||
window.dispatch_action(NewTextThread.boxed_clone(), cx);
|
window.dispatch_action(NewTextThread.boxed_clone(), cx);
|
||||||
}),
|
}),
|
||||||
|
@ -1970,7 +1978,9 @@ impl AgentPanel {
|
||||||
.handler(move |window, cx| {
|
.handler(move |window, cx| {
|
||||||
window.dispatch_action(
|
window.dispatch_action(
|
||||||
NewExternalAgentThread {
|
NewExternalAgentThread {
|
||||||
agent: Some(crate::ExternalAgent::ClaudeCode),
|
agent: Some(
|
||||||
|
crate::ExternalAgent::ClaudeCode,
|
||||||
|
),
|
||||||
}
|
}
|
||||||
.boxed_clone(),
|
.boxed_clone(),
|
||||||
cx,
|
cx,
|
||||||
|
@ -1980,6 +1990,7 @@ impl AgentPanel {
|
||||||
});
|
});
|
||||||
menu
|
menu
|
||||||
}))
|
}))
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
let agent_panel_menu = PopoverMenu::new("agent-options-menu")
|
let agent_panel_menu = PopoverMenu::new("agent-options-menu")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue