Page MenuHomePhabricator

Prepare Special:Homepage for night mode
Closed, ResolvedPublicBUG REPORT

Description

Background

Following work in adopting CSS variables, the Growth home page has a few issues due to backgrounds being defined without colors that we will need to fix.

User story

As a reader visiting the Growth homepage, I want to see it in the night theme.

Derived Requirement

Prepare the Special for night mode in the Minerva skin, ensuring that all UI elements are displayed correctly with appropriate dark-themed styling.

BDD

Feature: Night Mode on Special:Homepage

Scenario: Display Special:Homepage correctly in night mode

Given the user is using night mode in Special:Homepage
When the user navigates to Special:Homepage
Then all UI elements should be displayed correctly with appropriate dark-themed styling

Test Steps

Open https://en.m.wikipedia.beta.wmflabs.org/w/index.php?title=Special:Homepage&minervanightmode=1&namespace=0 and navigate to Special.
Enable night mode.
AC1: Confirm that all UI elements are displayed correctly with appropriate dark-themed styling.
AC2: click "see all suggestions", the overlay has no color contrast issues, and images look identical to day theme
AC3: visit https://en.m.wikipedia.org/wiki/Special:Homepage#/homepage/suggested-edits and click "Easy" an OOUI dialog pops up. Should also have no accessibility issues.

NOTE: During QA please note any color contrast issues, but these should not be considered a fail.

Acceptance criteria

  • The page on page load on desktop, should not have any color contrast issues when using the WCAG Contrast checker
  • When I visit the page on desktop, all images should appear the same as in the light theme.
  • When I switch to mobile, and click "see all suggestions", the overlay has no color contrast issues, and images look identical to day theme.
  • When I visit https://en.m.wikipedia.org/wiki/Special:Homepage#/homepage/suggested-edits and click "Easy" an OOUI dialog pops up. Should also have no accessibility issues.

Communication criteria - does this need an announcement or discussion?

N/A

Rollback plan

This is behind a feature flag so can be enabled/disabled easily as needed.

More information

beta enwiki with minervanightmode=1testwiki wmf.19 with the dark mode gadget enabbled
Screen Shot 2024-02-23 at 3.56.32 PM.png (1×850 px, 151 KB)
Screen Shot 2024-02-23 at 4.06.25 PM.png (1×628 px, 126 KB)
many controls are not visible
Screen Shot 2024-02-23 at 3.56.49 PM.png (1×640 px, 94 KB)
Screen Shot 2024-02-23 at 3.57.15 PM.png (1×638 px, 292 KB)
filter selection
Screen Shot 2024-02-23 at 4.09.24 PM.png (1×610 px, 117 KB)
Screen Shot 2024-02-23 at 4.10.20 PM.png (1×632 px, 100 KB)
Screen Shot 2024-02-23 at 3.58.00 PM.png (1×632 px, 162 KB)
Screen Shot 2024-02-23 at 4.10.43 PM.png (1×628 px, 176 KB)
intro
Screen Shot 2024-02-23 at 4.14.12 PM.png (1×642 px, 67 KB)
Screen Shot 2024-02-23 at 3.57.23 PM.png (1×650 px, 114 KB)

Compatibility issues in the new night mode will arrive when colors outside the standard palette provided by Codex have been used. We recommend teams make use of Codex design tokens where possible and where not possible make sure they always set a background and color rather than assume that text will be #333. As a last resort the skin-invert class can be added temporarily to the element to trigger a CSS filter. The intention is to remove this later on, so this should only be used by teams to buy themselves an extra 3 months to take care of updating their code.

Sign off steps

  • Capture any color contrast issues in T367986

This task was created by Version 1.0.0 of the Web team task template using phabulous

QA Results - Beta

ACStatusDetails
1T357699#9935450
2T357699#9935450
3T357699#9935450

QA Results - Prod

ACStatusDetails
1T357699#9971714
2T357699#9971714
3T357699#9971714

Related Objects

