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
- Introduce skins.vector.user.styles and skins.vector.user for maintaining the loading of legacy gadgets associated with the vector key.
- mw.config.get( 'skin' ) === 'vector' must be true for legacy and modern Vector. 3000+ gadgets check this value. https://global-search.toolforge.org/?q=%27vector%27®ex=1&namespaces=&title=
QA
To be done by a developer.
Setup
- Login as admin into a local instance and edit the following files: https://en.wikipedia.beta.wmflabs.org/wiki/MediaWiki:Vector.css
// 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;}
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
Expected:
- console.log saying "Legacy works"
- a red border around the user menu
Expected:
- console.log saying "Modern works"
- a red border around the user menu
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:
- Login as a new user
- Edit the page User:(username)/vector.css with the following
/* T297758 */ #pt-notifications-alert {border: 1px solid blue;} #p-personal {border: 1px solid red;}
- 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:
Expected:
- An alert saying "Legacy works"
- a red border around the user menu
- a blue border around the Echo notfiication
Expected:
- An alert saying "Modern works"
- a red border around the user menu
- a blue border around the Echo notfiication
- 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
AC | Status | Details |
---|---|---|
1 | ✅ | T297758#7635194 |
2 | ✅ | T297758#7635194 |
3 | ✅ | T297758#7635194 |
QA Results - Prod
AC | Status | Details |
---|---|---|
1 | ✅ | T297758#7635196 |
2 | ✅ | T297758#7635196 |
3 | ✅ | T297758#7635196 |