jupyter-book / jupyter-book

Create beautiful, publication-quality books and documents from computational content.
http://jupyterbook.org
BSD 3-Clause "New" or "Revised" License
3.87k stars 663 forks source link

Issue with mynewbook sidebar not disappearing when toggled #2246

Open nathrock opened 3 weeks ago

nathrock commented 3 weeks ago

Issue

I am testing the template book on Windows 11 Pro.

pip install jupyter-book
jupyter-book create mynewbook/
jupyter-book build mynewbook/

On any browser, when I click the hamburger Toggle primary sidebar, the sidebar does not disappear and instead does this Image

When I click off the sidebar, it reverts/expands to the left frame again. This behavior depends on the zoom setting, e.g., if I am zoomed 125%, then the sidebar automatically disappears. Then when I click the hamburger, it reappears normally (i.e., fully in the left frame) until I click off of it.

Environment

Jupyter Book      : 1.0.3
External ToC      : 1.0.1
MyST-Parser       : 2.0.0
MyST-NB           : 1.1.2
Sphinx Book Theme : 1.1.3
Jupyter-Cache     : 1.0.0
NbClient          : 0.8.0

Solution

I thought maybe this would fix the issue https://github.com/jupyter-book/jupyter-book/issues/2160#issuecomment-2162719144, but it did not.

chillerb commented 2 weeks ago

I encountered the same issue. For an online demonstration of the problem, see https://bckrlab.org/dsc-tutorials/intro.html

Weirdly, the sidebar seems to work correctly for local builds and on mobile. But on the site via github-pages, the sidebar does not disappear correctly.

Could it be related to some css files not being found?

agoose77 commented 2 weeks ago

I think this is an upstream issue: https://github.com/pydata/pydata-sphinx-theme/issues/2022

chillerb commented 2 weeks ago

To be honest, I am not sure if the referenced issue is related, since it seems to describe a different problem depending on screen size. For this problem, it appears in the online, but not on the local version, even though the screen size is the same.

nathrock commented 2 weeks ago

To be honest, I am not sure if the referenced issue is related, since it seems to describe a different problem depending on screen size. For this problem, it appears in the online, but not on the local version, even though the screen size is the same.

Can you list your local environment as I did above? My issue arises in both my local build and also on a GitLab at my university:

Using Kubernetes namespace: gitlab
Using Kubernetes executor with image python:3.11.9 ...
$ jupyter-book --version
Jupyter Book      : 1.0.3
External ToC      : 1.0.1
MyST-Parser       : 2.0.0
MyST-NB           : 1.1.2
Sphinx Book Theme : 1.1.3
Jupyter-Cache     : 1.0.0
NbClient          : 0.10.0
chillerb commented 2 weeks ago

Seems to be exactly the same configuration, except that I am on Python 3.12.2:

