From 31f5d38f3d41d0b8fc4b87b46ebf6b1cd3ef2d25 Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Wed, 30 Sep 2026 00:53:59 +0800 Subject: [PATCH] fix(sidebar): back a tab's hover close button for the row's full height MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On a two-line row the diff count sits below the close button's band, and the bottom of '+2' showed under the ×. --- src/ui/tab_sidebar.rs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/ui/tab_sidebar.rs b/src/ui/tab_sidebar.rs index 6ff93284..5f4d5884 100644 --- a/src/ui/tab_sidebar.rs +++ b/src/ui/tab_sidebar.rs @@ -1102,23 +1102,26 @@ impl Tty7App { let mut fade_from = backing; fade_from.a = 0.; row.child( + // The row's full height, not the button's: on a + // two-line row the diff count sits under the + // button's band, and a band-high backing left the + // bottom of "+2" showing beneath the ×. h_flex() .absolute() - .top(px((row_h - crate::ui::tab_strip::MIN_TARGET) / 2.)) + .top_0() + .bottom_0() .right(px(6.)) .opacity(0.) .group_hover(SharedString::from(format!("tab-row-{i}")), |s| { s.opacity(1.) }) - .child(div().w(px(10.)).h(px(crate::ui::tab_strip::MIN_TARGET)).bg( - linear_gradient( - 90., - linear_color_stop(fade_from, 0.), - linear_color_stop(backing, 1.), - ), - )) + .child(div().w(px(10.)).h_full().bg(linear_gradient( + 90., + linear_color_stop(fade_from, 0.), + linear_color_stop(backing, 1.), + ))) .child( - div().bg(backing).child( + div().h_full().flex().items_center().bg(backing).child( crate::ui::tab_strip::hit_target( Button::new(("sidebar-close", i)) .icon(IconName::Close)