StatusSubtypeAssignedTask
ResolvedDTorsani-WMF
Resolvedegardner
Resolvedovasileva
Resolvedovasileva
Resolvedovasileva
ResolvedJdlrobson
Resolvedovasileva
Resolvedovasileva
ResolvedJScherer-WMF
Resolvedovasileva
ResolvedSpikeSToyofuku-WMF
Resolvedovasileva
Resolvedovasileva
ResolvedJdlrobson
Resolvedovasileva
ResolvedBUG REPORTJdlrobson
ResolvedBUG REPORTJScherer-WMF
ResolvedJdlrobson
DuplicateFeatureNone
ResolvedSpikeJdlrobson
ResolvedJdlrobson
Resolvedovasileva
ResolvedFeatureJdlrobson
DuplicateNone
ResolvedJdlrobson
Resolvedovasileva
DuplicateJdlrobson
ResolvedJdlrobson
DuplicateNone
ResolvedJdlrobson
ResolvedBUG REPORTovasileva
Resolvedovasileva
ResolvedVolker_E
InvalidNone
InvalidJdlrobson
DuplicateNone
DuplicateNone
DuplicateNone
DuplicateNone
Resolvedovasileva
ResolvedJdlrobson
ResolvedJdlrobson
ResolvedJdlrobson
ResolvedJdlrobson
DuplicateJdlrobson
ResolvedJdlrobson
ResolvedJdlrobson
DeclinedJdlrobson
ResolvedSToyofuku-WMF
ResolvedJdlrobson
ResolvedKSarabia-WMF
ResolvedNone
OpenNone
Resolvedovasileva
ResolvedJdlrobson
ResolvedBUG REPORTJdlrobson
DuplicateBUG REPORTNone
ResolvedBUG REPORTovasileva
Openovasileva
ResolvedBUG REPORTovasileva
ResolvedBUG REPORTabi_
ResolvedBUG REPORTNikerabbit
ResolvedBUG REPORTovasileva
ResolvedJdlrobson
ResolvedBUG REPORTJdlrobson
Resolvedovasileva
Resolvedovasileva
Resolvedovasileva
Resolvedovasileva
Resolvedovasileva
ResolvedFeatureNone
OpenNone
Resolvedovasileva
Resolvedovasileva
Resolvedovasileva
Resolvedovasileva
Resolvedovasileva
Resolvedovasileva
ResolvedBUG REPORTovasileva
ResolvedJdlrobson
ResolvedJdlrobson
ResolvedNone
ResolvedJdrewniak
Resolvedovasileva
ResolvedBUG REPORTovasileva
Resolvedovasileva
Resolvedovasileva
ResolvedJdlrobson
ResolvedJdlrobson
Resolvedovasileva
ResolvedJdrewniak
ResolvedJScherer-WMF
Resolvedovasileva
Resolvedovasileva
ResolvedBUG REPORTovasileva
ResolvedBUG REPORTovasileva
ResolvedJdlrobson
Resolvedovasileva
OpenNone
ResolvedBUG REPORTJdlrobson
ResolvedAnneT
ResolvedBUG REPORTJdlrobson

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Jdlrobson lowered the priority of this task from High to Medium.Feb 28 2024, 6:57 PM
Jdlrobson lowered the priority of this task from Medium to Low.Mar 11 2024, 9:15 PM

This page has been configured to always show in day mode as part of T359183, so this is now less of a priority.

Change #1031495 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[operations/mediawiki-config@master] Enable night mode on Vector on testwiki, disable on Special:Homepage

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

Change #1031495 merged by jenkins-bot:

[operations/mediawiki-config@master] Enable night mode on Vector on testwiki, disable on Special:Homepage

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

