From e67cf996ba46ac933a3429820822bce6d41d8166 Mon Sep 17 00:00:00 2001 From: Casey Watson Date: Tue, 17 Mar 2026 04:44:33 -0600 Subject: [PATCH] Add remote hostname to title bar project picker tooltip (#51616) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Having multiple remote hosts with long project names makes the project picker tricky to use. Added the remote hostname to the tooltip to avoid guessing. **truncated project + hostname (no change)** Screenshot 2026-03-15 at 12 16 29 PM **hostname in tooltip (multiline)** Screenshot 2026-03-15 at 12 16 56 PM **hostname in tooltip (single line)** Screenshot 2026-03-15 at 12 17 15 PM Before you mark this PR as ready for review, make sure that you have: - [x] Added a solid test coverage and/or screenshots from doing manual testing - [x] Done a self-review taking into account security and performance aspects - [x] Aligned any UI changes with the [UI checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) Release Notes: - Add remote hostname to title bar project picker tooltip. Co-authored-by: Amp --- crates/recent_projects/src/recent_projects.rs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/crates/recent_projects/src/recent_projects.rs b/crates/recent_projects/src/recent_projects.rs index c9720af2aba7f4a27adf8e40745bb05012c4dafd..7ecc6a399d66f9cf593f5d0574cfcc060b634cca 100644 --- a/crates/recent_projects/src/recent_projects.rs +++ b/crates/recent_projects/src/recent_projects.rs @@ -1115,12 +1115,21 @@ impl PickerDelegate for RecentProjectsDelegate { let (_, location, paths, _) = self.workspaces.get(hit.candidate_id)?; let is_local = matches!(location, SerializedWorkspaceLocation::Local); let paths_to_add = paths.paths().to_vec(); - let tooltip_path: SharedString = paths + let ordered_paths: Vec<_> = paths .ordered_paths() .map(|p| p.compact().to_string_lossy().to_string()) - .collect::>() - .join("\n") - .into(); + .collect(); + let tooltip_path: SharedString = match &location { + SerializedWorkspaceLocation::Remote(options) => { + let host = options.display_name(); + if ordered_paths.len() == 1 { + format!("{} ({})", ordered_paths[0], host).into() + } else { + format!("{}\n({})", ordered_paths.join("\n"), host).into() + } + } + _ => ordered_paths.join("\n").into(), + }; let mut path_start_offset = 0; let (match_labels, paths): (Vec<_>, Vec<_>) = paths