From 34b867025df497f274047fc8e533174838734265 Mon Sep 17 00:00:00 2001 From: Codeman maintainer Date: Tue, 13 Oct 2026 18:15:21 +0200 Subject: [PATCH] fix(tabs): Escape from a flat-rail web-tab menu returns focus to the row (#582 merge-time fix) #582 made the web-tab actions menu reachable on the flat rail (ContextMenu or Shift+F10 on a role=tab row), but closeTabGroupMenu only looked for a tree item or a Focus shortcut, so Escape dropped focus to . A `.session-tab` trigger now counts too. Co-Authored-By: Claude Opus 5.5 (1M context) --- src/web/public/app.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/web/public/app.js b/src/web/public/app.js index 7ce3230d..993172c6 100644 --- a/src/web/public/app.js +++ b/src/web/public/app.js @@ -8161,10 +8161,11 @@ class CodemanApp { menu.remove(); if (!restoreFocus) return; // The trigger may have been re-rendered while the menu was open; find the - // live tree item by identity. + // live tree item by identity. A flat-rail row (a web tab's menu opens there + // too, from ContextMenu or Shift+F10) is a `.session-tab` with role=tab. const rail = this.$('sessionTabs'); const item = - (trigger?.isConnected && (trigger.closest('[role="treeitem"]') || trigger.closest('.tab-focus-item'))) || + (trigger?.isConnected && trigger.closest('[role="treeitem"], .tab-focus-item, .session-tab')) || [...(rail?.querySelectorAll('[role="treeitem"]') || [])].find((el) => this._tabTreeIdentity(el) === identity); item?.focus(); }