From 4854ad98db54dc38b20dffc8fb05b6befd5c13bd Mon Sep 17 00:00:00 2001 From: galuis116 <116897328+galuis116@users.noreply.github.com> Date: Mon, 20 Apr 2026 06:16:57 -0700 Subject: [PATCH] Improve button keybinding alignment in workspace switcher (#54300) Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Closes #54299 Release Notes: - N/A --------- Co-authored-by: Danilo Leal Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> --- crates/recent_projects/src/recent_projects.rs | 47 +++++++++++++------ 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/crates/recent_projects/src/recent_projects.rs b/crates/recent_projects/src/recent_projects.rs index 21aa2d6e0b9387c654bdd2424eb3b81aab2ecfec..52904d0e287522ffcf17300d0df6e0f5ae6edb10 100644 --- a/crates/recent_projects/src/recent_projects.rs +++ b/crates/recent_projects/src/recent_projects.rs @@ -41,8 +41,8 @@ use workspace::ProjectGroupKey; use dev_container::{DevContainerContext, find_devcontainer_configs}; use ui::{ - ContextMenu, Divider, HighlightedLabel, KeyBinding, ListItem, ListItemSpacing, ListSubHeader, - PopoverMenu, PopoverMenuHandle, TintColor, Tooltip, prelude::*, + ButtonLike, ContextMenu, Divider, HighlightedLabel, KeyBinding, ListItem, ListItemSpacing, + ListSubHeader, PopoverMenu, PopoverMenuHandle, TintColor, Tooltip, prelude::*, }; use util::{ResultExt, paths::PathExt}; use workspace::{ @@ -1620,11 +1620,21 @@ impl PickerDelegate for RecentProjectsDelegate { .border_t_1() .border_color(cx.theme().colors().border_variant) .child({ - let open_action = workspace::Open { - create_new_window: self.create_new_window, - }; - Button::new("open_local_folder", "Open Local Folders") - .key_binding(KeyBinding::for_action_in(&open_action, &focus_handle, cx)) + ButtonLike::new("open_local_folder") + .child( + h_flex() + .w_full() + .gap_1() + .justify_between() + .child(Label::new("Open Local Folders")) + .child(KeyBinding::for_action_in( + &workspace::Open { + create_new_window: self.create_new_window, + }, + &focus_handle, + cx, + )), + ) .on_click({ let workspace = self.workspace.clone(); let create_new_window = self.create_new_window; @@ -1639,14 +1649,21 @@ impl PickerDelegate for RecentProjectsDelegate { }) }) .child( - Button::new("open_remote_folder", "Open Remote Folder") - .key_binding(KeyBinding::for_action( - &OpenRemote { - from_existing_connection: false, - create_new_window: false, - }, - cx, - )) + ButtonLike::new("open_remote_folder") + .child( + h_flex() + .w_full() + .gap_1() + .justify_between() + .child(Label::new("Open Remote Folder")) + .child(KeyBinding::for_action( + &OpenRemote { + from_existing_connection: false, + create_new_window: false, + }, + cx, + )), + ) .on_click(|_, window, cx| { window.dispatch_action( OpenRemote {