Page MenuHomePhabricator

The newly split Modern and legacy Vector skins must run existing user gadgets/scripts
Closed, ResolvedPublic5 Estimated Story Points

Description

A promise of desktop improvements was that we will maintain support for existing user gadgets and styles.

When we make the technical change to break Vector into 2 separate skins we introduce a new skin key.

To restore this support we will introduce a Vector ResourceLoader module which looks for existing wiki pages and adds them to the experience if present.

Acceptance criteria

QA

To be done by a developer.

Setup

// for modern, the user menu dropdown button shows a red border while for legacy, the entire personal menu shows a red border
#firstHeading {border: 1px solid red;}
  1. Edit https://en.wikipedia.beta.wmflabs.org/wiki/MediaWiki:Vector.js
if ( mw.config.get('skin') === 'vector' && document.body.classList.contains('skin-vector-legacy') ) {
  console.log('Legacy works!')
}

if ( mw.config.get('skin') === 'vector' && !document.body.classList.contains('skin-vector-legacy') ) {
 console.log('Modern works!')
}

Tests

  1. Test one. Visit https://en.wikipedia.beta.wmflabs.org/?useskin=vector&useskinversion=1

Expected:

  • console.log saying "Legacy works"
  • a red border around the user menu
  1. Test two. Visit https://en.wikipedia.beta.wmflabs.org/?useskin=vector&useskinversion=2

Expected:

  • console.log saying "Modern works"
  • a red border around the user menu
  1. Test. Visit https://en.wikipedia.beta.wmflabs.org/?useskin=vector-2022

Expected:

  • console.log saying "Modern works"
  • a red border around the user menu

Note: please undo the changes afterwards.

To be done by Edward:

Setup:

  1. Login as a new user
  1. Edit the page User:(username)/vector.css with the following
