Highlighted story doesn't follow cursor correctly in articles with photos.

Highlighed story doesn’t follow cursor correctly when reading articles with photos. Here is a short screencast that demonstrates the article. I can reproduce this behavior consistenly on a few different blog feeds, always on articles that have photos in them. Other articles seem to work fine.

http://screencast.com/t/sMGubpJlAL

1 Like

Yeah, it’s because I pre-compute the locations of stories to make it much faster to calculate your location while you scroll. The problem is that these offsets get offset even further when images load. I have callbacks for when images load, but for some reason, after a certain point those callbacks no longer fire.

An interim solution would be to just recalculate positions every few seconds, which is fairly quick, although it could lead to a stutter. Maybe an exponential time decay: recalculate after .5 second, then 1s, 2s, 4s, 8s, 16s, etc. I like that idea, but when do I start it? After the feed is loaded, or after enough images are loaded, or after all the images are loaded? The trouble is that sometimes the count for the number of images loaded on the page is wrong, which is what you are experiencing.

I have a fairly substantial number of UI changes and fixes in the social branch. I’m tempted to just add the time decay to that branch. So in a few weeks, you’ll probably get this functionality.

Until then, there are a few ways to trigger a re-calculation: load another page of stories, or click the “story changes” icon next to the date (your screencast showed a story with changes).

Thanks for bringing this to my attention. I’ve spent a LOOOONG time trying to get this right. Not so easy, and there are still edge cases that slip through.