diff --git a/crates/agent_ui/src/agent_configuration/add_llm_provider_modal.rs b/crates/agent_ui/src/agent_configuration/add_llm_provider_modal.rs index f3e2d9f8ee361b83ae379d9d1c55a98a0eaace78..719ff77761562b972ef0ebd8ff6c0f2cf316d6e7 100644 --- a/crates/agent_ui/src/agent_configuration/add_llm_provider_modal.rs +++ b/crates/agent_ui/src/agent_configuration/add_llm_provider_modal.rs @@ -540,6 +540,7 @@ impl Render for AddLlmProviderModal { .max_h(modal_max_height) .pl_3() .pr_4() + .pb_2() .gap_2() .overflow_y_scroll() .track_scroll(&self.scroll_handle) diff --git a/crates/recent_projects/src/remote_servers.rs b/crates/recent_projects/src/remote_servers.rs index 921b19686ab49bb4704fa72b376fc8370b8f354b..b49d30dc23212c2925fa0cf4b5700890c32f5dba 100644 --- a/crates/recent_projects/src/remote_servers.rs +++ b/crates/recent_projects/src/remote_servers.rs @@ -44,7 +44,8 @@ use std::{ }; use ui::{ CommonAnimationExt, IconButtonShape, KeyBinding, List, ListItem, ListSeparator, Modal, - ModalHeader, Navigable, NavigableEntry, Section, Tooltip, WithScrollbar, prelude::*, + ModalFooter, ModalHeader, Navigable, NavigableEntry, Section, Tooltip, WithScrollbar, + prelude::*, }; use util::{ ResultExt, @@ -2749,31 +2750,15 @@ impl RemoteServerProjects { } let mut modal_section = modal_section.render(window, cx).into_any_element(); - let (create_window, reuse_window) = if self.create_new_window { - ( - window.keystroke_text_for(&menu::Confirm), - window.keystroke_text_for(&menu::SecondaryConfirm), - ) - } else { - ( - window.keystroke_text_for(&menu::SecondaryConfirm), - window.keystroke_text_for(&menu::Confirm), - ) - }; - let placeholder_text = Arc::from(format!( - "{reuse_window} reuses this window, {create_window} opens a new one", - )); + let is_project_selected = state.servers.iter().any(|server| match server { + RemoteEntry::Project { projects, .. } => projects + .iter() + .any(|(entry, _)| entry.focus_handle.contains_focused(window, cx)), + RemoteEntry::SshConfig { .. } => false, + }); Modal::new("remote-projects", None) - .header( - ModalHeader::new() - .child(Headline::new("Remote Projects").size(HeadlineSize::XSmall)) - .child( - Label::new(placeholder_text) - .color(Color::Muted) - .size(LabelSize::XSmall), - ), - ) + .header(ModalHeader::new().headline("Remote Projects")) .section( Section::new().padded(false).child( v_flex() @@ -2801,6 +2786,31 @@ impl RemoteServerProjects { .vertical_scrollbar_for(&state.scroll_handle, window, cx), ), ) + .footer(ModalFooter::new().end_slot({ + let confirm_button = |label: SharedString| { + Button::new("select", label) + .key_binding(KeyBinding::for_action(&menu::Confirm, cx)) + .on_click(|_, window, cx| { + window.dispatch_action(menu::Confirm.boxed_clone(), cx) + }) + }; + + if is_project_selected { + h_flex() + .gap_1() + .child( + Button::new("open_new_window", "New Window") + .key_binding(KeyBinding::for_action(&menu::SecondaryConfirm, cx)) + .on_click(|_, window, cx| { + window.dispatch_action(menu::SecondaryConfirm.boxed_clone(), cx) + }), + ) + .child(confirm_button("Open".into())) + .into_any_element() + } else { + confirm_button("Select".into()).into_any_element() + } + })) .into_any_element() } diff --git a/crates/ui/src/components/modal.rs b/crates/ui/src/components/modal.rs index 6d273dde4fcaaafc455d01d555f81ee3c600345d..d67d2e0f1637afc3705ae04f6fd8b8676a87e15a 100644 --- a/crates/ui/src/components/modal.rs +++ b/crates/ui/src/components/modal.rs @@ -77,7 +77,6 @@ impl RenderOnce for Modal { .w_full() .flex_1() .gap(DynamicSpacing::Base08.rems(cx)) - .when(self.footer.is_some(), |this| this.pb_4()) .when_some( self.container_scroll_handler, |this, container_scroll_handle| { @@ -366,15 +365,21 @@ impl RenderOnce for Section { .border_1() .border_color(cx.theme().colors().border) .bg(section_bg) - .py(DynamicSpacing::Base06.rems(cx)) - .gap_y(DynamicSpacing::Base04.rems(cx)) - .child(div().flex().flex_1().size_full().children(self.children)), + .child( + div() + .flex() + .flex_1() + .pb_2() + .size_full() + .children(self.children), + ), ) } else { v_flex() .w_full() .flex_1() .gap_y(DynamicSpacing::Base04.rems(cx)) + .pb_2() .when(self.padded, |this| { this.px(DynamicSpacing::Base06.rems(cx) + DynamicSpacing::Base06.rems(cx)) })