Page MenuHomePhabricator

Set up feature flag and menu for night mode on desktop
Closed, ResolvedPublic3 Estimated Story Points

Description

Background & User story

Why are we doing this ticket?

  • This ticket will be used to set up the feature flag for night mode on desktop. The feature flag will help us and other teams with testing the feature in a production environment

How does it connect to our overall plans? What goal does it link to?

  • See task tree

What previous/central documentation exists?

User Stories

As a WMF or community member, I would like the ability to test the current version of night mode so that it's easier for me to report and fix issues

Requirements

<Note: this mock is outdated and only for reference>

  • Selecting night mode will turn night mode on

Acceptance criteria

  • All product and design requirements above must be complete
  • Client preferences should appear in the order: Font size, color, width <Not done: T357707 is follow up ticket>
  • The new option should be "Color" and the options "Day" and "Night"
  • Can be enabled by feature flag ?vectodarkmode=1

Developer checklist

  • When the feature flag is disabled, the class skin-darkmode-clientpref-0 is present on the HTML element in addition to (vector|minerva)-feature-night-mode-disabled
  • When the feature flag is enabled, but the user has opted out of night mode, the class skin-darkmode-clientpref-0 should be present on the HTML element.
  • When the feature flag is enabled, but the user has opted into night mode, the class skin-darkmode-clientpref-1 should be present on the HTML element.
  • When the feature flag is enabled, and the user has opted into "automatic" mode, the class skin-darkmode-clientpref-2 should be present on the HTML element.
  • The feature flag should be associated with a user preference

QA steps

  • When the feature flag is disabled the item should NOT show up in the menu and there should be no change in appearance regardless of whether you have enabled night mode at the operating system level.

Note: Since the feature flag is disabled, QA for steps other than the first are blocked on T356074 and requires coordinating a test environment with a developer

  • The default is light mode for anonymous users
  • The default is light mode for logged in users
  • When the feature flag is enabled a night mode option should show up in the accessibility menu (under the goggles)
  • When night mode is selected, certain parts of the UI should reflect a darker color theme. Note: not all UI is expected to be in night mode at this point so look for any indication that a night mode has been enabled.
  • When auto mode is selected, night mode is enabled when configured at the operating system level.
  • When light mode is selected, I should get the default experience.
  • The controls work for anonymous users and logged in users
  • Changing the user preference should only impact the Vector skin. It should not impact the equivalent setting on the mobile skin.

Signoff criteria

QA Results - Beta

QA Results - Prod

Event Timeline

Jdlrobson set the point value for this task to 3.

Change 994832 had a related patch set uploaded (by Bernard Wang; author: Bernard Wang):

[mediawiki/skins/Vector@master] Add Vector night mode feature flag

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

bwang removed bwang as the assignee of this task.Jan 31 2024, 9:35 PM
bwang moved this task from Doing to Code Review on the Web-Team-Backlog (FY2023-24 Q3 Sprint 2) board.
bwang subscribed.

Change 994832 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Add Vector night mode feature flag

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

Edtadros subscribed.

Test Result - Beta

Status: ❌ FAIL
Environment: beta
OS: macOS Sonoma
Browser: Chrome
Device: MBA
Emulated Device:NA

Test Artifact(s):

QA Steps

✅ AC1: When the feature flag is disabled the item should NOT show up in the menu and there should be no change in appearance regardless of whether you have enabled night mode at the operating system level.

screenshot 442.png (479×1 px, 152 KB)

✅ AC2: The default is light mode for anonymous users

screenshot 443.png (545×1 px, 165 KB)

✅ AC3: The default is light mode for logged in users

screenshot 444.png (468×1 px, 126 KB)

✅ AC4: When the feature flag is enabled a night mode option should show up in the accessibility menu (under the goggles)

screenshot 445.png (565×1 px, 142 KB)

❓ AC5: When night mode is selected, certain parts of the UI should reflect a darker color theme. Note: not all UI is expected to be in night mode at this point so look for any indication that a night mode has been enabled.
The UI didn't change, but this is visible in the page source

screenshot 449.png (576×1 px, 161 KB)

