Steps to replicate the issue (include links if applicable):
On en:wp, when using Vector 2022: click "Switch to old look" in the left sidebar and try to switch.
What happens?:
- I am taken to the "Skin" preferences section, and have to figure out to click on Vector 2010, scroll down, and click Save
- After saving, I am still on that preferences page, with the changes applied, and have to manually navigate back to the page I was on before
What should have happened instead?:
- A one-click change back to my previous skin selection, while staying on the page I was reading. (what I thought the on-wiki discussion was pointing towards; I didn't find another phab task for this)
(In the same conversation, I thought that Vector 2010 would also have a persistent "Switch to new look" link in the same place in the sidebar, making it easy to switch back and forth; see T313747)
Developer notes
This should reuse the code in the banner we made. Ask Szymon for the code. Note, that there is special handling for global preferences and the code works in the opposite way to what we want it to do.
$( document ).on( 'click', '#vector-banner-opt-in', function ( ev ) { event.preventDefault(); var confirm = window.confirm( "{{{warning}}}" ); if ( confirm ) { var api = new mw.Api(); api.saveOption( 'skin', 'vector-2022' ).then( function (r) { try { if ( r.warnings.options.warnings.indexOf('globalpreferenceoverrides') > -1 ) { return api.postWithToken( 'csrf', { action: 'globalpreferenceoverrides', optionname: 'skin', optionvalue: 'vector-2022' } ); } } catch ( e ) { // do nothing } try { localStorage.setItem('vector-banner-switcheroo', 1 ); mw.track('counter.MediaWiki.vector_banner_signup'); } catch (e) { // do nothing } } ).then( function (r) { location.reload(); } ); } });