From 97ef93ddac346c91734f45d4967da68302f6b00f Mon Sep 17 00:00:00 2001 From: Felix Kling Date: Thu, 8 Aug 2024 16:18:07 +0200 Subject: [PATCH] fix(svelte): Always close navigation sidebar when navigating to a different page (#64357) Fixes srch-859 Problem: Currently the sidebar can reopen in the following scenario: - Go to search home and submit a search - On the search results page click the menu icon to open the sidebar and click 'Code Search' to go back to search home. - Execute a different query - -> this brings you back to search results but with the menu sidebar open Looking at the code it's understandable that this happens: We never close the sidebar. But this problem wasn't very visible because every entry in the nav sidebar either brings you to the React app or to a page with inline nav menu. So this commit fixes the issue by closing the sidebar whenever we navigate to a different page. ## Test plan Manual testing. I added a temporary nav entry that would bring me to the sourcegraph repo page. Clicking on it from the search results page caused the sidebar to close. --- client/web-sveltekit/src/lib/navigation/GlobalHeader.svelte | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/web-sveltekit/src/lib/navigation/GlobalHeader.svelte b/client/web-sveltekit/src/lib/navigation/GlobalHeader.svelte index 6a7d90e0729..78ba2687c8a 100644 --- a/client/web-sveltekit/src/lib/navigation/GlobalHeader.svelte +++ b/client/web-sveltekit/src/lib/navigation/GlobalHeader.svelte @@ -13,6 +13,7 @@