Page MenuHomePhabricator

Remove mediawiki.ui module dependency in Translate (excluding mediawiki.ui.button)
Closed, ResolvedPublic4 Estimated Story Points

Description

Background

mediawiki.ui modules are only left in a few places while negatively impacting every user by being loaded on MediaWiki for every page in the module definitions.

Translate still uses the CSS classes/modules

  • mediawiki.ui
  • mediawiki.ui.button
  • mediawiki.ui.input
  • mediawiki.ui.checkbox

in

  • src/PageTranslation/MigrateTranslatablePageSpecialPage.php
  • src/TtmServer/SearchTranslationsSpecialPage.php

Goal

Remove mediawiki.ui module calls in order to enable removing the modules upstream in core

Acceptance criteria for done

  • Replace all usages of mediawiki.ui in Translate
  • Remove modules calls

Event Timeline

Change #1267893 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/Translate@master] SpecailSearchTranslation: Remove mediawiki.ui dependency

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

Change #1267899 had a related patch set uploaded (by Abijeet Patro; author: Abijeet Patro):

[mediawiki/extensions/Translate@master] MigrateTranslatableSpecialPage: Remove usage of mediawiki.ui

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

abi_ triaged this task as Medium priority.Apr 5 2026, 12:36 AM

Change #1268266 had a related patch set uploaded (by Tacsipacsi; author: Tacsipacsi):

[mediawiki/extensions/Translate@master] MigrateTranslatablePageSpecialPage: Use Vue/Codex

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

Change #1267899 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] MigrateTranslatableSpecialPage: Remove usage of mediawiki.ui

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

mw-ui-button is used at a lot more places (Special:Translate, Special:PageTranslation etc.). Is that out of the scope of the current task?

@Tacsipacsi Good question, the task was mostly meant to reduce Translate's requirement to only mediawiki.ui.button and get rid of the three other remaining dependencies, to be able to remove them (which would already provide a performance gain for all users, and reduce developer mental load).
Getting rid of it here too wouldn't be bad for long-term maintenance and consistency from a design system POV, but I don't see a horizon currently where this module will be removed – with mw-ui-button`s being so heavily used in templates and other places.

Change #1267893 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] SpecialSearchTranslations: Remove mediawiki.ui dependency

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

I see. In that case, I’d rephrase this task to only aim removing modules other than mediawiki.ui.button, and remove T420685 as a parent task, so that this task can be closed and the remaining two parent tasks can be unblocked soon. (Although it’s not my call, I’m neither on your team nor on the LPL team.) For mediawiki.ui.button, maybe a new task could be created. Looking at the search results for mw-ui-button in the Translate repo, most, if not all, remaining uses would welcome a larger overhaul (potentially using Vue/Codex at most places), so if there’s no time pressure, it’s more efficient to start with that overhaul, without any stopgap solutions.

Nikerabbit renamed this task from Remove mediawiki.ui module dependency to Remove mediawiki.ui module dependency in Translate (excluding mediawiki.ui.button).Apr 14 2026, 10:54 AM
Nikerabbit updated the task description. (Show Details)

Change #1268266 merged by jenkins-bot:

[mediawiki/extensions/Translate@master] MigrateTranslatablePageSpecialPage: Use Vue/Codex

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

Nikerabbit subscribed.
developer@dev:/srv/mediawiki/workdir/extensions/Translate$ git log -1 --format=%H
846b6f41ea8a200d1548bc19555494f1e31ed53d
developer@dev:/srv/mediawiki/workdir/extensions/Translate$ ack mediawiki.ui
src/TranslatorInterface/TranslateSpecialPage.php
64:                     'mediawiki.ui.button',

src/TranslatorSandbox/TranslationStashSpecialPage.php
65:             $out->addModuleStyles( 'mediawiki.ui.button' );

src/TranslatorSandbox/ManageTranslatorSandboxSpecialPage.php
61:                             'mediawiki.ui.button',

extension.json
1293:                           "mediawiki.ui.button",

Note that mediawiki.ui.button is automatically loaded if mw-ui-buttons are detected in the output, so searching for the module name doesn’t find all of the usage (e.g. Special:PageTranslation is missing from your results). I’d rather search for the class name:

me@laptop:…/extensions/Translate$ ag mw-ui-
src/PageTranslation/PageTranslationSpecialPage.php
430:				[ 'class' => 'mw-ui-button mw-ui-progressive' ]
451:				[ 'class' => 'mw-ui-button mw-ui-destructive' ]

src/TranslatorSandbox/TranslationStashSpecialPage.php
161:				'class' => 'uls mw-ui-button',

src/TranslatorInterface/TranslateSpecialPage.php
318:				'class' => 'uls mw-ui-button',

resources/js/ext.translate.special.translate.js
371:			.addClass( 'mw-ui-button tux-watch-button ' + watchClass )

resources/js/ext.translate.editor.js
949:					.addClass( 'tux-editor-save-button mw-ui-button mw-ui-progressive' )
998:				.addClass( 'tux-editor-skip-button mw-ui-button mw-ui-quiet' )
1026:				.addClass( 'tux-editor-cancel-button mw-ui-button mw-ui-quiet' )
1294:					.addClass( 'tux-editor-savedoc-button mw-ui-button mw-ui-progressive' )
1307:					.addClass( 'tux-editor-skipdoc-button mw-ui-button mw-ui-quiet' )

resources/js/ext.translate.special.managetranslatorsandbox.js
123:						.addClass( 'accept mw-ui-button mw-ui-progressive' )
140:						.addClass( 'reject mw-ui-button mw-ui-destructive' )
300:						.addClass( 'accept-all mw-ui-button mw-ui-progressive' )
317:						.addClass( 'reject-all mw-ui-button mw-ui-destructive' )

resources/js/ext.translate.messagetable.js
365:					.addClass( 'mw-ui-button' )
612:				.addClass( 'mw-ui-button mw-ui-progressive mw-ui-big' )

resources/css/ext.translate.language.selector.less
13:	.uls.mw-ui-button {

resources/css/ext.translate.editor.less
534:.message-desc-editor .mw-ui-button,
535:.tux-editor-control-buttons .mw-ui-button {

resources/css/ext.translate.special.translate.less
64:	.mw-ui-button.tux-watch-button {