Uploading images and scrolling up jank

Correction: with my currently faster Internet, I don’t even see the loading circle any more. I just get near the top of the page and then several posts get skipped.

It actually seems like it would be better if the new content didn’t actually get added to the DOM (even if it has been loaded) until the scroll position is right at the top of the currently displayed posts, just below where the new posts would be loaded.

Then it could store the current post temporarily, add the new content to the DOM, and near immediately scroll back to the current post. As long as this is fast enough, the scrolling would look relatively smooth. And, even if there is a bit of jank on slower devices, at least no posts would ever be skipped.

And, if the current scrolling behavior is fine for some people and not others, maybe this could be an option that users could enable. “Attempt to smooth out scrolling up in Chrome.”

Can you repro in a topic with zero images, all text?

Do remember that scrolling up is technically difficult because every post adjusts the height of the one below it, and this cascades infinitely until the end. It’ll never be perfect. Compare with scrolling down.

I’m not following your request on the Back button – that’s your furthest read point in the topic. So if you scroll up (and your current read position is not already at the end of the topic), it will always appear.

  1. replying to a post before you have read the entire topic… well, that’s a penalty for a reason. We’re trying to discourage that behavior, not encourage it. I believe there us a user preference to NOT take you to your post after replying, you might try enabling that if you find yourself uncontrollably replying without reading the topic in full first :wink:

    and

  2. following a link from your notifications, that will move your read position to the target post in the topic. We’re not in the business of tracking “reading holes” in a topic, where you’ve read posts 44-48 but you have not read posts 35-43, and you have read posts 34-20 but you have not read posts 14-19, etc. There’s just one reading position we track, the lowest and furthest point that you’ve read to in the topic.

I don’t know if I can reproduce on a thread that uses no images whatsoever, as long threads like that are rare. Most people will at least use the link preview boxes if nothing else. And I can’t make my own, as Discourse limits the number of times you can post to a thread in a row and in a short period.

That said, the whole point of the fix you implemented was that it was supposed to eliminate the problem with images. If you have the size information of the images, then you can include that in the <img>tag, and the browser will leave a placeholder gap until the image loads. So that should make it work just as well for Topics with images and Topics without.

I’m not asking for scrolling up to be perfect. I’m asking for it to at least as functional as it is on every other site I’ve ever used online, including Discourse’s competitors. It’s acceptable if there’s some jank, but scrolling up should never cause there to be content that never shows on the screen. It’s a great way to make it where people don’t see posts, disrupting conversation. There just should be a way to scroll up and be sure that you don’t miss any posts as you do so. Currently, there does not appear to be.

Hence my drive to get this fixed. It’s not only good for me, but it’s good for Discourse. Since the problem doesn’t occur on most websites, people will assume the fault is with Discourse. Based on my experience as a bug reporter, it seems that a lot of web design involves working around browser quirks.

(Though, yes, HTML5 should have a way to lock the apparent viewport position while adding content above the viewport. It would be great if a well-known, prominent web developer such as yourself would make a recommendation to the HTML5 ongoing standards committee.)


As for my requests:

My first request is exactly what you described. I would like it if the system did not jump me down to my post after I reply. I cannot find the option you mentioned in my preferences. Could you confirm if you see it?

(And, no, my reason for replying is not due to impatience. There are plenty of situations where it is useful if not required to reply to a post before you’ve read the entire Topic. However, discussing this would require its own Topic. All I will say is that I think you will find that most posters will do this at least some of the time.)

The other request is for notification links. I’ll write it out like I would a bug report:

Steps to reproduce:

  1. Leave a post in a Topic.
  2. Wait until other posts have been made.
  3. Have someone else quote or reply to your post, or use the @user feature in a post in that Topic.
  4. Receive a notification.
  5. Click the link provided in the notification to read the reply.

Expected behavior:

  • The software will take me straight to the reply, but will also provide a link to take me back to my most recently read post in the Topic. That way, I can catch up on what I missed.

Actual behavior:

  • The software takes me straight to the reply, but I have to then scroll up to get back to my most recently read post in the thread.

And the above are the main two reasons that I wind up needing to scroll up more than 10 posts. Both are due to things the Discourse software does.

And, after that long winded post, I found one:

I do note they have oneboxes, but those should be a fixed size.

For whatever it’s worth, I see this behavior in chrome on a Chromebook, but not in Firefox on a Linux machine.

Even when looking at the same threads.

@Tatterdemalion I’ve long suspected it’s something to do with the way Chrome tries to intelligently detect scrolling.

Despite everything else that’s wrong with the site on Android Firefox, the scrolling has always worked fine.

Great! Thank you for this detailed set of steps, it is very helpful. I’ll refer this to our community team to triage.

Hey @BigT :wave: I’m on the Discourse Community Team. I just want to make sure I understand. The quote below is actually feature request, not a bug report? I just want to make sure i’m not trying to reproduce a bug on something that doesn’t exist yet :slight_smile:

Yes, what you quoted is technically a feature request. I just wrote it out formally like I would if I were submitting it to, say, Bugzilla.

My goal is to eliminate the need to scroll up so often, which can be glitchy.

Thanks for the clarification! We’ll certainly keep your suggestion in mind :+1: