Repository navigation
Fix the sidebar toggle buttons. - #226
Merged
Merged
Conversation
The visible menu button had no click handler, so the sidebar stayed closed below 960px. Forward those clicks to the header button the theme already listens to. Co-authored-by: Cursor <cursoragent@cursor.com>
pydata-sphinx-theme fills navbar_persistent with a search button unless it is set, which renders a header with its own hidden sidebar toggles. Both themes bind only the first .primary-toggle/.secondary-toggle, so the visible buttons in the article header got no handler. Setting navbar_persistent to [] stops that header from rendering, as the upstream fix executablebooks/sphinx-book-theme#987 does, so the forwarding script is no longer needed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
konn
marked this pull request as ready for review
November 19, 2026 09:34
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.
The visible sidebar toggle buttons in the article header did nothing.
pydata-sphinx-theme 0.17 puts a search button into
navbar_persistentunless the option is set. That makes it render its own header, which has its own sidebar toggles that sphinx-book-theme hides with CSS. Both themes attach click handlers only to the first.primary-toggle/.secondary-toggleon the page, so the handlers went to the hidden header buttons instead of the visible ones.This sets
navbar_persistent: []inhtml_theme_optionsfor both books, the same default that the upstream fix (executablebooks/sphinx-book-theme#987, merged but not yet released) applies. The extra header no longer renders, so the visible buttons get the handlers directly. It also removes the top bar that only held a duplicate search field.No search feature is lost:
Checked on local builds of both books with notebook execution turned off:
🤖 Generated with Claude Code