/* T297758 */
#pt-notifications-alert {border: 1px solid blue;}
#p-personal {border: 1px solid red;}
  1. Edit the page User:(username)/vector.js (substituting username with your username, with the following:
if ( mw.config.get('skin') === 'vector' && document.body.classList.contains('skin-vector-legacy') ) {
  alert('Legacy works!')
}

if ( mw.config.get('skin') === 'vector' && !document.body.classList.contains('skin-vector-legacy') ) {
  alert('Modern works!')
}

Tests:

  1. Test one. Visit https://en.wikipedia.beta.wmflabs.org/?useskin=vector&useskinversion=1

Expected:

  • An alert saying "Legacy works"
  • a red border around the user menu
  • a blue border around the Echo notfiication
  1. Test two. Visit https://en.wikipedia.beta.wmflabs.org/?useskin=vector&useskinversion=2

Expected:

  • An alert saying "Modern works"
  • a red border around the user menu
  • a blue border around the Echo notfiication
  1. Test three. Visit https://en.wikipedia.beta.wmflabs.org/?useskin=vector-2022

Expected:

  • An alert saying "Modern works"
  • a red border around the user menu
  • a blue border around the Echo notfiication

QA Results - Beta

ACStatusDetails
1T297758#7635194
2T297758#7635194
3T297758#7635194

QA Results - Prod

ACStatusDetails
1T297758#7635196
2T297758#7635196
3T297758#7635196

Event Timeline

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

[mediawiki/skins/Vector@master] Restore gadget support to new internal skins

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

Jdlrobson triaged this task as High priority.
cjming removed Jdlrobson as the assignee of this task.
cjming moved this task from Doing to Code Review on the Web-Team-Backlog (Kanbanana-FY-2021-22) board.
cjming subscribed.

Change 747209 merged by jenkins-bot:

[mediawiki/skins/Vector@master] Restore gadget support to new internal skins

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

cjming updated the task description. (Show Details)

To be done by a developer.

This is a pass. HEre's screenshots:

Screen Shot 2022-01-10 at 5.47.00 PM.png (762×1 px, 170 KB)

Screen Shot 2022-01-10 at 4.27.26 PM.png (474×2 px, 114 KB)

Screen Shot 2022-01-10 at 4.27.36 PM.png (458×2 px, 122 KB)

Screen Shot 2022-01-10 at 4.27.52 PM.png (512×1 px, 198 KB)

Screen Shot 2022-01-10 at 5.45.53 PM.png (688×1 px, 138 KB)

Screen Shot 2022-01-10 at 5.46.17 PM.png (568×1 px, 184 KB)

Test Result - Beta

Status: ✅ PASS
Environment: beta
OS: macOS Monterey
Browser: Chrome
Device: MBP
Emulated Device:NA

Test Artifact(s):

QA Steps
  1. Login as a new user
  1. Edit the page User:(username)/vector.css with the following
/* T297758 */
#pt-notifications-alert {border: 1px solid blue;}
#p-personal {border: 1px solid red;}
  1. Edit the page User:(username)/vector.js (substituting username with your username, with the following:
if ( mw.config.get('skin') === 'vector' && document.body.classList.contains('skin-vector-legacy') ) {
  alert('Legacy works!')
}

if ( mw.config.get('skin') === 'vector' && !document.body.classList.contains('skin-vector-legacy') ) {
  alert('Modern works!')
}

Tests:

✅ AC1: Test one. Visit https://en.wikipedia.beta.wmflabs.org/?useskin=vector&useskinversion=1
Expected:

  • An alert saying "Legacy works"
  • a red border around the user menu
  • a blue border around the Echo notfiication

Screen Shot 2022-01-19 at 4.08.33 PM.png (327×858 px, 128 KB)
Screen Shot 2022-01-19 at 4.08.41 PM.png (327×858 px, 127 KB)

✅ AC2: Test two. Visit https://en.wikipedia.beta.wmflabs.org/?useskin=vector&useskinversion=2
Expected:

  • An alert saying "Modern works"
  • a red border around the user menu
  • a blue border around the Echo notfiication

Screen Shot 2022-01-19 at 4.09.51 PM.png (327×858 px, 104 KB)
Screen Shot 2022-01-19 at 4.09.56 PM.png (327×858 px, 67 KB)

✅ AC3: Test three. Visit https://en.wikipedia.beta.wmflabs.org/?useskin=vector-2022
Expected:

  • An alert saying "Modern works"
  • a red border around the user menu
  • a blue border around the Echo notfiication

Screen Shot 2022-01-19 at 4.10.24 PM.png (327×858 px, 102 KB)
Screen Shot 2022-01-19 at 4.10.28 PM.png (327×858 px, 66 KB)

Edtadros subscribed.

Test Result - Prod

Status: ✅ PASS
Environment: enwiki
OS: macOS Monterey
Browser: Chrome
Device: MBP
Emulated Device:NA

Test Artifact(s):

QA Steps
  1. Login as a new user
  1. Edit the page User:(username)/vector.css with the following
/* T297758 */
#pt-notifications-alert {border: 1px solid blue;}
#p-personal {border: 1px solid red;}
  1. Edit the page User:(username)/vector.js (substituting username with your username, with the following:
if ( mw.config.get('skin') === 'vector' && document.body.classList.contains('skin-vector-legacy') ) {
  alert('Legacy works!')
}

if ( mw.config.get('skin') === 'vector' && !document.body.classList.contains('skin-vector-legacy') ) {
  alert('Modern works!')
}

Tests:

✅ AC1: Test one. Visit https://en.wikipedia.org/?useskin=vector&useskinversion=1
Expected:

  • An alert saying "Legacy works"
  • a red border around the user menu
  • a blue border around the Echo notfiication

Screen Shot 2022-01-19 at 4.17.20 PM.png (327×858 px, 130 KB)
Screen Shot 2022-01-19 at 4.17.28 PM.png (327×858 px, 127 KB)

✅ AC2: Test two. Visit https://en.wikipedia.org/?useskin=vector&useskinversion=2
Expected:

  • An alert saying "Modern works"
  • a red border around the user menu
  • a blue border around the Echo notfiication

Screen Shot 2022-01-19 at 4.18.19 PM.png (327×858 px, 97 KB)
Screen Shot 2022-01-19 at 4.18.25 PM.png (327×858 px, 87 KB)

✅ AC3: Test three. Visit https://en.wikipedia.org/?useskin=vector-2022
Expected:

  • An alert saying "Modern works"
  • a red border around the user menu
  • a blue border around the Echo notfiication

Screen Shot 2022-01-19 at 4.18.59 PM.png (327×858 px, 96 KB)
Screen Shot 2022-01-19 at 4.19.05 PM.png (327×858 px, 85 KB)