metacpan-web
metacpan-web copied to clipboard
'Contents' section missing in new layout
Describe the bug I just opened metacpan for several Perl modules and all of them are missing the Contents section that used to be at the top of the page. It doesn't appear to be anywhere in the updated layout; no menu icon or link/section in the sidebar, no scrollbar indicating it's off-screen. Two screenshots attached: one from a cached visit that I haven't refreshed which shows the old layout with the Contents section, and the other of the new layout with the Contents section missing.
To Reproduce Steps to reproduce the behavior:
- Go to a module in metacpan
- Don't see Contents section
Expected behavior Expected the Contents section to be somewhere in the new layout to easily navigate longer docs.
Screenshots
Desktop (please complete the following information):
- OS: Windows 10
- Browser: Firefox v105.0.1, Chrome v105.0.5195.127
This happens when the width of the page is less than 1200px. I don't think that is viable - we still want to show the contents in some way.
I just thought to inspect the page and the Contents section is there, just hidden:
Removing the 'display' property shows it, but it causes the contents to be extremely narrow:
This happens when the width of the page is less than 1200px. I don't think that is viable - we still want to show the contents in some way.
Ah, yeah, that's it. I didn't see this before my previous comment. I have my second monitor setup with a ~40/60 vertical split - if I maximize the browser I do see the Contents pane like normal.
Maybe it be feasible to have an alternative, like placing it at the top of the page, if the width is less than 1200px.
The sidebar could be narrower, could it not? I like the new layout, but there's a lot of empty space considering the old layout comfortably had the sidebar, content, and author/dependencies side by side.
One of the reasons the width of the content was minimized had to do with readability. I outlined a little bit of it here https://github.com/metacpan/metacpan-web/issues/2708#issuecomment-1225856757.
I agree that we should still show the table of contents. I can put together a PR that pins the table of contents to the top of the page when the width is less than 1200px. I'm thinking we might still want to either hide it on smaller screens or at least set the default setting to "hide" because if the TOC is long, it will take a user a long time to scroll down the screen on smaller devices.
I agree with the readability concerns personally but will note there are people that don't (that's why I implemented an expand option for perldoc.perl.org). The centering rather than left aligning seems odd with the sidebar present though. Or perhaps it's more that it's limited width but with no indication of the edge of the "page" (i.e. a border, change in color) that makes it look like there is just empty space.
I tend to agree with the readability concerns as well, but just like it'll be a pain to scroll past the table of contents on a small screen, it'll be a pain scrolling for the heading you're looking for without the TOC for longer docs. I think, for smaller screens at least, placing it in a less convenient location and hiding it by default would be a good compromise. Or, rather than pinning it at the top of the page, it could be placed within the sidebar in a scrollable container, closed by default, so that it wouldn't affect the readability of the page content.