Mentioned in SAL (#wikimedia-operations) [2024-05-14T20:05:54Z] <cjming@deploy1002> Started scap: Backport for [[gerrit:1031495|Enable night mode on Vector on testwiki, disable on Special:Homepage (T357699 T363814)]]

Mentioned in SAL (#wikimedia-operations) [2024-05-14T20:08:34Z] <cjming@deploy1002> jdlrobson and cjming: Backport for [[gerrit:1031495|Enable night mode on Vector on testwiki, disable on Special:Homepage (T357699 T363814)]] synced to the testservers (https://wikitech.wikimedia.org/wiki/Mwdebug)

Mentioned in SAL (#wikimedia-operations) [2024-05-14T20:24:34Z] <cjming@deploy1002> Finished scap: Backport for [[gerrit:1031495|Enable night mode on Vector on testwiki, disable on Special:Homepage (T357699 T363814)]] (duration: 18m 40s)

Jdlrobson raised the priority of this task from Low to High.Jun 13 2024, 1:23 AM

I see two options here:

Option 1: Inverting content area with accessibility issues introduced

Adding skin-invert notheme to div.growthexperiments-homepage-container` and overlay growthexperiments-homepage-container.homepage-module-overlay makes the page look like it has a dark theme. We would need to uninvert any images that appear in that interface.

However... there is a big downside - it introduces accessibility issues into the desktop version of the page, that don't exist in light theme.

Screenshot 2024-06-13 at 12.04.52 PM.png (605×1 px, 313 KB)

Screenshot 2024-06-13 at 12.06.45 PM.png (347×946 px, 33 KB)

Screenshot 2024-06-13 at 12.08.41 PM.png (447×855 px, 99 KB)

Screenshot 2024-06-13 at 12.09.01 PM.png (459×806 px, 60 KB)

We could potentially fix this with additional CSS rules, which would be difficult given they would need to define new colors that can be inverted safely, but this would create technical debt for the Growth team.

Option 2: Using tokens

To get the page working without any accessibility issues, we are looking at a lot more work involving updating the tokens, however the end result would be accessible code. Most of these colors look like they would map to the existing color palette in Codex.

I think we can proceed with Option 1 and create a separate follow-up ticket for option 2 that we can loop the Growth team onto.

Change #1047177 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/extensions/GrowthExperiments@master] Enable dark mode via skin invert for Special:Homepage

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

Sgs subscribed.

I think we can proceed with Option 1 and create a separate follow-up ticket for option 2 that we can loop the Growth team onto.

Filed as T367986.

Change #1047177 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Enable dark mode via skin invert for Special:Homepage

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

Change #1048061 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/extensions/GrowthExperiments@master] Improve dark mode on Growth homepage

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

I keep finding contrast issues and issues in general in GrowthExperiments interfaces, an example of that is the "help panel" and the "onboarding dialogs". At this point I don't know how many notheme skin-invert more we would need to introduce to fix all growth features. Since the task is just in the scope of the homepage, my proposal would be that we fix the rest of Growth features with Option 2 (when possible) instead of Option 1? I'm adding known issues (as issues that exist without the skin-invert applied) in T367986, given the spread of background-colors around the extension modules, maybe it's easier to handle this by use case? cc @Jdlrobson @ovasileva @Etonkovidova

Change #1048061 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Improve dark mode on Growth homepage

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

Change #1048549 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/extensions/GrowthExperiments@master] Rotate hue of images

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

Just waiting for a review from Sergio and team on https://gerrit.wikimedia.org/r/1048549 - then this can move to QA.
T367986 is the long term fix for this, but is not a blocker for deployment of the new night theme.

Change #1048549 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Rotate hue of images

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

Change #1049975 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[operations/mediawiki-config@master] Enable special pages in dark mode (1.43.0-wmf.12)

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

Test Result - Beta

Status: ✅ PASS
Environment: Beta
OS: macOS Sonoma 14.5
Browser: Chrome 126
Device: MBA
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1:Display Special Correctly in Night Mode

✅ AC1: Confirm that all UI elements are displayed correctly with appropriate dark-themed styling.

2024-06-28_10-29-13.png (1×1 px, 143 KB)
2024-06-28_10-29-25.png (1×1 px, 137 KB)

✅ AC2: click "see all suggestions", the overlay has no color contrast issues, and images look identical to day theme

2024-06-28_10-28-52.mp4.gif (684×938 px, 220 KB)

✅ AC3: visit https://en.m.wikipedia.org/wiki/Special:Homepage#/homepage/suggested-edits and click "Easy" an OOUI dialog pops up. Should also have no accessibility issues.

2024-06-28_10-26-24.mp4.gif (880×706 px, 566 KB)

I keep finding contrast issues and issues in general in GrowthExperiments interfaces, an example of that is the "help panel" and the "onboarding dialogs". At this point I don't know how many notheme skin-invert more we would need to introduce to fix all growth features. Since the task is just in the scope of the homepage, my proposal would be that we fix the rest of Growth features with Option 2 (when possible) instead of Option 1? I'm adding known issues (as issues that exist without the skin-invert applied) in T367986, given the spread of background-colors around the extension modules, maybe it's easier to handle this by use case? cc @Jdlrobson @ovasileva @Etonkovidova

Ran a quick check (and keeping the scope of the task only to Special:Homepage) - all look good; adding only one small issue to this task :

<div class="suggested-edits-difficulty-indicator suggested-edits-difficulty-indicator-easy">Easy</div>
Screen Shot 2024-06-28 at 3.06.29 PM.png (1×854 px, 491 KB)

Change #1049975 abandoned by Jdlrobson:

[operations/mediawiki-config@master] Enable action edit/submit and remaining special pages in dark mode (1.43.0-wmf.12)

Reason:

Moved into https://gerrit.wikimedia.org/r/c/operations/mediawiki-config/+/1050671?usp=search

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

Jdlrobson claimed this task.

I'll enable this page in production on Thursday.

Test Result - Prod

Status: ✅ PASS
Environment: enwiki
OS: macOS Sonoma 14.5
Browser: Chrome 126
Device: MBS
Emulated Device: NA

Test Artifact(s):

Test Steps

Test Case 1:Display Special Correctly in Night Mode

✅ AC1: Confirm that all UI elements are displayed correctly with appropriate dark-themed styling.

screenshot 125.png (1×1 px, 239 KB)

✅ AC2: click "see all suggestions", the overlay has no color contrast issues, and images look identical to day theme

screenshot 129.png (1×1 px, 256 KB)
screenshot 128.png (1×1 px, 240 KB)

✅ AC3: visit https://en.m.wikipedia.org/wiki/Special:Homepage#/homepage/suggested-edits and click "Easy" an OOUI dialog pops up. Should also have no accessibility issues.

screenshot 130.png (1×1 px, 244 KB)

@Edtadros would you mind sharing the tool you use for contrast checking? I used FF accessibility tool in the past for non dark-mode related issues but it seems it does not work for our case since it does not pick up the font color has been inverted (that's my hypothesis).

Screenshot 2024-10-28 at 13.58.59.png (1×3 px, 831 KB)

@Edtadros would you mind sharing the tool you use for contrast checking? I used FF accessibility tool in the past for non dark-mode related issues but it seems it does not work for our case since it does not pick up the font color has been inverted (that's my hypothesis).

Screenshot 2024-10-28 at 13.58.59.png (1×3 px, 831 KB)

It's WCAG Color contrast checker. I found it's useful, especially when you need to see the list of elements with contrast ratio.
Re the issue you see with the tool not indicating the inverted font color - I re-checked, there is an indication of the low contrast, although not as extreme as FF Accessibility reports.

Screen Shot 2024-10-28 at 2.27.37 PM.png (1×3 px, 694 KB)

I re-ran some checks for Sepcial:Homepage in dark mode with different tools, i.e.

  • Chrome devtools Lighthouse
  • Chrome axe DevTools
  • Chrome CSS overview - reports 17 contrast issues

Screen Shot 2024-10-28 at 2.41.48 PM.png (566×2 px, 95 KB)

Although those different checks do not contradict each other, they report the contrast issues in different format and measure the color contrast somewhat differently. The question is - which tool is the most useful to supply unambiguous information to devs?

FF accessibility seems not an option at this point, using WCAG Color contrast checker is good enough for now. We're thinking of using something like cypress-axe to get some accessibility checks in CI.