From bc6f1c2e73bcec5ceaffdb67ed7ef2092c6fcb13 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:34:37 -0400 Subject: [PATCH] =?UTF-8?q?Git=20=C2=B7=20rows=20draw=20their=20focus=20ri?= =?UTF-8?q?ng;=20row=20actions=20show=20while=20the=20keyboard=20is=20on?= =?UTF-8?q?=20them?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/git/blame.rs | 2 ++ src/git/changes.rs | 5 +++++ src/git/commits.rs | 2 ++ src/git/history.rs | 2 ++ src/git/refs.rs | 7 ++++++- src/git/viewer.rs | 4 ++++ 6 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/git/blame.rs b/src/git/blame.rs index 67cee64..f5a29c0 100644 --- a/src/git/blame.rs +++ b/src/git/blame.rs @@ -198,6 +198,8 @@ impl RenderOnce for BlameView { .role(Role::Button) .aria_label(said) .tab_index(0) + .border_1() + .border_color(gpui::transparent_black()) .focus_ring(cx) .cursor_pointer() .hover(|gutter| gutter.bg(colors.hover)) diff --git a/src/git/changes.rs b/src/git/changes.rs index 3b151d5..70def41 100644 --- a/src/git/changes.rs +++ b/src/git/changes.rs @@ -169,6 +169,8 @@ impl ChangesList { .aria_label(file.path.clone()) .aria_selected(picked) .tab_index(0) + .border_1() + .border_color(gpui::transparent_black()) .focus_ring(cx) .when(picked, |row| row.bg(colors.selection)) .flex() @@ -214,6 +216,9 @@ impl ChangesList { ) .child( div() + .id("actions") + .focusable() + .in_focus(|actions| actions.opacity(1.)) .flex() .opacity(0.) .group_hover(group, |actions| actions.opacity(1.)) diff --git a/src/git/commits.rs b/src/git/commits.rs index 1105515..f25369f 100644 --- a/src/git/commits.rs +++ b/src/git/commits.rs @@ -78,6 +78,8 @@ impl RenderOnce for CommitItem { .aria_label(spoken) .aria_selected(self.selected) .tab_index(0) + .border_1() + .border_color(gpui::transparent_black()) .focus_ring(cx) .flex_1() .min_w_0() diff --git a/src/git/history.rs b/src/git/history.rs index 5ef335f..236413f 100644 --- a/src/git/history.rs +++ b/src/git/history.rs @@ -76,6 +76,8 @@ impl RenderOnce for FileHistory { .aria_label(commit.subject.clone()) .aria_selected(picked) .tab_index(0) + .border_1() + .border_color(gpui::transparent_black()) .focus_ring(cx) .flex() .gap_3() diff --git a/src/git/refs.rs b/src/git/refs.rs index f0c5dc2..a43838f 100644 --- a/src/git/refs.rs +++ b/src/git/refs.rs @@ -227,6 +227,8 @@ pub(super) fn listed( .aria_label(pick.spoken) .aria_selected(pick.selected) .tab_index(0) + .border_1() + .border_color(gpui::transparent_black()) .focus_ring(cx) .cursor_pointer() .when(pick.selected, |row| row.bg(colors.selection)) @@ -280,9 +282,12 @@ pub(super) fn listed( ) }), ) - // On hover the actions take the words' place. + // Hover or keyboard focus shows the actions. .child( div() + .id("actions") + .focusable() + .in_focus(|actions| actions.opacity(1.)) .absolute() .top_0p5() .right_1() diff --git a/src/git/viewer.rs b/src/git/viewer.rs index c716172..2eeb0ac 100644 --- a/src/git/viewer.rs +++ b/src/git/viewer.rs @@ -234,6 +234,8 @@ impl RenderOnce for DiffViewer { .aria_label(spoken(line)) .aria_selected(picked) .tab_index(0) + .border_1() + .border_color(gpui::transparent_black()) .focus_ring(cx) .cursor_pointer() .on_mouse_down(MouseButton::Left, |_, window, _| { @@ -365,6 +367,8 @@ impl RenderOnce for DiffViewer { .text_color(colors.fg_subtle) .when_some(open, |row, open| { row.tab_index(0) + .border_1() + .border_color(gpui::transparent_black()) .focus_ring(cx) .cursor_pointer() .hover(|row| row.text_color(colors.fg))