From 559fcff87093044d8a2e00ef7f18a1d26f125805 Mon Sep 17 00:00:00 2001 From: Smit Barmase Date: Mon, 20 Apr 2026 15:28:15 +0530 Subject: [PATCH] recent_projects: Show project name in dev container suggestion notification (#54297) Closes #52587 Release Notes: - Improved the Dev Container suggestion notification to include the project name, with the full path shown as a tooltip. --- .../recent_projects/src/dev_container_suggest.rs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/crates/recent_projects/src/dev_container_suggest.rs b/crates/recent_projects/src/dev_container_suggest.rs index 759eef2ba32074a964979ee670c0b4ec216f404b..48ef87e4407104177d0734faebf3c2ac587a076d 100644 --- a/crates/recent_projects/src/dev_container_suggest.rs +++ b/crates/recent_projects/src/dev_container_suggest.rs @@ -3,6 +3,7 @@ use dev_container::find_configs_in_snapshot; use gpui::{SharedString, Window}; use project::{Project, WorktreeId}; use std::sync::LazyLock; +use ui::Tooltip; use ui::prelude::*; use util::ResultExt; use util::rel_path::RelPath; @@ -91,6 +92,7 @@ pub fn suggest_on_worktree_updated( let abs_path = worktree.abs_path(); let project_path = abs_path.to_string_lossy().to_string(); + let worktree_name = worktree.root_name_str().to_string(); let key_for_dismiss = project_devcontainer_key(&project_path); let already_dismissed = KeyValueStore::global(cx) @@ -112,10 +114,18 @@ pub fn suggest_on_worktree_updated( workspace.show_notification(notification_id, cx, |cx| { cx.new(move |cx| { - MessageNotification::new( - "This project contains a Dev Container configuration file. Would you like to re-open it in a container?", - cx, + let message: SharedString = format!( + "{worktree_name} contains a Dev Container configuration file. Would you like to re-open it in a container?" ) + .into(); + let tooltip_text: SharedString = project_path.clone().into(); + MessageNotification::new_from_builder(cx, move |_window, _cx| { + div() + .id("dev-container-suggest-message") + .child(Label::new(message.clone())) + .tooltip(Tooltip::text(tooltip_text.clone())) + .into_any_element() + }) .primary_message("Yes, Open in Container") .primary_icon(IconName::Check) .primary_icon_color(Color::Success)