From f37df7b78d019122a830c010814cd3577be7e0f2 Mon Sep 17 00:00:00 2001 From: galuis116 <116897328+galuis116@users.noreply.github.com> Date: Mon, 20 Apr 2026 11:29:58 -0700 Subject: [PATCH] recent_projects: Fix unaligned keybinding labels in quick-switch menu (#54325) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 #54324 Release Notes: - Fixed shortcut label alignment in the Recent Projects quick-switch footer by rendering action rows with a consistent two-column layout (label left, keybinding right) for “Add Local Folders” and “Add Remote Folder”. --------- Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> --- .../src/sidebar_recent_projects.rs | 36 +++++++++++++------ 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/crates/recent_projects/src/sidebar_recent_projects.rs b/crates/recent_projects/src/sidebar_recent_projects.rs index 65ed83831a8bd208cf5e38ba27e98bbec28100b4..7c50e5ca3959874a26866d83e49aa799289ed69e 100644 --- a/crates/recent_projects/src/sidebar_recent_projects.rs +++ b/crates/recent_projects/src/sidebar_recent_projects.rs @@ -12,7 +12,7 @@ use picker::{ }; use remote::RemoteConnectionOptions; use settings::Settings; -use ui::{KeyBinding, ListItem, ListItemSpacing, Tooltip, prelude::*}; +use ui::{ButtonLike, KeyBinding, ListItem, ListItemSpacing, Tooltip, prelude::*}; use ui_input::ErasedEditor; use util::{ResultExt, paths::PathExt}; use workspace::{ @@ -417,22 +417,36 @@ impl PickerDelegate for SidebarRecentProjectsDelegate { create_new_window: false, }; - Button::new("open_local_folder", "Add 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("Add Local Folders")) + .child(KeyBinding::for_action_in(&open_action, &focus_handle, cx)), + ) .on_click(cx.listener(move |_, _, window, cx| { window.dispatch_action(open_action.boxed_clone(), cx); cx.emit(DismissEvent); })) }) .child( - Button::new("open_remote_folder", "Add 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("Add Remote Folder")) + .child(KeyBinding::for_action( + &OpenRemote { + from_existing_connection: false, + create_new_window: false, + }, + cx, + )), + ) .on_click(cx.listener(|_, _, window, cx| { window.dispatch_action( OpenRemote {