$ python --version
Python 3.12.2
$ jupyter-book --version
Jupyter Book      : 1.0.3
External ToC      : 1.0.1
MyST-Parser       : 2.0.0
MyST-NB           : 1.1.2
Sphinx Book Theme : 1.1.3
Jupyter-Cache     : 1.0.0
NbClient          : 0.10.0
$ pip list
Package                       Version
----------------------------- --------------
accessible-pygments           0.0.5
alabaster                     0.7.16
anyio                         4.6.2.post1
argon2-cffi                   23.1.0
argon2-cffi-bindings          21.2.0
arrow                         1.3.0
asttokens                     2.4.1
async-lru                     2.0.4
attrs                         24.2.0
Babel                         2.14.0
beautifulsoup4                4.12.3
binaryornot                   0.4.4
bleach                        6.1.0
Brotli                        1.1.0
certifi                       2024.8.30
cffi                          1.17.1
chardet                       5.2.0
charset-normalizer            3.4.0
click                         8.1.7
colorama                      0.4.6
comm                          0.2.2
contourpy                     1.3.0
cookiecutter                  2.6.0
cycler                        0.12.1
debugpy                       1.8.7
decorator                     5.1.1
defusedxml                    0.7.1
docutils                      0.20.1
exceptiongroup                1.2.2
executing                     2.1.0
fastjsonschema                2.20.0
fonttools                     4.54.1
fqdn                          1.5.1
ghp-import                    2.1.0
greenlet                      3.1.1
h11                           0.14.0
h2                            4.1.0
hpack                         4.0.0
httpcore                      1.0.6
httpx                         0.27.2
hyperframe                    6.0.1
idna                          3.10
imagesize                     1.4.1
importlib_metadata            8.5.0
importlib_resources           6.4.5
ipykernel                     6.29.5
ipython                       8.28.0
ipywidgets                    8.1.5
isoduration                   20.11.0
jedi                          0.19.1
Jinja2                        3.1.4
joblib                        1.4.2
json5                         0.9.25
jsonpointer                   3.0.0
jsonschema                    4.23.0
jsonschema-specifications     2024.10.1
jupyter                       1.1.1
jupyter-book                  1.0.3
jupyter-cache                 1.0.0
jupyter_client                8.6.3
jupyter-console               6.6.3
jupyter_core                  5.7.2
jupyter-events                0.10.0
jupyter-lsp                   2.2.5
jupyter_server                2.14.2
jupyter_server_terminals      0.5.3
jupyterlab                    4.2.5
jupyterlab_pygments           0.3.0
jupyterlab_server             2.27.3
jupyterlab_widgets            3.0.13
kiwisolver                    1.4.7
latexcodec                    2.0.1
linkify-it-py                 2.0.3
markdown-it-py                3.0.0
MarkupSafe                    3.0.1
matplotlib                    3.9.2
matplotlib-inline             0.1.7
mdit-py-plugins               0.4.2
mdurl                         0.1.2
mistune                       3.0.2
myst-nb                       1.1.2
myst-parser                   2.0.0
nbclient                      0.10.0
nbconvert                     7.16.4
nbformat                      5.10.4
nest_asyncio                  1.6.0
notebook                      7.2.2
notebook_shim                 0.2.4
numpy                         2.1.2
overrides                     7.7.0
packaging                     24.1
pandas                        2.2.3
pandocfilters                 1.5.1
parso                         0.8.4
pexpect                       4.9.0
pickleshare                   0.7.5
pillow                        11.0.0
pip                           24.2
pkgutil_resolve_name          1.3.10
platformdirs                  4.3.6
prometheus_client             0.21.0
prompt_toolkit                3.0.48
psutil                        6.0.0
ptyprocess                    0.7.0
pure_eval                     0.2.3
pybtex                        0.24.0
pybtex-docutils               1.0.3
pycparser                     2.22
pydata-sphinx-theme           0.15.4
Pygments                      2.18.0
pyjokes                       0.8.3
pyparsing                     3.2.0
PySocks                       1.7.1
python-dateutil               2.9.0
python-json-logger            2.0.7
python-slugify                8.0.4
pytz                          2024.2
PyYAML                        6.0.2
pyzmq                         26.2.0
referencing                   0.35.1
requests                      2.32.3
rfc3339-validator             0.1.4
rfc3986-validator             0.1.1
rich                          13.9.2
rpds-py                       0.20.0
scikit-learn                  1.5.2
scipy                         1.14.1
seaborn                       0.13.2
Send2Trash                    1.8.3
setuptools                    75.1.0
six                           1.16.0
sniffio                       1.3.1
snowballstemmer               2.2.0
soupsieve                     2.5
Sphinx                        7.4.7
sphinx-book-theme             1.1.3
sphinx-comments               0.0.3
sphinx-copybutton             0.5.2
sphinx_design                 0.6.1
sphinx_external_toc           1.0.1
sphinx-jupyterbook-latex      1.0.0
sphinx-multitoc-numbering     0.1.3
sphinx-thebe                  0.3.1
sphinx-togglebutton           0.3.2
sphinxcontrib-applehelp       2.0.0
sphinxcontrib-bibtex          2.6.3
sphinxcontrib-devhelp         2.0.0
sphinxcontrib-htmlhelp        2.1.0
sphinxcontrib-jsmath          1.0.1
sphinxcontrib-qthelp          2.0.0
sphinxcontrib-serializinghtml 1.1.10
SQLAlchemy                    2.0.36
stack-data                    0.6.2
tabulate                      0.9.0
terminado                     0.18.1
text-unidecode                1.3
threadpoolctl                 3.5.0
tinycss2                      1.3.0
tomli                         2.0.2
tornado                       6.4.1
traitlets                     5.14.3
types-python-dateutil         2.9.0.20241003
typing_extensions             4.12.2
tzdata                        2024.2
uc-micro-py                   1.0.3
uri-template                  1.3.0
urllib3                       2.2.3
wcwidth                       0.2.13
webcolors                     24.8.0
webencodings                  0.5.1
websocket-client              1.8.0
wheel                         0.44.0
widgetsnbextension            4.0.13
zipp                          3.20.2
zstandard                     0.23.0
chillerb commented 1 week ago

Any update on this? I just set up a new jupyter book today - and this time, the issue also occurs on the local build 😅

chillerb commented 1 week ago

I just noticed, that my build environment is actually different (besides not using the cookie-cutter template). So maybe the culprit is a dependency? I couldn't check in detail yet though.

