Restore non-deferred jQuery to unblock search #4955
+1
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR temporarily removes defer from the jQuery script to restore search functionality, which is currently broken on main.
The regression may not be immediately obvious because there is no visible error in the UI, but search/autocomplete does not initialize correctly due to reliance on global $ and inline execution order.
I traced this using git bisect to PR #4828 , which correctly deferred jQuery for performance and accessibility. That change exposed fragile assumptions in the existing search implementation rather than introducing an incorrect change.
I attempted multiple approaches to fix search while keeping deferred loading (moving initialization into JS ownership, aligning with DOM and activity lifecycle, decoupling initialization), but the current structure of doSearch tightly couples UI setup and execution and depends on implicit timing, making a safe fix non-trivial.
This PR is not intended as a long-term solution. It is meant as a temporary unblock while a proper refactor of search initialization is discussed and implemented.
Root-cause analysis and bisect details are documented in issue #4954 .
I’m happy to rework or drop this PR based on maintainer preference.