From dc89af952d3ad021a2150590231fc8d109ab590d Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Wed, 15 Jul 2026 18:53:47 +0800 Subject: [PATCH] style(tabs): hide the close affordance until hover on active tabs too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The active tab row/chip used to keep its × always visible while the others faded in on hover. Treat every tab the same — opacity 0 until hover, space still reserved — so the sidebar and strip read clean. --- src/ui/tab_sidebar.rs | 14 ++++++-------- src/ui/tab_strip.rs | 20 +++++++++----------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/ui/tab_sidebar.rs b/src/ui/tab_sidebar.rs index a94d7e35..a34869dd 100644 --- a/src/ui/tab_sidebar.rs +++ b/src/ui/tab_sidebar.rs @@ -253,9 +253,9 @@ impl Tty7App { .child(self.tab_avatar(agent, agent_status, agent_unread, ssh_dot, 22., cx)) .child(label_region) // Trailing slot: while the shortcut hints are armed it shows the - // row's ⌘N switch digit; otherwise the close affordance — always - // shown on the active row, opacity-0-until-hover on the others so - // a column of tabs reads clean. Space is reserved either way. + // row's ⌘N switch digit; otherwise the close affordance — + // opacity-0-until-hover on every row, active or not, so a column + // of tabs reads clean. Space is reserved either way. .child(if show_badges && i < 9 { // Bare digit, no keycap box — matches the chip badge exactly. div() @@ -276,11 +276,9 @@ impl Tty7App { } else { div() .flex_shrink_0() - .when(!is_active, |s| { - s.opacity(0.) - .group_hover(SharedString::from(format!("tab-row-{i}")), |s| { - s.opacity(1.) - }) + .opacity(0.) + .group_hover(SharedString::from(format!("tab-row-{i}")), |s| { + s.opacity(1.) }) .child( Button::new(("sidebar-close", i)) diff --git a/src/ui/tab_strip.rs b/src/ui/tab_strip.rs index d10522ed..ed7e735f 100644 --- a/src/ui/tab_strip.rs +++ b/src/ui/tab_strip.rs @@ -591,12 +591,12 @@ impl Tty7App { }) // Clickable / editable label region. .child(label_region) - // Trailing slot: normally the close affordance — always shown on - // the active tab; on the others it stays out of the way - // (opacity 0) and fades in on chip hover, so a row of tabs reads - // clean instead of three-icons-per-chip busy. Space is reserved - // either way, so nothing shifts on hover. While the shortcut - // hints are armed, the same slot shows the tab's ⌘N badge instead. + // Trailing slot: normally the close affordance — kept out of the + // way (opacity 0) on every chip, active or not, and fades in on + // chip hover, so a row of tabs reads clean instead of + // three-icons-per-chip busy. Space is reserved either way, so + // nothing shifts on hover. While the shortcut hints are armed, + // the same slot shows the tab's ⌘N badge instead. .child(if show_badges && i < 9 { // Bare digit, no keycap box — the hint blends into the chip // rather than reading as another button. Sized to the exact @@ -621,11 +621,9 @@ impl Tty7App { } else { div() .flex_shrink_0() - .when(!is_active, |s| { - s.opacity(0.) - .group_hover(SharedString::from(format!("tab-chip-{i}")), |s| { - s.opacity(1.) - }) + .opacity(0.) + .group_hover(SharedString::from(format!("tab-chip-{i}")), |s| { + s.opacity(1.) }) .child( Button::new(("tab-close", i))