Only show arrow up right icon in resource link when it is not a file

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
This commit is contained in:
Danilo Leal 2025-08-25 14:22:28 -03:00
parent f04204f724
commit 7ea2e2d471

View file

@ -2041,8 +2041,9 @@ impl AcpThreadView {
cx: &Context<Self>,
) -> AnyElement {
let uri: SharedString = resource_link.uri.clone().into();
let is_file = resource_link.uri.strip_prefix("file://");
let label: SharedString = if let Some(path) = resource_link.uri.strip_prefix("file://") {
let label: SharedString = if let Some(path) = is_file {
path.to_string().into()
} else {
uri.clone()
@ -2060,10 +2061,12 @@ impl AcpThreadView {
Button::new(button_id, label)
.label_size(LabelSize::Small)
.color(Color::Muted)
.icon(IconName::ArrowUpRight)
.icon_size(IconSize::XSmall)
.icon_color(Color::Muted)
.truncate(true)
.when(!is_file.is_some(), |this| {
this.icon(IconName::ArrowUpRight)
.icon_size(IconSize::XSmall)
.icon_color(Color::Muted)
})
.on_click(cx.listener({
let workspace = self.workspace.clone();
move |_, _, window, cx: &mut Context<Self>| {