Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

would it make sense to have the right-hand-side toc pane slidable as well ? #1876

Open
parmentelat opened this issue Jun 12, 2024 · 5 comments
Labels
kind: enhancement New feature or request

Comments

@parmentelat
Copy link

in the perspective of allowing for maximum real estate, I would propose to have the right-hand-side (local) TOC pane behave like the left-hand-side (global) one, i.e. that clicking the image area would slide the local toc away to the right

or maybe this is available already through configuration ?
(it looks like _sidebar-toggle.scss has provision for such right-sliding feature...)

I am aware it may be non-trivial implementation-wise, but first I'd like to see if that resonates with other people's wishes

@drammock
Copy link
Collaborator

this already works basically the same way as the left-sidebar I think? If the viewport is narrow enough, you'll get two "collapse" icons (one on each side). E.g., on this page:

https://pydata-sphinx-theme.readthedocs.io/en/latest/community/setup.html

I see:

Screenshot 2024-06-17 at 17-08-36 Get started with development — PyData Theme 0 15 4dev0 documentation

Is that what you meant, or am I misunderstanding?

@parmentelat
Copy link
Author

hey @drammock and thanks for your feedback

I guess I need to clarify - esp. as it turns out pydata-sphinx-theme can be heavily configured and used in a variety of contexts

So to be a little more specific, I was targetting pages as output by jupyter-book, such as e.g.
https://jupyterbook.org/
which, my understanding is, is based upon pydata-sphinx-theme as well

on that page I have a hamburger button here
image
that I can use - regardless of the page size - to make room on the left hand side

my initial suggestion was to get the same kind of behaviour on the right hand side, again regardless of the page width

this is useful on occasions when the central content requires a wide viewport, e.g. for exploring data...

now, I realize after your comment that I might be targetting the wrong repo, as this is maybe something that pertains with jupyter-book's customization of the theme ? it's a little hard to tell for me, please redirect me to another repo if needed

@trallard
Copy link
Collaborator

trallard commented Jun 18, 2024

Hey there. You are right Jupyterbook builds on PyData Sphinx Theme. Though like @drammock already mentioned what you are suggesting is already possible within PST so it might be that Jupyterbook is doing some sort of over write or additional configuration to prevent the local TOC from being collapsed at all? So I'd suggest moving this request over to the Jupyterbook repository instead.

Unless, the expected behavior is that such TOC is collapsible on sufficiently large displays?
I think that would be a different scenario as the local TOC is currently uncollapsed in such scenarios. Though I believe that since the theme main areas have a fixed width even if you are to remove or perhaps collapse the sidebars the main content area would remain centered vs. expanding to fill the whole viewport. So adding a collapsible function to the local TOC would not immediately result in more real state (see https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/layout.html#horizontal-spacing).

That would require a considerable change to the current layout and behavior if that were the expectation.
I understand why this might be desired, though I'd be interested in learning more about whether the current layout and behavior is quite disruptive for example when long tables with scrollable x and y directions are displayed (and perhaps other scenarios). Or whether this would be a matter of "this would be sporadically convenient".

@parmentelat
Copy link
Author

hiya @trallard

thanks for your input

Unless, the expected behavior is that such TOC is collapsible on sufficiently large displays?

yes that was my initial intention, I mean this could be left to a user decision, upon clicking somwhere

Though I believe that since the theme main areas have a fixed width even if you are to remove or perhaps collapse the sidebars the main content area would remain centered vs. expanding to fill the whole viewport. So adding a collapsible function to the local TOC would not immediately result in more real state (see https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/layout.html#horizontal-spacing).

I believe you're right, messing with the rhs elements to force them off does not increase the available space

Or whether this would be a matter of "this would be sporadically convenient".

well yeah, it's not something that happens like all the time; but once you get the idea that it might help, you find yourself wishing more and more often that it were possible; particularly on dataframes obviously, and on maps, and similar artefacts

but well, I was kind of hoping it would be something simple, so I guess it is not that crucial either :)

@drammock
Copy link
Collaborator

adding optional-left-sidebar-collapse at all screen widths is already a requested feature: #1072 (see #1072 (comment) for proposed behavior / appearance). I see no reason in principle why we couldn't do something similar with the right sidebar. IMO it's mostly a matter of backlog --- we have some technical debt around infrastructure/testing and have been spending a lot of time on accessibility too, so adding new features/behaviors has been low on the priority list.

@trallard trallard added the kind: enhancement New feature or request label Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants