New issue
Advanced search Search tips

Issue 619751 link

Starred by 1 user

Issue metadata

Status: Archived
Owner: ----
Closed: Sep 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Retain scroll position on refresh

Project Member Reported by mariakho...@chromium.org, Jun 13 2016

Issue description

Use case 1:

1. Have lots of failures
2. Scroll down to work on one of them
3. Click on a link to the failed test (opens in a new tab), figure out what's the problem, file a bug, copy it's number
4. Switch back to sheriff-o-matic tab, discover that your page has been refreshed and now everything in a different place, search for issue to attach your bug to

Use case 2:

1. Have lots of failures
2. Scroll down, reading issues
3. Auto refresh occurs and the thing you were reading disappears in from in front of you

Perhaps if things were sorted by time the refreshes wouldn't be quite so disruptive since then new things would just show up at the bottom (and you could keep the same scroll position). Alternatively, keep track of what's in the person's viewport and reposition them there after the update (I am guessing this will be hard to get right since there are lots of things in the viewport that may no longer be adjacent). Or some other solution I may not be thinking of.
 
Components: -Infra Infra>SheriffOMatic
Labels: -SheriffOmatic
Status: Available (was: Untriaged)
Yeah I've seen this too. Sean, would switching to overflow fix this?
We switched to a regular div and it did not get fixed.

This is a bit tricky to fix because we regenerate the data behind the scenes, so we'd have to manually keep track of the scroll position, which doesn't sound fun.

I think the real solution is to just not have that many errors. Right now clank is in a bad state, where there are way too many errors for a sheriff to handle. Ideally, a sheriff would only see a small handful, and anything more than that should be exceptional.
I think having only a couple of issues would be wonderful, but in reality there's no way to ensure that'll happen.

Assuming you do AJAX updates to alerts, you could do something like 
var before = window.scrollTop();
... do update to div with new alerts ...
window.scrollTop(before);

Of course for this to work well, you'd want to ensure that the alerts are ordered.
Ah, fancy! Didn't know about that, thanks. I made https://chromium-review.googlesource.com/c/352817/ to add that. Not a great fix, but it roughly works for now. 
If you want to make it *really* fancy, you could use the brand-spanking-new IntersectionObserver* API to determine which alerts are actually in the viewport at the start of the ajax request, then try to find them in the new list after rendering and scroll them into view.

*https://developers.google.com/web/updates/2016/04/intersectionobserver?hl=en
Labels: -Pri-2 Pri-3
https://chromium-review.googlesource.com/c/352817/ has landed. Not sure why bugdroid hasn't commented on here :/ 

I'll leave this open but make it Pri-3.
Components: Infra>Sheriffing>SheriffOMatic
Components: -Infra>Sheriffing
Labels: Milestone-SoMLegacy
Labels: Type-Bug
Status: Archived (was: Available)
This issue is being archived because it refers to the old version of Sheriff-o-Matic and is no longer applicable. 

Sign in to add a comment