Skip to content

fix(docs): add sphinxcontrib-jquery to fix search on Sphinx 7+#171

Open
realsudarshan wants to merge 2 commits intoActivityWatch:masterfrom
realsudarshan:fix/search-bar
Open

fix(docs): add sphinxcontrib-jquery to fix search on Sphinx 7+#171
realsudarshan wants to merge 2 commits intoActivityWatch:masterfrom
realsudarshan:fix/search-bar

Conversation

@realsudarshan
Copy link
Copy Markdown

What does this PR do?

Fixes the search bar being stuck on "Searching..." on docs.activitywatch.net

Root cause

Sphinx 6+ removed jQuery from its default bundle, but sphinx_rtd_theme
depends on it for search functionality. This caused search to silently
fail and hang indefinitely.

Fix

  • Added sphinxcontrib-jquery to dependencies in pyproject.toml
  • Added sphinxcontrib.jquery to the extensions list in src/conf.py

Testing

Tested locally by serving the built docs with python -m http.server
and confirmed search returns results correctly after the fix.

fixed.mp4

Fixes #170

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 25, 2026

Greptile Summary

This PR fixes the docs search bar hanging on "Searching…" by adding sphinxcontrib-jquery as an explicit dependency and Sphinx extension, restoring the jQuery that sphinx_rtd_theme needs but that Sphinx 7 no longer bundles. The fix is correct and minimal.

Confidence Score: 5/5

Safe to merge — targeted, well-understood fix with no functional regressions.

The change is minimal (one new dependency + one extension entry) and directly addresses a known compatibility gap between Sphinx 7 and sphinx_rtd_theme. No logic is altered, no security surface is affected, and the fix is consistent with the existing codebase style.

No files require special attention.

Important Files Changed

Filename Overview
pyproject.toml Added sphinxcontrib-jquery = "*" dependency; version constraint is unconstrained but consistent with other *-pinned deps in the file
src/conf.py Added sphinxcontrib.jquery to extensions list — correct placement and correct approach for restoring jQuery for sphinx_rtd_theme on Sphinx 7+
poetry.lock Lock file regenerated with Poetry 2.3.4 (up from 2.1.4); content-hash updated to reflect new pyproject.toml; no other substantive changes

Sequence Diagram

sequenceDiagram
    participant Sphinx as Sphinx 7+
    participant RTD as sphinx_rtd_theme
    participant jQuery as sphinxcontrib.jquery
    participant Browser as Browser (search)

    Sphinx->>RTD: Build HTML
    Sphinx->>jQuery: Load extension (injects jQuery)
    jQuery-->>Sphinx: jQuery bundled into _static/
    RTD-->>Browser: Render search page with jQuery available
    Browser->>Browser: Search works correctly
Loading

Reviews (2): Last reviewed commit: "chore: update poetry.lock to match pypro..." | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Search bar stuck on "Searching" on docs site

1 participant