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

"Go Back" & "Go Forward" in the Help Document System do not preserve position on page #3396

Closed
prko opened this issue Jan 7, 2018 · 8 comments
Labels
comp: help schelp documentation comp: SCDoc scdoc syntax, parser, and renderer. for changes to schelp files, use "comp: help"
Milestone

Comments

@prko
Copy link
Contributor

prko commented Jan 7, 2018

Bug description:
When going back and forward in the help document system, it goes the upper section of the document.
In the previous versions, it goes to the lines which I read at last time.

Steps to reproduce:

  1. CTRL + D
  2. scroll to bottom
  3. click method
  4. Go Back by selecting the Go Back button or by pressing backspace
  5. Go Forward by selecting the Go Forward button

Actual result:
In 3.9 rc2, SC-IDE does not remember the last opened position of the help documents.
It shows only the first upper section of the documents.

Expected result:
It must show the position of the documents which the user read lastly.

@mossheim
Copy link
Contributor

mossheim commented Jan 8, 2018

Hey @prko, thanks for the report. We will fix this in 3.9.1!

@mossheim mossheim added comp: SCDoc scdoc syntax, parser, and renderer. for changes to schelp files, use "comp: help" comp: help schelp documentation labels Jan 8, 2018
@mossheim mossheim changed the title 3.9 rc2: "Go Back" & "Go Forward" in the Help Document System "Go Back" & "Go Forward" in the Help Document System do not preserve position on page Jan 16, 2018
@nhthn nhthn modified the milestones: 3.9.1, 3.9.2 Jan 27, 2018
@patrickdupuis
Copy link
Contributor

I've noticed that if you click on a TOC entry, navigate to a new page, and then go back, you'll be brought to the position in the original page that corresponds to the TOC entry.

@mossheim
Copy link
Contributor

That's probably because the URL including the anchor is being remembered?

@nhthn nhthn modified the milestones: 3.9.2, 3.9.x Mar 3, 2018
@mossheim
Copy link
Contributor

mossheim commented Mar 4, 2018

As discussed in the previous two dev meetings, this is unlikely to be fixed because the problem lies in Qt's webview/webengine implementation, and fixing it would IMO require more time than it's worth. I propose closing this issue as wontfix.

@prko
Copy link
Contributor Author

prko commented Mar 5, 2018

oh, it is regrettable, but thank you very much for your effort and time.

@scztt
Copy link
Contributor

scztt commented Mar 7, 2018

This could be fixed, or at least improved, using javascript only. If you update the page URL when it is scrolled (to, for example, /some/long/url#currentVisibleHeading), then it should get picked up by the history mechanism and back will work fine. This is a common technique to provide coherent URLS for long pages. You could even do it with an exact position, but I think the heading should be enough.

I would also encourage anyone who wants to push on this to file a bug against QT (or, search around to see if there are any already-existing bugs)

@nhthn nhthn removed their assignment Apr 9, 2018
@htor
Copy link
Contributor

htor commented Jul 31, 2018

there's a property scrollPosition in the QWebEnginePage class which could be pushed and popped on a stack for each forward/back call. see https://doc.qt.io/qt-5/qwebenginepage.html#scrollPosition-prop.

then you could maybe do this to restore scroll position (since qt has no api for restoring it QTBUG-48323):

QWebEngineView()->page()->runJavaScript(QString("window.scrollTo(%1, %2);").arg(scrollX).arg(scrollY));

@prko
Copy link
Contributor Author

prko commented Nov 15, 2023

I think it has already been patched. I will close it. Thanks for your time and effort!

@prko prko closed this as completed Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: help schelp documentation comp: SCDoc scdoc syntax, parser, and renderer. for changes to schelp files, use "comp: help"
Projects
None yet
Development

No branches or pull requests

6 participants