Page MenuHomePhabricator

Test what Dark Mode looks like for logged-out users
Closed, DeclinedPublic

Description

What to do

Find a way for the team to see what the Dark Mode extension will look like if we make it available to logged out users. Because pages are served to these users from cache, it's likely pages will flash from bright to dak. How bad is that flash?

Why we're doing this

The Wish that inspired Dark mode specifically requests that it be made available for logged out users. We're concerned, however, that the cache-flash could be significant and that the feature therefore won't meet our standards for basic usability/quality. Before we decide that we can't offer this feature to logged out users, however, we want to see it and get a feel for how bad it is.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Because pages are served to these users from cache, it's likely pages will flash from bright to dak. How bad is that flash?

I assume we will check the cookie server-side, and the .darkmode class will already be on the <html> element by the time the page loads. So, no flashes :) Maybe I'm missing something, though.

The problem with flashing will be Varnish; logged-out users "skip" our PHP servers because they're served from cache. That's why most pages will "flash" to them.

There are tentative workarounds for this, but they're all a bit (quite a bit) meh, we should discuss what we can do and potentially talk to ops and performance about how to make this better. That said, for the moment, we should try and see how "bad" things are.

Since the problem is from our cache, putting this code in our private wiki won't really demonstrate the issue. We should test this in production; we can do that after we deploy the extension. Activate it only on testwiki first, and use the ?usedarkmode=1 for logged-out users (this should act just like the cookie existing anyways). We'll have to see if testwiki is good enough for us to test, though, since I doubt it has that much cached since it's barely being hit by visits. Maybe we'll have to test this while the extension is on beta.

For now, let's do T222470: DarkMode: Create a mechanism to activate dark mode within the extension as if logged out users are served properly, and we'll try to see how to test this experience (somewhere with Varnish) when we're ready to deploy the extension.

This extension will not be deployed to WMF cluster. A cookie-based solution to toggle dark mode for logged out users should be made into a new task, with the caveat that it doesn't work for installations with full page caching like Varnish.