style(tabs): hide the close affordance until hover on active tabs too

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.
This commit is contained in:
l0ng-ai
2026-07-15 18:53:47 +08:00
parent 0182a072cc
commit dc89af952d
2 changed files with 15 additions and 19 deletions
+6 -8
View File
@@ -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))
+9 -11
View File
@@ -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))