Slow loading times for a topic's title

Continuing the discussion from Can I add a loading image like slack has while the app is loading?:

I’ve seen this behavior a number of times recently, it’s kind of ironic that the topic I clicked on which ended up prompting me to stop & start a topic is one about slow load times.

The issue at hand is that when I’m on a Topic A and client on a link at the bottom to Topic B, both the URL in my browser (chrome on mac) and the window’s title change quickly, but the topic title doesn’t change until after more of the page loads.

I’ve seen this here on meta more than anywhere else. Outside of making pages load faster, I wonder if the updating of the title itself should get prioritized?

6 Likes

I really like this observation, we can certainly re-render the header right away on click.

@eviltrout maybe have a look at it.

Repro is visiting a topic, clicking on a suggested topic. The expectation is that the header would re-render right away with the new title / category and so on. Instead you see the spinner and old title.

5 Likes

Sure I support this if it is easy, seems like a nice change.

This is more complicated than you might think.

The suggested topics list is done with raw handlebars, so each link is just a regular link that is run through our router. We know the URL to update right away because it comes from the link, but we don’t have the data object to use for the title / category.

(If it was a regular handlebars template we’d have an easy reference to the object for updating instantly like that.)

7 Likes

In that case, blanking out the title might actually look better than keeping the old title?

Keeping the old title is weird in some way, the title simply being removed together with the content of the page seems pretty consistent to me :slight_smile:

6 Likes

Sure let’s go with that @eviltrout, removal, since that has to be easy, I hope?

3 Likes

I think we have a component per row and it has the backing topic, it handles the click. Can it be extended to sort this out @eviltrout? (components/topic-list-item.js.es6)?

1 Like

Isn’t it always the way that simple appearing things are always more complicated? There were a lot of edge cases due to the topic title not always being visible, and it depending on a “loaded” state.

It took a while, but I think I managed to make our application a lot smarter about showing topic titles when navigating to them from topic lists.

https://github.com/discourse/discourse/commit/6f230945c2fe05036ee9d4d4e129bdb6105f64b4

and

https://github.com/discourse/discourse/commit/d1614220022311501e926632343f695e865d6ef2

13 Likes