iterative / dvc.org

📖 DVC website and documentation
https://dvc.org
Apache License 2.0
341 stars 393 forks source link

scroll-to-text fragment does not work #4573

Open skshetry opened 1 year ago

skshetry commented 1 year ago

Report

dvc.org does not auto scroll to the text fragment.

For example: this link does highlight, but it does not navigate automatically navigate to that text: https://dvc.org/doc/user-guide/project-structure/dvcyaml-files#:~:text=list%20of%20metrics-,contains%20one%20or%20more%20paths%20to,-metrics%20files.%20Here%27s

https://dvc.org/doc/user-guide/project-structure/dvcyaml-files#:~:text=list%20of%20metrics-,contains%20one%20or%20more%20paths%20to,-metrics%20files.%20Here%27s

Note that scroll-to-text fragment is not yet available yet on Firefox, and only available on Safari 16.1 or greater.

Also see https://web.dev/text-fragments/.

Screencast from 2023-05-26 16-22-59.webm

shcheklein commented 1 year ago

I'm hitting the same issue:

https://github.com/iterative/dvc.org/assets/3659196/dc68fbef-f7ab-4934-9098-fe6fbe7fc519

@yathomasi @julieg18 could you please take a look when you have time? I think it breaks user experience significantly.

skshetry commented 1 year ago

@shcheklein, that link works for me in Firefox, but not in Chromium for some reason.

But this issue is a bit different. scroll-to-text fragment is a new spec, you can read more about it here: https://web.dev/text-fragments/, while the one you have is scrolling to a specific anchor.

dberenbaum commented 10 months ago

Is this still a priority @shcheklein?

shcheklein commented 10 months ago

It's annoying issue (e.g. you send a link someone and they can't open it to the point that you expect them to read). Among other issues related to the engine I think this is an important one.

yathomasi commented 10 months ago

Text fragments are also working for me. Overall, It's the scroll to section, that's not working properly.

https://github.com/iterative/dvc.org/assets/20840228/53c7c6c4-2b8c-4675-a9fd-0037b9415ef0

AFAIR, we have a legacy code that overrides the default scroll logic, which is never a good idea, but it must be there because that might have been the only option at that moment.

I remember stumbling on that code at some point and didn't do a deep dive as it would need quite a refactoring. Anyway, I can prioritize and take this current sprint.

skshetry commented 10 months ago

Highlighting seems to be working, but scrolling does not work reliably for text fragments either. Maybe same issue as with anchors.

https://github.com/iterative/dvc.org/assets/18718008/eb786f9e-bfe5-45f1-822a-6b3aa64cd7c2