From 3741d5d5e8d7f18949b212a917a3c06320e7c1b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Wed, 7 Oct 2026 04:40:26 -0400 Subject: [PATCH] =?UTF-8?q?Git=20=C2=B7=20row=20actions=20always=20shown:?= =?UTF-8?q?=20refs=20rows=20put=20them=20by=20the=20name,=20the=20words=20?= =?UTF-8?q?below;=20changes=20rows=20keep=20them=20in=20reach?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/git/changes.rs | 6 +----- src/git/refs.rs | 43 ++++++++++++------------------------------- 2 files changed, 13 insertions(+), 36 deletions(-) diff --git a/src/git/changes.rs b/src/git/changes.rs index 70def41..7f99c1a 100644 --- a/src/git/changes.rs +++ b/src/git/changes.rs @@ -216,12 +216,8 @@ impl ChangesList { ) .child( div() - .id("actions") - .focusable() - .in_focus(|actions| actions.opacity(1.)) + .flex_none() .flex() - .opacity(0.) - .group_hover(group, |actions| actions.opacity(1.)) .child(action( "open", IconName::FileText, diff --git a/src/git/refs.rs b/src/git/refs.rs index a43838f..01d321c 100644 --- a/src/git/refs.rs +++ b/src/git/refs.rs @@ -217,10 +217,8 @@ pub(super) fn listed( ) -> AnyElement { let theme = cx.theme(); let colors = theme.colors.clone(); - let group = SharedString::from(format!("{id:?}")); div() .id(id) - .group(group.clone()) .when_some(pick, |row, pick| { let run = pick.run; row.role(Role::ListItem) @@ -234,7 +232,6 @@ pub(super) fn listed( .when(pick.selected, |row| row.bg(colors.selection)) .on_click(move |_, window, cx| run(window, cx)) }) - .relative() .flex() .items_center() .gap_2() @@ -249,12 +246,12 @@ pub(super) fn listed( .min_w_0() .flex() .flex_col() + // Narrow, the name gives way; actions stay in reach. .child( div() .flex() .items_center() - .gap_2() - // Narrow, the name gives way; the words stay. + .gap_1() .child( div() .flex_1() @@ -263,39 +260,23 @@ pub(super) fn listed( .whitespace_nowrap() .child(name), ) - .child( - div() - .flex_none() - .flex() - .gap_2() - .group_hover(group.clone(), |words| words.opacity(0.)) - .children(trailing.into_iter().map(|words| { - tabular(div().text_color(colors.fg_subtle)).child(words) - })), - ), + .child(div().flex_none().flex().children(actions)), ) - .when(!detail.is_empty(), |text| { + .when(!detail.is_empty() || !trailing.is_empty(), |text| { text.child( div() + .flex() + .gap_2() .text_color(colors.fg_subtle) - .child(Ellipsis::new(detail)), + .child(div().flex_1().min_w_0().child(Ellipsis::new(detail))) + .children( + trailing + .into_iter() + .map(|words| tabular(div().flex_none()).child(words)), + ), ) }), ) - // Hover or keyboard focus shows the actions. - .child( - div() - .id("actions") - .focusable() - .in_focus(|actions| actions.opacity(1.)) - .absolute() - .top_0p5() - .right_1() - .flex() - .opacity(0.) - .group_hover(group, |actions| actions.opacity(1.)) - .children(actions), - ) .into_any_element() }