Page MenuHomePhabricator

Show a toast notification on page load for night mode when the setting doesn't take effect in Minerva
Closed, ResolvedPublic2 Estimated Story Points

Description

NOTE: Follow up work to T355705

In Minerva, the settings don't appear in-context on an article page. The settings are a full page on their own. As a result, we need to give system feedback when a user visits a relevant page, and we don't need the explainer text in the settings themselves.

We should show a "toast" when a user visits a page where the night mode setting (T355705).

Frame 427318204.png (844×360 px, 94 KB)

QA

As a logged in user

  • On Special:MobileOptions select night mode and visit a page where night mode has been disabled

Expected: I see a notification.

  • On Special:MobileOptions select automatic mode, and select night mode in your operating system settings and visit a page where night mode has been disabled

Expected: I see a notification.

  • On Special:MobileOptions select automatic mode, and select day mode in your operating system settings and visit a page where night mode has been disabled

Expected: I see NO notification.

  • On Special:MobileOptions select day mode and visit a page where night mode has been disabled

Expected: I see NO notification.

Expected: I see NO notification and theme is night mode.

Repeat the above for an anonymous user.

Developer notes

  • Detect the page was disabled e.g. check HTML element for a class
  • Call mw.notify when the class is detected.

QA Results - Beta (patchdemo)

QA Results - Prod

Event Timeline

Jdlrobson renamed this task from Show a toast notification on page load when an appearance setting doesn't take effect in Minerva to Show a toast notification on page load for night mode when the setting doesn't take effect in Minerva.Feb 8 2024, 12:40 AM
Jdlrobson updated the task description. (Show Details)

Justin: I revised this to just be for night mode. When we work on the follow up to T356653 we can make sure this is added as acceptance criteria.

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

[mediawiki/skins/MinervaNeue@master] Add a class to the page where night mode setting was overriden

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

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

[mediawiki/skins/MinervaNeue@master] Send a toast notification if night mode is not available

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

Change 999117 abandoned by Jdlrobson:

[mediawiki/skins/MinervaNeue@master] Add a class to the page where night mode setting was overriden

Reason:

See https://gerrit.wikimedia.org/r/c/mediawiki/skins/MinervaNeue/+/1003116?usp=search

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

Change 1003116 merged by jenkins-bot:

[mediawiki/skins/MinervaNeue@master] Send a toast notification if night mode is not available

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

Jdlrobson updated the task description. (Show Details)
Jdlrobson added a subscriber: SToyofuku-WMF.
Edtadros subscribed.

Test Result - Beta

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

Test Artifact(s):

QA Steps

Go to https://patchdemo.wmflabs.org/wikis/81314f1b10/wiki/Special:Random/talk
As a logged in user

On Special:MobileOptions select night mode and visit a page where night mode has been disabled
✅ AC1: Expected: I see a notification.

Logged InLogged Out
screenshot 266.mov.gif (854×394 px, 217 KB)
screenshot 271.mov.gif (1×512 px, 164 KB)

On Special:MobileOptions select automatic mode, and select night mode in your operating system settings and visit a page where night mode has been disabled
✅ AC2: Expected: I see a notification.

Logged InLogged Out
screenshot 267.mov.gif (1×512 px, 535 KB)
screenshot 272.mov.gif (1×512 px, 430 KB)

On Special:MobileOptions select automatic mode, and select day mode in your operating system settings and visit a page where night mode has been disabled
✅ AC3: Expected: I see NO notification.

Logged InLogged Out
screenshot 268.mov.gif (1×512 px, 501 KB)
screenshot 273.mov.gif (1×512 px, 443 KB)

On Special:MobileOptions select day mode and visit a page where night mode has been disabled
✅ AC4: Expected: I see NO notification.

Logged InLogged Out
screenshot 269.mov.gif (1×512 px, 405 KB)
screenshot 273.mov.gif (1×512 px, 443 KB)

With night mode enabled go to to https://patchdemo.wmflabs.org/wikis/81314f1b10/wiki/New_York
✅ AC5: Expected: I see NO notification and theme is night mode.

Logged InLogged Out
screenshot 270.mov.gif (1×512 px, 300 KB)
screenshot 274.mov.gif (926×512 px, 254 KB)

Looks good, resolving

Test Result - Prod

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

Test Artifact(s):

QA Steps

Go to https://patchdemo.wmflabs.org/wikis/81314f1b10/wiki/Special:Random/talk
As a logged in user

On Special:MobileOptions select night mode and visit a page where night mode has been disabled
✅ AC1: Expected: I see a notification.

Logged InLogged Out
screenshot 289.mov.gif (844×388 px, 367 KB)
screenshot 284.mov.gif (848×394 px, 400 KB)

On Special:MobileOptions select automatic mode, and select night mode in your operating system settings and visit a page where night mode has been disabled
✅ AC2: Expected: I see a notification.

Logged InLogged Out
screenshot 290.mov.gif (1×476 px, 646 KB)
screenshot 285.mov.gif (1×462 px, 610 KB)

On Special:MobileOptions select automatic mode, and select day mode in your operating system settings and visit a page where night mode has been disabled
✅ AC3: Expected: I see NO notification.

Logged InLogged Out
screenshot 291.mov.gif (1×476 px, 900 KB)
screenshot 286.mov.gif (1×462 px, 611 KB)

On Special:MobileOptions select day mode and visit a page where night mode has been disabled
✅ AC4: Expected: I see NO notification.

Logged InLogged Out
screenshot 292.mov.gif (844×390 px, 434 KB)
screenshot 287.mov.gif (848×388 px, 324 KB)

With night mode enabled go to a page with night mode NOT dispabled
✅ AC5: Expected: I see NO notification and theme is night mode.

Logged InLogged Out
screenshot 293.mov.gif (844×390 px, 369 KB)
screenshot 288.mov.gif (848×388 px, 405 KB)