From adb278b3bb12dafbbd9d4a27ed8ee856a2a1f415 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Sat, 9 May 2026 21:45:03 -0400 Subject: [PATCH] Stop propagation on tab close so the row doesn't re-select MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The launcher row's `on_click` selects the tab. Its child close glyph also has its own `on_click` that selects + closes. After the close, the click bubbled up to the row, which then tried to re-select the tab we just removed — usually a no-op but a wasted state churn that can race with the close in BrowserCore. Add `cx.stop_propagation()` after the close handler so the click ends at the close glyph. --- crates/ely_app/src/shell/chrome/sidebar.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/ely_app/src/shell/chrome/sidebar.rs b/crates/ely_app/src/shell/chrome/sidebar.rs index e466a22..209d8b1 100644 --- a/crates/ely_app/src/shell/chrome/sidebar.rs +++ b/crates/ely_app/src/shell/chrome/sidebar.rs @@ -273,8 +273,12 @@ impl ElyShell { .hover(|style| style.bg(rgba(0x281e1414)).text_color(rgb(colors::INK))) .cursor_pointer() .on_click(cx.listener(move |shell, _, window, cx| { + // Close the tab without bubbling to the launcher row's + // own on_click — otherwise the row tries to re-select + // the tab right after we've closed it. shell.select_tab(&close_tab_id, window, cx); shell.close_active_tab(window, cx); + cx.stop_propagation(); })) .child(IconName::Close), )