From 57524b5b9700b56716e9ff250b0210a72e683922 Mon Sep 17 00:00:00 2001 From: bookingseo <68512992+bookingseo@users.noreply.github.com> Date: Sun, 19 Jul 2026 12:14:43 +0700 Subject: [PATCH] fix(search-tabs): select the right-hand neighbor when closing the active tab (#89) --- e2e/keyword-research-navigation.spec.ts | 6 +++++- src/client/features/search-tabs/SearchTabStrip.tsx | 1 + src/client/features/search-tabs/useSearchTabs.ts | 6 +++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/e2e/keyword-research-navigation.spec.ts b/e2e/keyword-research-navigation.spec.ts index 910051a..0da192c 100644 --- a/e2e/keyword-research-navigation.spec.ts +++ b/e2e/keyword-research-navigation.spec.ts @@ -115,6 +115,10 @@ test.describe("Keyword Research navigation", () => { await expect( page.locator(`[data-search-tab-id="${closedTabId}"]`), ).toHaveCount(0); - await expect(page.getByRole("tab")).toHaveCount(2); + // Count only search tabs: the app shell has grown other tablists + // (Browse/Chat), so a bare role=tab count would include them. + await expect( + page.getByRole("tablist", { name: "Search tabs" }).getByRole("tab"), + ).toHaveCount(2); }); }); diff --git a/src/client/features/search-tabs/SearchTabStrip.tsx b/src/client/features/search-tabs/SearchTabStrip.tsx index 4bb9b4d..00b00f8 100644 --- a/src/client/features/search-tabs/SearchTabStrip.tsx +++ b/src/client/features/search-tabs/SearchTabStrip.tsx @@ -43,6 +43,7 @@ export function SearchTabStrip({