Jupyter Book      : 1.0.3
External ToC      : 1.0.1
MyST-Parser       : 2.0.0
MyST-NB           : 1.1.2
Sphinx Book Theme : 1.1.3
Jupyter-Cache     : 1.0.1
NbClient          : 0.8.0
Package                       Version
----------------------------- -----------
accessible-pygments           0.0.5
alabaster                     0.7.16
anyio                         4.6.2
argon2-cffi                   21.3.0
argon2-cffi-bindings          21.2.0
asttokens                     2.0.5
async-lru                     2.0.4
attrs                         24.2.0
Babel                         2.11.0
beautifulsoup4                4.12.3
bleach                        4.1.0
Brotli                        1.0.9
certifi                       2024.8.30
cffi                          1.17.1
charset-normalizer            3.3.2
click                         8.1.7
colorama                      0.4.6
comm                          0.2.1
debugpy                       1.6.7
decorator                     5.1.1
defusedxml                    0.7.1
docutils                      0.20.1
executing                     0.8.3
fastjsonschema                2.16.2
greenlet                      3.1.1
h11                           0.14.0
httpcore                      1.0.2
httpx                         0.27.0
idna                          3.7
imagesize                     1.4.1
importlib_metadata            8.5.0
ipykernel                     6.29.5
ipython                       8.27.0
ipywidgets                    8.1.2
jedi                          0.19.1
Jinja2                        3.1.4
json5                         0.9.25
jsonschema                    4.23.0
jsonschema-specifications     2023.7.1
jupyter                       1.0.0
jupyter-book                  1.0.3
jupyter-cache                 1.0.1
jupyter_client                8.6.0
jupyter-console               6.6.3
jupyter_core                  5.7.2
jupyter-events                0.10.0
jupyter-lsp                   2.2.0
jupyter_server                2.14.1
jupyter_server_terminals      0.4.4
jupyterlab                    4.2.5
jupyterlab-pygments           0.1.2
jupyterlab_server             2.27.3
jupyterlab-widgets            3.0.10
latexcodec                    2.0.1
linkify-it-py                 2.0.3
markdown-it-py                3.0.0
MarkupSafe                    2.1.3
matplotlib-inline             0.1.6
mdit-py-plugins               0.4.2
mdurl                         0.1.2
mistune                       2.0.4
myst-nb                       1.1.2
myst-parser                   2.0.0
nbclient                      0.8.0
nbconvert                     7.16.4
nbformat                      5.10.4
nest-asyncio                  1.6.0
notebook                      7.2.2
notebook_shim                 0.2.3
overrides                     7.4.0
packaging                     24.1
pandocfilters                 1.5.0
parso                         0.8.3
pexpect                       4.8.0
pip                           24.2
platformdirs                  3.10.0
ply                           3.11
prometheus-client             0.14.1
prompt-toolkit                3.0.43
psutil                        5.9.0
ptyprocess                    0.7.0
pure-eval                     0.2.2
pybtex                        0.24.0
pybtex-docutils               1.0.3
pycparser                     2.21
pydata-sphinx-theme           0.16.0
Pygments                      2.15.1
PyQt5                         5.15.10
PyQt5-sip                     12.13.0
PySocks                       1.7.1
python-dateutil               2.9.0.post0
python-json-logger            2.0.7
pytz                          2024.1
PyYAML                        6.0.2
pyzmq                         25.1.2
qtconsole                     5.6.0
QtPy                          2.4.1
referencing                   0.30.2
requests                      2.32.3
rfc3339-validator             0.1.4
rfc3986-validator             0.1.1
rpds-py                       0.10.6
Send2Trash                    1.8.2
setuptools                    75.1.0
sip                           6.7.12
six                           1.16.0
sniffio                       1.3.0
snowballstemmer               2.2.0
soupsieve                     2.5
Sphinx                        7.3.7
sphinx-book-theme             1.1.3
sphinx-comments               0.0.3
sphinx-copybutton             0.5.2
sphinx_design                 0.6.1
sphinx_external_toc           1.0.1
sphinx-jupyterbook-latex      1.0.0
sphinx-multitoc-numbering     0.1.3
sphinx-thebe                  0.3.1
sphinx-togglebutton           0.3.2
sphinxcontrib-applehelp       2.0.0
sphinxcontrib-bibtex          2.6.3
sphinxcontrib-devhelp         2.0.0
sphinxcontrib-htmlhelp        2.1.0
sphinxcontrib-jsmath          1.0.1
sphinxcontrib-qthelp          2.0.0
sphinxcontrib-serializinghtml 1.1.10
SQLAlchemy                    2.0.36
stack-data                    0.2.0
tabulate                      0.9.0
terminado                     0.17.1
tinycss2                      1.2.1
tomli                         2.1.0
tornado                       6.4.1
traitlets                     5.14.3
typing_extensions             4.11.0
uc-micro-py                   1.0.3
urllib3                       2.2.3
wcwidth                       0.2.5
webencodings                  0.5.1
websocket-client              1.8.0
wheel                         0.44.0
widgetsnbextension            4.0.10
zipp                          3.21.0