Repository navigation
Restore the mobile sidebar toggles in the docs - #1872
Merged
Merged
Conversation
On phone-width screens neither the site-navigation nor the "on this page" toggle opened its sidebar. sphinx-book-theme 1.4.0 pins pydata-sphinx-theme 0.20.0, which adds a search field to the top navbar whenever `navbar_persistent` is absent from `html_theme_options`. That renders the PyData header, carrying its own hidden copies of both sidebar toggles, ahead of the book theme's visible ones. The theme JS binds to the first `.primary-toggle` / `.secondary-toggle` in the page, so the hidden buttons got the handlers and the visible ones did nothing. Set `navbar_persistent=[]`, the same default the book theme's own fix applies (executablebooks/sphinx-book-theme#987, merged after 1.4.0 and not yet released). The PyData header now renders empty, each page has one toggle of each kind, and both sidebars open on mobile. On desktop the top bar that held only a duplicate search field (executablebooks/sphinx-book-theme#986) is gone, and the toggles behave as on the book theme's own docs. Pin sphinx-book-theme to 1.4.0 so the theme pair (and the markup the toggles depend on) only changes deliberately; the docs CI installs from `pyproject.toml`, so this is the effective pin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
CI Build PlanChanged FilesDocumentation (2 files)
pyproject.toml (1 file)
Build ConfigurationNo code build required -- changes are docs/site/non-code only. Rationale
Updated by CI on each push. See path-filters.yml for category definitions. |
sunt05
added a commit
that referenced
this pull request
Oct 22, 2026
Carries the docs/source/conf.py change of #1872 into the 2026.6.5 docs: html_theme_options navbar_persistent=[] stops pydata-sphinx-theme 0.20 from adding a hidden navbar whose sidebar toggles capture the theme JS, which left the visible toggles unable to open the sidebars on phones. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
On phone-width screens neither docs sidebar opened: the site-navigation and "on this page" toggles did nothing.
sphinx-book-theme 1.4.0 pins pydata-sphinx-theme 0.20.0, which adds a search field to the top navbar whenever
navbar_persistentis not set. That renders the PyData header, with its own hidden copies of both sidebar toggles, ahead of the book theme's visible ones. The theme JavaScript binds to the first.primary-toggle/.secondary-toggleon the page, so the hidden buttons got the handlers and the visible ones did nothing.Changes
docs/source/conf.py: setnavbar_persistent=[], the same default the book theme's own fix applies (fix: don’t show navbar if the user doesn’t ask for it executablebooks/sphinx-book-theme#987, merged after 1.4.0, not yet released).pyproject.toml: pinsphinx-book-theme==1.4.0in the docs extra, so the theme pair, and the markup the toggles depend on, only changes deliberately.Verification
Docs built with the gallery off and checked in a headless browser:
The published 2026.6.5 docs pick this up only when the docs anchor is rebuilt.