Background
In T355705 we created additional configuration for Minerva to allow us to disable certain pages in night mode. In this ticket we will seek to do the same in the Vector 2022 skin.
Following T359607 we have identified how to approach this on the short term.
User story
As a reader, I want pages that are unreadable in night mode to appear in day mode, so that all parts of the page are readable
Requirements
- It must be possible for us to share configuration between Minerva and Vector skins. For example the configuration in Vector 2022 should be identical to -Minerva. e.g. $wgMinervaNightModeOptions = $wgVectorNightModeOptions
- We should minimize duplicated code. In future we may want to modify how this works, and do not want to maintain two versions of the same code.
- present the options to the team and the associated trade offs (google doc)
- Facilitate discussion either async in the document or in person
- Collect a consensus about how we want to approach this.
- Document decision in an decision record (ADR) in the patch.
- It is possible to disable night mode on certain pages using $wgVectorNightModeOptions = $wgMinervaNightModeOptions;
- The skin-night-mode-page-disabled class should be added to the HTML element on pages where night mode has been disabled.
QA steps
For Needs QA: Use https://en.wikipedia.beta.wmflabs.org/w/index.php?title=Banana&vectornightmode=1
For Verified : Use https://test.wikipedia.org/wiki/Banana?vectornightmode=1
- Visit desktop site
- Enable night mode.
- Go to Banana page.
Expected: The banana page appears in LIGHT mode.
- Open the edit page in a new window (right click)
- Click random
Expected: the page appears in night mode.
- Switch to the history page by clicking the last modified bar are the bottom of the article.
Expected: The history page appears in LIGHT mode.
- Click a diff.
Expected: The diff page appears in LIGHT mode.
Query string parameters
?vectornightmode=1 should force night mode on. This should work when night mode is disabled by default as well as when it is available in the beta feature sidebar panel.
?vectornightmode=2 should force operating system theme on. This should work when night mode is disabled by default as well as when it is available in the beta feature sidebar panel.