Page MenuHomePhabricator

Add loading state for language switcher
Open, MediumPublicSpike

Description

Description

Per T282420 we've decided that if javascript has started to load (and therefore ULS will eventually load) we should show a loading message that:

  • communicates that something is trying to load
  • (ideally) provides an option to switch to the "basic HTML" version of the language switcher

Basic design
(riffing off what Gmail does when it's loading):

image.png (255×360 px, 12 KB)

Notes

There is a separate situation where someone has opened the language menu before javascript has started to load, then javascript loads which means the more feature-rich version of the language switcher (i.e. the ULS) is available to them. This case seems less important to address, however we've got a mockup in case it's something we decide we want to work on:

image.png (564×360 px, 18 KB)

Event Timeline

alexhollender_WMF renamed this task from Add loading state for ULS to Add loading state for language switcher.Jun 24 2021, 5:08 PM
alexhollender_WMF triaged this task as Medium priority.
alexhollender_WMF created this task.

(ideally) provides an option to switch to the "basic HTML" version of the language switcher

I can see some benefits with the proposed approach, but I wonder if this makes more sense as a more general strategy (a basic HTML version for the whole app rather than for specific pieces). Do we expect all different controls (from search auto-completion to media viewing) that rely on Javascript to be showing the same kind of alternatives? That may be adding noise to the overall experience.

Javascript is an integral part of HTML. I think the no-JS makes not much more sense than supporting the non-CSS experience. I do agree that performance is important, and we should support slow internet connections. So I think it makes sense to make the language menu more performant first. The work on the new language menu (T253303) is a good opportunity for that.

There is a separate situation where someone has opened the language menu before javascript has started to load

For this scenario would be interesting to think if the no-js menu could look like the JS one and do the switch when the user clicks on the search bar. That would make the transition more seamless. Along those lines, one consideration for the new language menu is how to distribute the loading of Javascript. That is, would it make sense to load a minimal set of resources to guarantee that the menu renders first and keep loading more capabilities later to take advantage of the time between the user opening the menu and starting to type? (cc @santhosh)