retype icon indicating copy to clipboard operation
retype copied to clipboard

Automatically scroll ToC with page content

Open xyeLz opened this issue 2 years ago • 4 comments

I noticed that when reviewing some content on the primary Retype website (https://retype.com/configuration/project/#server), when I would use my mouse wheel to scroll up to the top while reading content, the ToC didn't scroll with me. It did dynamically update the content I was reading, but once I got to the top of the page, I didn't know where I was at since the ToC didn't scroll with me. I use Edge on Windows 11.

This is not a big deal whatsoever and would definitely be a low priority feature request. I'm not even sure if any of the other major wikis support this type of platform but it would be a cool option to allow the user to select which they'd prefer.

xyeLz avatar Aug 10 '22 02:08 xyeLz

Hi @xyeLz. Thanks for the report. We will run some tests on Edge and see if we can figure out what's going wrong. From what I can tell, this only seems to be an issue with Edge, which is somewhat strange.

geoffreymcgill avatar Aug 10 '22 04:08 geoffreymcgill

Hi @geoffreymcgill. I may have explained this poorly. This is also reproducible in Firefox. I attached some screenshots to try and help explain further.

In this image, everything is working as intended. I am navigating the page with my mouse scroll wheel and the right ToC is scrolling along with me:

left-is-fine

In this screenshot, you'll see I continued scrolling down the page, and while the ToC highlight did scroll with me, it is beginning to go off the screen:

toc-missing

My thought was to also scroll the ToC automatically if someone is viewing content that would trigger that specific ToC anchor to be highlighted:

auto-scroll-this

xyeLz avatar Aug 10 '22 15:08 xyeLz

Thanks for the additional details. I understand the scenario now.

Any chance you could link me to any website or app out on the internet that performs a repositioning of the sidebar table-of-contents items when this type of long scroll happens? I'd just like to see what this feels like and see how others might have accomplished this interface sequencing.

I guess the new items at the bottom of the TOC would just need to be scrolled into view on the right. Maybe that wouldn't be too difficult to make work. Although, seems like every time I say that, the task ends of taking 10x my initial time estimate.

geoffreymcgill avatar Aug 11 '22 05:08 geoffreymcgill

To be honest, I am not aware of any documentation platform that does this. I did just check my Docusaurus instance and confirmed that it does not do this. Certainly not an urgent request by any means. Just a nice to have!

xyeLz avatar Aug 11 '22 14:08 xyeLz

Hi, Just came to report this bug too.

mkdocs seems to handle it fine in Edge.

dt192 avatar Aug 26 '23 20:08 dt192

Thanks again for the reports. We will improve the functionality of the ToC to ensure the current items are always scrolled into view.

geoffreymcgill avatar Sep 01 '23 15:09 geoffreymcgill

We have improved the ToC to ensure the active items are always scrolled into view.

The new functionality will be included in the upcoming Retype v3.4 release.

geoffreymcgill avatar Sep 06 '23 15:09 geoffreymcgill

Retype v3.4.0 is now available.

https://retype.com/changelog/

geoffreymcgill avatar Sep 08 '23 23:09 geoffreymcgill

Anybody here test the new functionality of automatically moving the current ToC items into view? What do you think?

geoffreymcgill avatar Sep 19 '23 00:09 geoffreymcgill

Confirmed this actually works beautifully now. Thanks for the attention to this.

xyeLz avatar Sep 19 '23 02:09 xyeLz