From 4b078fa2ee0dd3472b27556bab189c7b551c2313 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 31 Mar 2026 09:23:40 -0300 Subject: client: sidebar-search: zap subsequent context from homepage --- src/static/js/client/sidebar-search.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src') diff --git a/src/static/js/client/sidebar-search.js b/src/static/js/client/sidebar-search.js index 87da7055..0d1dbaaf 100644 --- a/src/static/js/client/sidebar-search.js +++ b/src/static/js/client/sidebar-search.js @@ -127,6 +127,7 @@ export const info = { activeQueryContextPageName: {type: 'string'}, activeQueryContextPagePathname: {type: 'string'}, activeQueryContextPageColor: {type: 'string'}, + zapActiveQueryContext: {type: 'boolean'}, activeQueryResults: { type: 'json', @@ -163,6 +164,8 @@ export function* bindSessionStorage() { yield 'activeQueryContextPageName'; yield 'activeQueryContextPagePathname'; yield 'activeQueryContextPageColor'; + yield 'zapActiveQueryContext'; + yield 'activeQueryResults'; yield 'activeFilterType'; yield 'resultsScrollOffset'; @@ -750,6 +753,15 @@ function recordActiveQueryContext() { const {session} = info; if (document.documentElement.dataset.urlKey === 'localized.home') { + session.activeQueryContextPageName = null; + session.activeQueryContextPagePathname = null; + session.activeQueryContextPageColor = null; + session.zapActiveQueryContext = true; + return; + } + + // Zapping means subsequent searches don't record context. + if (session.zapActiveQueryContext) { return; } @@ -795,6 +807,7 @@ function clearActiveQuery() { session.activeQueryContextPageName = null; session.activeQueryContextPagePathname = null; session.activeQueryContextPageColor = null; + session.zapActiveQueryContext = false; } function clearSidebarFilter() { -- cgit 1.3.0-6-gf8a5