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

Add scroll bar to table of contents pane #496

Closed
hgrw opened this issue Dec 17, 2022 · 7 comments
Closed

Add scroll bar to table of contents pane #496

hgrw opened this issue Dec 17, 2022 · 7 comments
Labels
bug Something isn't working resolved
Milestone

Comments

@hgrw
Copy link

hgrw commented Dec 17, 2022

A lot of my documentation tends to have many headings. In many cases the table of contents pane ends up truncated. Would it be possible to have a scroll bar here? Without a scroll bar, the table of contents pane is not feasible in my use-case unfortunately.

@dwrolvink
Copy link
Collaborator

Vertical scrolling works as expected for me so I'm assuming you're talking about horizontal scrolling

There are multiple options, such as setting a max-width, that would have as effect that we go from

image

to

image

Which, in my simple test, would work pretty well without a scrollbar.
Maybe you can share a screenshot if this is not what you'd like for your setup.

@hgrw
Copy link
Author

hgrw commented Dec 17, 2022

Interesting. Scrolling on the right hand side pane works, but not on the left. I have flipped my panes to show TOC on the left. My toggles are

toggles:
  features:
    styling:
      add_toc: True    # add "[TOC]" (Table of Contents) when missing
      toc_pane: True
      flip_panes: True
      accent_color: '#0c004b'

Can confirm that when I set flip_panes to false I get both scroll bars back. Also, there is a clue. There is no minimise button (<,>) when scroll is missing.

@dwrolvink
Copy link
Collaborator

dwrolvink commented Dec 17, 2022

I am able to scroll on both sides.

@hgrw
Copy link
Author

hgrw commented Dec 17, 2022

Hmm. I will look into it a bit more and report back during the week.

@dwrolvink
Copy link
Collaborator

Ah yes I can replicate it with flip_panes: True
There is some js shenannigans going on, worked on different parts in different times, sure the culprit is in there somewhere.

@dwrolvink
Copy link
Collaborator

lmao

        # Set pane divs
        toc_pane_div = "right_pane_content"
        content_pane_div = "left_pane_content"
        if pb.gc('toggles/features/styling/layout') == 'documentation' and pb.gc('toggles/features/styling/flip_panes'):
            toc_pane_div = "left_pane"
            content_pane_div = "right_pane_content"

changed to

        # Set pane divs
        toc_pane_div = "right_pane_content"
        content_pane_div = "left_pane_content"
        if pb.gc('toggles/features/styling/layout') == 'documentation' and pb.gc('toggles/features/styling/flip_panes'):
            toc_pane_div = "left_pane_content"
            content_pane_div = "right_pane_content"

Typical bug.
Though this did fix the bug of not being able to scroll / missing folder, the alignment was pretty bad when flipping the panes over.

Did some fixing there too.
Works pretty well for me now.

@dwrolvink dwrolvink reopened this Dec 18, 2022
@dwrolvink dwrolvink added this to the v3.3.0+ milestone Dec 18, 2022
@hgrw
Copy link
Author

hgrw commented Dec 18, 2022

Nice, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resolved
Projects
None yet
Development

No branches or pull requests

2 participants