screenshot 451.png (551×1 px, 148 KB)

screenshot 450.png (547×1 px, 148 KB)

❌ AC6: When auto mode is selected, night mode is enabled when configured at the operating system level.
I couldn't get the UI to change with any combination of URL params or theme menu selection

⬜ AC7: When light mode is selected, I should get the default experience.
❌ AC8: The controls work for anonymous users and logged in users
Controls do not appear for anon, and I can't get them to work logged in
⬜ AC9: Changing the user preference should only impact the Vector skin. It should not impact the equivalent setting on the mobile skin.
can't verify unless AC5-8 are functioning.

Sorry these QA steps were not good. Currently there is no visual effect in Vector. When testing night mode on Vector you'll have to check the classes on HTML element: skin-night-mode-clientpref-1 = ON, skin-night-mode-clientpref-2 = automatic, skin-night-mode-clientpref-3 = OFF

The query string is http://en.wikipedia.org/wiki/Spain?vectornightmode=1 or http://en.wikipedia.org/wiki/Spain?vectornightmode=2 or http://en.wikipedia.org/wiki/Spain?vectornightmode=0
I think if you could just confirm the settings are displaying and corresponding to the value in the query string that should be enough for a pass for now. I think developers have already confirmed the classes on the HTML element.

Test Result - Beta

Status: ✅ PASS
Environment: beta
OS: macOS Sonoma
Browser: Chrome
Device: MBA
Emulated Device:NA

Test Artifact(s):

QA Steps

✅ AC1: When the feature flag is disabled the item should NOT show up in the menu and there should be no change in appearance regardless of whether you have enabled night mode at the operating system level.
See the same AC in T355065#9530810.

✅ AC2: The default is light mode for anonymous users
See the same AC in T355065#9530810.

✅ AC3: The default is light mode for logged in users
See the same AC in T355065#9530810.

✅ AC4: When the feature flag is enabled a night mode option should show up in the accessibility menu (under the goggles)
See the same AC in T355065#9530810.

✅ AC5: When night mode is selected, certain parts of the UI should reflect a darker color theme. Note: not all UI is expected to be in night mode at this point so look for any indication that a night mode has been enabled.
See the same AC in T355065#9530810.

per T355065#9530826 the verification by the devs is sufficient for the remaining ACs
⬜ AC6: When auto mode is selected, night mode is enabled when configured at the operating system level.
⬜ AC7: When light mode is selected, I should get the default experience.
⬜ AC8: The controls work for anonymous users and logged in users
⬜ AC9: Changing the user preference should only impact the Vector skin. It should not impact the equivalent setting on the mobile skin.

When going through the developer checklist I identified a bug: https://phabricator.wikimedia.org/T357329

Test Result - Prod

Status: ✅ PASS
Environment: enwiki
OS: macOS Sonoma
Browser: Chrome
Device: MBA
Emulated Device:NA

Test Artifact(s):

QA Steps

✅ AC1: When the feature flag is disabled the item should NOT show up in the menu and there should be no change in appearance regardless of whether you have enabled night mode at the operating system level.

screenshot 511.png (607×1 px, 295 KB)

✅ AC2: The default is light mode for anonymous users

screenshot 512.png (694×947 px, 259 KB)

✅ AC3: The default is light mode for logged in users
See AC1.

✅ AC4: When the feature flag is enabled a night mode option should show up in the accessibility menu (under the goggles)

screenshot 514.png (843×1 px, 406 KB)

✅ AC5: When night mode is selected, certain parts of the UI should reflect a darker color theme. Note: not all UI is expected to be in night mode at this point so look for any indication that a night mode has been enabled.

screenshot 515.png (898×1 px, 424 KB)

per T355065#9530826 the verification by the devs is sufficient for the remaining ACs
⬜ AC6: When auto mode is selected, night mode is enabled when configured at the operating system level.
⬜ AC7: When light mode is selected, I should get the default experience.
⬜ AC8: The controls work for anonymous users and logged in users
⬜ AC9: Changing the user preference should only impact the Vector skin. It should not impact the equivalent setting on the mobile skin.