Page MenuHomePhabricator

Create skeleton for Dark Mode extension
Closed, ResolvedPublic3 Estimated Story Points

Description

Just the basics, while we wait for the CSS and toggling interface to be ironed out.

Event Timeline

Change 506933 had a related patch set uploaded (by MusikAnimal; owner: MusikAnimal):
[mediawiki/extensions/DarkMode@master] [WIP] Initial commit for DarkMode extension

https://gerrit.wikimedia.org/r/506933

The only actual visible change made is to add a "Dark mode" link to the personal toolbar. This is just a placeholder.

I have no idea how to put this into the CI pipeline.

Change 506934 had a related patch set uploaded (by Samwilson; owner: Samwilson):
[integration/config@master] [DarkMode] Add new extension

https://gerrit.wikimedia.org/r/506934

Is it planned that there will be a query string toggle for this, e.g. ?usedarkmode=1 or something? Because if it's a JS-only feature then maybe the link should be added by the resource module and not in PHP.

I've created https://gerrit.wikimedia.org/r/c/integration/config/+/506934 to add the CI config.

Is it planned that there will be a query string toggle for this, e.g. ?usedarkmode=1 or something? Because if it's a JS-only feature then maybe the link should be added by the resource module and not in PHP.

Yes I believe we'll want to support a toggling via query string. I only used PHP here because using only JS to manipulate the DOM would cause the links before it in the toolbar to "jump" on page load. I was following Extension:Echo's lead. The design hasn't been finalized anyway... maybe I should just remove the PHP for now?

I've created https://gerrit.wikimedia.org/r/c/integration/config/+/506934 to add the CI config.

Thank you!

Oh cool. No, I reckon leave it in PHP then.

MusikAnimal moved this task from Needs Review/Feedback to Done on the Community-Tech-Sprint board.

Merged! There's nothing to QA yet, or anything product can see, so closing as resolved.

Change 506934 merged by jenkins-bot:
[integration/config@master] [DarkMode] Add new extension

https://gerrit.wikimedia.org/r/506934

Is it planned that there will be a query string toggle for this, e.g. ?usedarkmode=1 or something? Because if it's a JS-only feature then maybe the link should be added by the resource module and not in PHP.

Yes I believe we'll want to support a toggling via query string. I only used PHP here because using only JS to manipulate the DOM would cause the links before it in the toolbar to "jump" on page load. I was following Extension:Echo's lead. The design hasn't been finalized anyway... maybe I should just remove the PHP for now?

We should have the toggle in both PHP and JS, similar to all the other toggles we have, like ?uselang= and ?useskin=.

We can have a hidden preference per user about whether they are using darkmode. That preference will be toggled (permanently) through clicking the toggle interface Alex will create, and toggled temporarily (so "overridden") by a URL param, something like ?usedarkmode=1. This is the same behavior we use for all our toggles, from language to skins to RCFilters' definitions,

We shouldn't wait, as a rule, for the JS to toggle the view, because then the styles will "flash". The check about whether the preference is on or not (and for logged out users, if we go with that, a cookie is set or not) should happen on the server.

This ticket is about setting up the "raw" stuff of an extension, so I've created this ticket for the basics of how it works: T222470: DarkMode: Create a mechanism to activate dark mode within the extension Please look at adjust/add/change if needed!

@MusikAnimal Are we using this ticket to add the initial files (+ linting + folder structure + tests / grunt, etc) for the extension or do you want to use the other ticket to do that?

(You can use the generator and adjust it, it should be straight forward either for this ticket (and then add-on in the other) or do it for the other ticket... I am just not sure what you want to do for process' sake)

Change 506933 merged by jenkins-bot:
[mediawiki/extensions/DarkMode@master] Initial draft for DarkMode extension

https://gerrit.wikimedia.org/r/506933

This is all done as far as I can see.

MusikAnimal moved this task from QA to Done on the Community-Tech-Sprint board.

Nothing to QA yet. That should happen sometime after T222470