inception icon indicating copy to clipboard operation
inception copied to clipboard

Search result list jumps back to top

Open UWinch opened this issue 5 years ago • 3 comments

Describe the bug The search results list jumps back to the top when multiple documents are displayed in the list and one clicks on a result at the bottom.

To Reproduce Steps to reproduce the behavior:

  1. E.g. import the example project (https://webanno.github.io/webanno/examples/demo-de.zip)
  2. Search for "der"
  3. Scroll down the result list and click on a result
  4. The result list jumps back to the top of the results

Expected behavior The result list should stop at the place where the user scrolled to.

Screenshots If applicable, add screenshots to help explain your problem.

Please complete the following information:

  • Version and build ID: 0.14.2, 0.15.0
  • OS: Ubuntu
  • Browser: Chrome

Additional context Add any other context about the problem here.

UWinch avatar Jan 28 '20 15:01 UWinch

@reckart I'm sure the results list jumps because the sidebar is refreshed when a new document is loaded. I have two ideas to solve this: add some javascript because in js we can to my knowledge change the scrollbar position, I would save it when the result is clicked and then restore the position. Another idea is to just not refresh the sidebar, I would flag the sidebar to not be refreshed when all children of the annotation page are refreshed on document load. Because I just learned that you can set component metadata, I would add a flag as metadata to the sidebar. The second idea needs a check in the corresponding webanno method that refreshes a page. What do you think?

UWinch avatar Jan 29 '20 17:01 UWinch

You wanted to implement the tab for the new "curation" sidebar panel such that it shows only if the user has curator permissions. Would showing/hiding that tab still work if the sidebar is no longer refreshed?

Since curation is a project-level permission and we switch between documents within a project... I guess it would?

What about if documents are switched e.g. in active learning mode? Does that somehow rely on the sidebar refreshing behavior we have right now?

I think it makes sense to not refresh the sidebar on switching documents, but maybe some sidebar panels need it and then they might have to "listen" to a relevant event and refresh themselves.

reckart avatar Jan 30 '20 07:01 reckart

This has been fixed for the case of clicking on a checkbox in the lower parts of the search results. However, when clicking on a result causes a switch to another document, this causes the whole page to re-render and in this case the sidebar still jumps.

reckart avatar Jul 19 '22 09:07 reckart