Don't open file finder menu on command (#25097)

Closes #24740

Release Notes:

- Don't open the split menu in the file finder when command is pressed
This commit is contained in:
Conrad Irwin 2025-02-18 14:27:10 -07:00 committed by GitHub
parent bff1548b48
commit 48f87a8d9a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 53 deletions

View file

@ -34,7 +34,7 @@ use std::{
};
use text::Point;
use ui::{
prelude::*, ContextMenu, HighlightedLabel, KeyBinding, ListItem, ListItemSpacing, PopoverMenu,
prelude::*, ContextMenu, HighlightedLabel, ListItem, ListItemSpacing, PopoverMenu,
PopoverMenuHandle,
};
use util::{paths::PathWithPosition, post_inc, ResultExt};
@ -1448,11 +1448,7 @@ impl PickerDelegate for FileFinderDelegate {
)
}
fn render_footer(
&self,
window: &mut Window,
cx: &mut Context<Picker<Self>>,
) -> Option<AnyElement> {
fn render_footer(&self, _: &mut Window, cx: &mut Context<Picker<Self>>) -> Option<AnyElement> {
let context = self.focus_handle.clone();
Some(
h_flex()
@ -1463,11 +1459,9 @@ impl PickerDelegate for FileFinderDelegate {
.border_t_1()
.border_color(cx.theme().colors().border_variant)
.child(
Button::new("open-selection", "Open")
.key_binding(KeyBinding::for_action(&menu::Confirm, window, cx))
.on_click(|_, window, cx| {
window.dispatch_action(menu::Confirm.boxed_clone(), cx)
}),
Button::new("open-selection", "Open").on_click(|_, window, cx| {
window.dispatch_action(menu::Confirm.boxed_clone(), cx)
}),
)
.child(
PopoverMenu::new("menu-popover")
@ -1475,14 +1469,8 @@ impl PickerDelegate for FileFinderDelegate {
.attach(gpui::Corner::TopRight)
.anchor(gpui::Corner::BottomRight)
.trigger(
Button::new("actions-trigger", "Split Options")
.selected_label_color(Color::Accent)
.key_binding(KeyBinding::for_action_in(
&ToggleMenu,
&context,
window,
cx,
)),
Button::new("actions-trigger", "Split…")
.selected_label_color(Color::Accent),
)
.menu({
move |window, cx| {