assistant: Add missing keybind for assistant::NewContext (#17407)

Closes #ISSUE

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz 2024-09-05 14:31:51 +02:00 committed by GitHub
parent 3738baccb2
commit c5255a7c69
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 22 additions and 5 deletions

View file

@ -169,7 +169,8 @@
"ctrl-shift-g": "search::SelectPrevMatch", "ctrl-shift-g": "search::SelectPrevMatch",
"alt-m": "assistant::ToggleModelSelector", "alt-m": "assistant::ToggleModelSelector",
"ctrl-k h": "assistant::DeployHistory", "ctrl-k h": "assistant::DeployHistory",
"ctrl-k l": "assistant::DeployPromptLibrary" "ctrl-k l": "assistant::DeployPromptLibrary",
"ctrl-n": "assistant::NewContext"
} }
}, },
{ {

View file

@ -191,7 +191,8 @@
"cmd-shift-g": "search::SelectPrevMatch", "cmd-shift-g": "search::SelectPrevMatch",
"alt-m": "assistant::ToggleModelSelector", "alt-m": "assistant::ToggleModelSelector",
"cmd-k h": "assistant::DeployHistory", "cmd-k h": "assistant::DeployHistory",
"cmd-k l": "assistant::DeployPromptLibrary" "cmd-k l": "assistant::DeployPromptLibrary",
"cmd-n": "assistant::NewContext"
} }
}, },
{ {

View file

@ -355,8 +355,16 @@ impl AssistantPanel {
cx.dispatch_action(DeployHistory.boxed_clone()) cx.dispatch_action(DeployHistory.boxed_clone())
} }
})) }))
.tooltip(move |cx| { .tooltip({
Tooltip::for_action_in("Open History", &DeployHistory, &focus_handle, cx) let focus_handle = focus_handle.clone();
move |cx| {
Tooltip::for_action_in(
"Open History",
&DeployHistory,
&focus_handle,
cx,
)
}
}) })
.selected( .selected(
pane.active_item() pane.active_item()
@ -372,7 +380,14 @@ impl AssistantPanel {
cx.dispatch_action(NewContext.boxed_clone()) 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( .child(
PopoverMenu::new("assistant-panel-popover-menu") PopoverMenu::new("assistant-panel-popover-menu")