client icon indicating copy to clipboard operation
client copied to clipboard

When loading pending updates, consider scrolling to the "closest" one, not the latest one

Open acelaya opened this issue 1 year ago • 2 comments

As part of https://github.com/hypothesis/client/issues/6255, we implemented some logic to scroll the sidebar to display the most recent one of the new or updated annotations (see https://github.com/hypothesis/client/pull/6338 and https://github.com/hypothesis/client/pull/6337).

However, we have considered checking which is closest to the active viewport (if none of them are already inside of it) and scrolling to that one, to reduce viewport disruption as much as possible.

acelaya avatar Apr 16 '24 10:04 acelaya

I'm not sure about this. Scrolling to the newest or oldest update seems like it would feel more predictable to me than scrolling to whichever happens to be nearest in the viewport - which could be at an arbitrary distance from the current viewport position.

robertknight avatar Apr 16 '24 10:04 robertknight

I'm not sure about this. Scrolling to the newest or oldest update seems like it would feel more predictable to me than scrolling to whichever happens to be nearest in the viewport - which could be at an arbitrary distance from the current viewport position.

Yep, I tend to agree with this. After implementing it date-based, it does feel like the right approach.

acelaya avatar Apr 16 '24 10:04 acelaya