This commit is contained in:
2026-08-10 18:24:48 +07:00
parent 1daa10e57c
commit 91a76a6f52
+27 -3
View File
@@ -269,6 +269,7 @@ impl Render for RepoDetailView {
.unwrap_or_else(|| "Overview".into()); .unwrap_or_else(|| "Overview".into());
let relays = announcement.relays.clone(); let relays = announcement.relays.clone();
let web = announcement.web.clone();
v_flex() v_flex()
.id("repo") .id("repo")
@@ -284,12 +285,13 @@ impl Render for RepoDetailView {
.border_color(cx.theme().border) .border_color(cx.theme().border)
.child( .child(
v_flex() v_flex()
.flex_none() .flex_1()
.min_w_0()
.child(div().font_semibold().child(name)) .child(div().font_semibold().child(name))
.child( .child(
div() div()
.w_full() .w_full()
.text_sm() .text_xs()
.text_color(cx.theme().muted_foreground) .text_color(cx.theme().muted_foreground)
.line_clamp(3) .line_clamp(3)
.child(description), .child(description),
@@ -297,7 +299,7 @@ impl Render for RepoDetailView {
) )
.child( .child(
h_flex() h_flex()
.flex_1() .flex_none()
.gap_2() .gap_2()
.justify_end() .justify_end()
.child( .child(
@@ -329,6 +331,28 @@ impl Render for RepoDetailView {
menu menu
}), }),
) )
.child(
DropdownButton::new("web")
.button(Button::new("web-trigger").label("Websites").ghost())
.dropdown_menu(move |menu, _window, _cx| {
let mut menu = menu;
if web.is_empty() {
return menu
.item(PopupMenuItem::new("No web").disabled(true));
}
for url in web.iter() {
let href = url.to_string();
menu = menu.item(
PopupMenuItem::new(href.clone()).on_click(
move |_, _, cx| {
cx.open_url(&href);
},
),
);
}
menu
}),
)
.child( .child(
Button::new("link") Button::new("link")
.icon(IconName::ExternalLink) .icon(IconName::ExternalLink)