In the UX category, watchmanmonitor reported a UI inconsistency where clicking a link to a new topic updates the browser URL and window title immediately, but the Discourse header retains the old topic title until the page fully loads. sam agreed this is a poor user experience, suggesting the header should re-render instantly upon click. codinghorror supported the change if it were simple. However, eviltrout explained the complexity: suggested topics use raw Handlebars, meaning the application knows the new URL but lacks the data object required to update the title immediately without a full load. fefrei proposed blanking the title during the transition as a consistent alternative to showing the old one, a suggestion codinghorror endorsed. After sam queried if the specific component could be extended, eviltrout noted that while simple in appearance, the task involved significant edge cases regarding title visibility and load states. Ultimately, eviltrout implemented a fix to make the application smarter about displaying titles during navigation, referencing commits 6f23094 and d161422.
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?
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.
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.)
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)?
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.