Page MenuHomePhabricator

Vector query string is not behaving as expected
Closed, ResolvedPublic2 Estimated Story PointsBUG REPORT

Description

NOTE: This blocks us identifying bugs with templates in the desktop site.

Steps to replicate the issue (include links if applicable):

What happens?:
The skin-night-mode-clientpref-2 class is on the HTML element

What should have happened instead?:
The skin-night-mode-clientpref-1 class should be present on the HTML element

Software version (skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

QA Results - Beta

ACStatusDetails
1T357329#9552612

QA Results - Prod

ACStatusDetails
1T357329#9570864

Event Timeline

@SToyofuku-WMF I could have sworn we fixed this. Did something recently regress?

Jdlrobson updated the task description. (Show Details)
Jdlrobson set the point value for this task to 2.

This is expected behavior:
With &vectornightmode=0, you should see vector-feature-night-mode-disabled skin-night-mode-clientpref-0
With &vectornightmode=1, you should see vector-feature-night-mode-enabled skin-night-mode-clientpref-2

When the NightMode flag is on, the vector-feature-night-mode-enabled class is applied, and ability to customize the night mode is enabled (meaning the UI for changing night mode appears) . However, the actual night mode preference is separate, and controlled by the PrefNightMode flag, which is a user preference requirement and therefore doesnt have a query string T347900. The preference flag will output skin-night-mode-clientpref-2 when the night mode feature flag is enabled because "2" or "automatic" is the default for users

I think this ticket is a good example of why we should distinguish between the types of flags, i.e. config based flags and user preference flags. Right now we call everything a feature flag, which I think is a bit confusing

@bwang basically the query string should always override any user preference or configuration.This is a requirement for the color contrast checker (And something we already implemented in Minerva). I believe we broke this functionality when we worked on adding beta to the feature management system (which led to the related T347900)

The user story is:
There is a URL I can use that reliably switches the skin into night mode ie. add vector-feature-night-mode-disabled skin-night-mode-clientpref-1 to the HTML element.

The user story is:
There is a URL I can use that reliably switches the skin into night mode ie. add vector-feature-night-mode-disabled skin-night-mode-clientpref-1 to the HTML element.

Ok I see, I dont believe the feature management system in Vector currently supports having a single flag that handles both the config and the user preference requirements. A similar example in the past was page tools, we had a flag for the feature ?vectorpagetools=1, but that was independent of the page tools pinned flag, it never was able to override the user preference for if page tools was pinned or not.

IMO the nicest solution to this is to fix T347900, then the URL would be ?vectornightmode=1&vectorprefnightmode=1. However that might take too much time, so alternatively we could just hardcode this similar to Minerva. Probably in FeatureManager::getFeatureBodyClass

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

[mediawiki/skins/Vector@master] Fixes Vector query string behaviour

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

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

[mediawiki/skins/Vector@master] WIP: FeatureVariants

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

bwang removed bwang as the assignee of this task.Feb 15 2024, 5:02 PM
bwang subscribed.

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

[mediawiki/skins/Vector@master] Override night mode pref with night mode query string

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

Change 1003107 abandoned by Jdlrobson:

[mediawiki/skins/Vector@master] Fixes Vector query string behaviour

Reason:

See https://gerrit.wikimedia.org/r/c/mediawiki/skins/Vector/+/1003804

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

Change 1003804 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Override night mode pref with night mode query string

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

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://en.wikipedia.beta.wmflabs.org/w/index.php?title=T352930&vectornightmode=1
✅ AC1: The skin-night-mode-clientpref-1 class should be present on the HTML element

screenshot 529.png (814×1 px, 210 KB)

ovasileva claimed this task.
ovasileva subscribed.

Looks good, resolving.

Test Result - Prod

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

Test Artifact(s):

QA Steps

Go to https://en.wikipedia.beta.wmflabs.org/w/index.php?title=T352930&vectornightmode=1
✅ AC1: The skin-night-mode-clientpref-1 class should be present on the HTML element

screenshot 562.png (912×990 px, 306 KB)