Page MenuHomePhabricator

Translate's NaviToggle should be hidden in modern Vector
Closed, ResolvedPublic

Description

Event Timeline

Jdlrobson renamed this task from TranslateWiki NaviToggle broken in modern Vector to TranslateWiki NaviToggle placement broken in modern Vector.May 5 2020, 2:44 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson updated the task description. (Show Details)
Jdlrobson updated the task description. (Show Details)
Jdlrobson added subscribers: alexhollender, Nikerabbit.

Won't this functionality be obsolete once we build the collapsible sidebar for modern Vector? T247032

Jdlrobson claimed this task.

True. So I guess this needs to make use of the .skin-legacy class and only show it if that's present?

Jdlrobson renamed this task from TranslateWiki NaviToggle placement broken in modern Vector to TranslateWiki NaviToggle should be hidden in modern Vector.May 20 2020, 2:53 PM
Jdlrobson reopened this task as Open.

I doubt .skin-legacy is present since MediaWiki 1.33.

It's not no, the new Vector is in 1.35. To support pre 1.33 however you have several options:

  1. add the class via hook using OutputPage::addBodyClasses based on version number to older MediaWiki versions < 1.35
  2. Use the selector :not(.skin-legacy) .tux-navitoggle { display: none; }
  3. We'll be providing an mw.config value soon, which you'd be able to check and update the code in resources/js/ext.translate.navitoggle.js to not run when the skin version is 2

I'm sure there's more ways to do this, but these are just that came to mind.

Nikerabbit renamed this task from TranslateWiki NaviToggle should be hidden in modern Vector to Translate's NaviToggle should be hidden in modern Vector.May 25 2020, 1:36 PM
Nikerabbit moved this task from Backlog to tux on the MediaWiki-extensions-Translate board.

To me option (3) seem best, since it is direct feature detection. Can you ping this task when that is available?

Given this seems to replicate the functionality of #mw-sidebar-button may I suggest you check the existence of that (particularly because it breaks the side bar button there) ?
https://meta.wikimedia.beta.wmflabs.org/wiki/Special:Translate?useskin=vector&group=%21additions&language=en&filter=%21translated&action=translate

Change 606248 had a related patch set uploaded (by Nikerabbit; owner: Nikerabbit):
[mediawiki/extensions/Translate@master] Skip navitoggle on new Vector

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

Change 606248 merged by jenkins-bot:
[mediawiki/extensions/Translate@master] Skip navitoggle on new Vector

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

Great! Thanks all!