diff --git a/frontend/src/client/courts.ts b/frontend/src/client/courts.ts index 504387e..6864abf 100644 --- a/frontend/src/client/courts.ts +++ b/frontend/src/client/courts.ts @@ -291,6 +291,13 @@ function initSearch() { searchQuery = input.value; render(); }); + // Honor `?q=` from the global search-palette deep links. render() runs + // after loadCourts() resolves and reads the module-level searchQuery. + const q = new URLSearchParams(location.search).get("q"); + if (q) { + input.value = q; + searchQuery = q; + } } // --- Feedback modal --- diff --git a/frontend/src/client/glossary.ts b/frontend/src/client/glossary.ts index 3472a2a..4780bd4 100644 --- a/frontend/src/client/glossary.ts +++ b/frontend/src/client/glossary.ts @@ -85,6 +85,13 @@ function initSearch() { searchQuery = input.value; render(); }); + // Honor `?q=` from the global search-palette deep links. render() runs + // after loadTerms() resolves and reads the module-level searchQuery. + const q = new URLSearchParams(location.search).get("q"); + if (q) { + input.value = q; + searchQuery = q; + } } // --- Category filters ---