From c5255a7c698fdeeeccb5b34eee52671c3d624430 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Thu, 5 Sep 2024 14:31:51 +0200 Subject: [PATCH] assistant: Add missing keybind for assistant::NewContext (#17407) Closes #ISSUE Release Notes: - N/A --- assets/keymaps/default-linux.json | 3 ++- assets/keymaps/default-macos.json | 3 ++- crates/assistant/src/assistant_panel.rs | 21 ++++++++++++++++++--- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/assets/keymaps/default-linux.json b/assets/keymaps/default-linux.json index 6f044c0f71..5b4c13aef5 100644 --- a/assets/keymaps/default-linux.json +++ b/assets/keymaps/default-linux.json @@ -169,7 +169,8 @@ "ctrl-shift-g": "search::SelectPrevMatch", "alt-m": "assistant::ToggleModelSelector", "ctrl-k h": "assistant::DeployHistory", - "ctrl-k l": "assistant::DeployPromptLibrary" + "ctrl-k l": "assistant::DeployPromptLibrary", + "ctrl-n": "assistant::NewContext" } }, { diff --git a/assets/keymaps/default-macos.json b/assets/keymaps/default-macos.json index 5ebd3d0ccd..20d6b4687a 100644 --- a/assets/keymaps/default-macos.json +++ b/assets/keymaps/default-macos.json @@ -191,7 +191,8 @@ "cmd-shift-g": "search::SelectPrevMatch", "alt-m": "assistant::ToggleModelSelector", "cmd-k h": "assistant::DeployHistory", - "cmd-k l": "assistant::DeployPromptLibrary" + "cmd-k l": "assistant::DeployPromptLibrary", + "cmd-n": "assistant::NewContext" } }, { diff --git a/crates/assistant/src/assistant_panel.rs b/crates/assistant/src/assistant_panel.rs index 3c8eb1a6d9..75a7568af7 100644 --- a/crates/assistant/src/assistant_panel.rs +++ b/crates/assistant/src/assistant_panel.rs @@ -355,8 +355,16 @@ impl AssistantPanel { cx.dispatch_action(DeployHistory.boxed_clone()) } })) - .tooltip(move |cx| { - Tooltip::for_action_in("Open History", &DeployHistory, &focus_handle, cx) + .tooltip({ + let focus_handle = focus_handle.clone(); + move |cx| { + Tooltip::for_action_in( + "Open History", + &DeployHistory, + &focus_handle, + cx, + ) + } }) .selected( pane.active_item() @@ -372,7 +380,14 @@ impl AssistantPanel { cx.dispatch_action(NewContext.boxed_clone()) }), ) - .tooltip(|cx| Tooltip::for_action("New Context", &NewContext, cx)), + .tooltip(move |cx| { + Tooltip::for_action_in( + "New Context", + &NewContext, + &focus_handle, + cx, + ) + }), ) .child( PopoverMenu::new("assistant-panel-popover-menu")