Page MenuHomePhabricator

Address Voice and Tone issues in MobileFrontend
Closed, ResolvedPublic5 Estimated Story Points

Description

Background

Targets
    Occurrences of '(white|black)[ \-]?list' in Directory /Users/reedy/PhpstormProjects/mediawiki/extensions/MobileFrontend
Found Occurrences  (57 usages found)
    extensions  (57 usages found)
        MobileFrontend  (57 usages found)
            includes  (22 usages found)
                MobileContext.php  (11 usages found)
                    39 * Save whether current page is blacklisted from displaying in mobile view
                    42 protected $blacklistedPage = null;
                    417 * Checks whether current page is blacklisted from displaying mobile view
                    420 public function isBlacklistedPage() {
                    421 if ( $this->blacklistedPage === null ) {
                    422 $this->blacklistedPage = $this->isBlacklistedPageInternal();
                    425 return $this->blacklistedPage;
                    429 * Value for isBlacklistedPage()
                    432 private function isBlacklistedPageInternal() {
                    436 // Check for blacklisted category membership
                    451 // ...and individual page blacklisting
                MobileFrontendHooks.php  (11 usages found)
                    42 if ( $mobileContext->shouldDisplayMobileView() && !$mobileContext->isBlacklistedPage() ) {
                    114 || $mobileContext->isBlacklistedPage()
                    166 // Set the mobile target. Note, this does not consider MobileContext::isBlacklistedPage(),
                    205 if ( $key === 'places' && !$context->isBlacklistedPage() ) {
                    288 $config->get( 'MFMobileFormatterNamespaceBlacklist' )
                    459 * See `$wgMFStripResponsiveImages` and `$wgMFResponsiveImageWhitelist` for
                    835 // blacklisted pages yet. Last minute undo if needed.
                    836 if ( $context->isBlacklistedPage() ) {
                    1048 * configured to do so and the thumbnail's MIME type isn't whitelisted.
                    1067 $config->get( 'MFResponsiveImageWhitelist' ) ) ) {
                    1070 // or other whitelisted types.
            resources  (5 usages found)
                dist  (5 usages found)
                    mobile.common.js.map.json  (1 usage found)
                        1 getSectionsFromHTML","Thumbnail","HEADING_SELECTOR","BLACKLISTED_THUMBNAIL_CLASS_SELECTORS","PageHTMLParser","sectionIndex","eq","selector","$heading","$nextHeading
                    mobile.editor.overlay.js  (1 usage found)
                        1 extensionAbuseFilter",captcha:"extensionCaptcha",spamblacklist:"extensionSpamBlacklist","titleblacklist-forbidden":"extensionTitleBlacklist",pagedeleted:"editPageDeleted
                    mobile.editor.overlay.js.map.json  (1 usage found)
                        1 assertuserfailed","assertnameduserfailed","spamblacklist","pagedeleted","editconflict","reportError","errorNotice","heading","$errorNoticeContainer","hideErrorNotice
                    mobile.init.js.map.json  (1 usage found)
                        1 $allEditLinks","$","user","mw","CtaDrawer","blacklisted","test","navigator","userAgent","contentModel","config","get","veConfig","editCount","editorPath
                    mobile.talk.overlays.js.map.json  (1 usage found)
                        1 info texts are all localized.\n\t\t\t\t\twhitelistedErrorInfo = [\n\t\t\t\t\t\t'readonly',\n\t\t\t\t\t\t'blocked',\n\t\t\t\t\t\t'autoblocked'\n\t\t\t
            src  (14 usages found)
                mobile.editor.overlay  (2 usages found)
                    EditorOverlayBase.js  (2 usages found)
                        313 spamblacklist: 'extensionSpamBlacklist',
                        314 'titleblacklist-forbidden': 'extensionTitleBlacklist',
                mobile.init  (3 usages found)
                    editor.js  (3 usages found)
                        12 blacklisted = /MSIE \d\./.test( navigator.userAgent ),
                        530 isEditingSupported = router.isSupported() && !blacklisted;
                        544 // Browser doesn't support mobile editor (or is blacklisted), use the fallback editor.
                mobile.startup  (7 usages found)
                    PageHTMLParser.js  (7 usages found)
                        4 BLACKLISTED_THUMBNAIL_CLASS_SELECTORS = [ 'noviewer', 'metadata' ];
                        143 * that matches one of the items of the constant BLACKLISTED_THUMBNAIL_CLASS_SELECTORS
                        155 blacklistSelector = '.' + BLACKLISTED_THUMBNAIL_CLASS_SELECTORS.join( ',.' ),
                        161 .not( blacklistSelector );
                        167 valid = $a.parents( blacklistSelector ).length === 0 &&
                        168 $a.find( blacklistSelector ).length === 0,
                        177 valid = !new RegExp( '\\b(' + BLACKLISTED_THUMBNAIL_CLASS_SELECTORS.join( '|' ) + ')\\b' )
                mobile.talk.overlays  (2 usages found)
                    TalkSectionOverlay.js  (2 usages found)
                        231 whitelistedErrorInfo = [
                        239 whitelistedErrorInfo.indexOf( response.error.code ) > -1
            stories  (6 usages found)
                editor  (6 usages found)
                    data.js  (4 usages found)
                        50 export const spamBlacklist = {
                        53 code: 'spamblacklist',
                        54 This is probably caused by a link to a blacklisted external site.\nThe following text is what triggered our spam filter: example.com/test',
                        56 spamblacklist: {
                    utils.js  (2 usages found)
                        3 abuseFilterWarning, abuseFilterDisallowed, spamBlacklist, editConflict, readOnly, captcha,
                        37 () => util.Deferred().resolve( spamBlacklist )
            tests  (1 usage found)
                phpunit  (1 usage found)
                    integration  (1 usage found)
                        MobileFrontendHooksTest.php  (1 usage found)
                            409 // It handles an image with a whitelisted MIME type.
            extension.json  (2 usages found)
                877 "MFMobileFormatterNamespaceBlacklist": {
                984 "MFResponsiveImageWhitelist": {
            README.md  (5 usages found)
                277 #### $wgMFMobileFormatterNamespaceBlacklist
                279 Array of namespaces that blacklists certain namespaces from applying mobile
                282 MFRemovableClasses will not apply for any blacklisted pages.
                619 #### $wgMFResponsiveImageWhitelist
                621 Whitelist of source file mime types to retain srcset attributes on when using
            webpack.config.js  (2 usages found)
                137 // shared between the chunks listed in the whitelist entry array into a
                158 // Only consider splitting chunks off of these whitelisted entry names

Acceptance criteria

  • Change naming to allowlist and denylist
  • Update Wikimedia Config entries

Event Timeline

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

[mediawiki/extensions/MobileFrontend@master] Drop $wgMFNoMobileCategory

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

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

[mediawiki/extensions/MobileFrontend@master] Drop $wgMFNoMobilePages

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

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

[mediawiki/extensions/MobileFrontend@master] Drop problematically named and unused blacklist methods.

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

Jdlrobson subscribed.

wgMFNoMobilePages and wgMFNoMobileCategory is only used on Foundation Wiki and barely used. Have explained on the bug that these are used for 3 pages which are:
https://foundation.wikimedia.org/wiki/Reusing_content, https://foundation.wikimedia.org/wiki/Visual_identity_guidelines and https://foundation.wikimedia.org/wiki/User:Jalexander/sandbox

MobileFormatterNamespaceBlacklist and MFResponsiveImageWhitelist can be renamed easily without requiring a config change and the JS changes should be straightforward, but am pausing for code review for the former before continuing the more straightforward parts.

Change 683099 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Drop $wgMFNoMobileCategory

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

Change 683100 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Drop $wgMFNoMobilePages

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

phuedx subscribed.

Those first three patches are now merged (or about to be!). Moving this task back to Doing per T277951#7040223.

Change 683101 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Drop problematically named and unused blacklist methods.

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

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

[mediawiki/extensions/MobileFrontend@master] Use more inclusive language in reduced config

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

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

[mediawiki/extensions/MobileFrontend@master] Drop unused private variable

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

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

[operations/mediawiki-config@master] Prepare for new configuration option

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

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

[mediawiki/extensions/MobileFrontend@master] Use more inclusive language in frontend code.

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

This is blocked on the deployment of https://gerrit.wikimedia.org/r/c/operations/mediawiki-config/+/683720. The earliest that change can be deployed this coming Monday (3rd May).

Change 683718 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Drop unused private variable

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

Change 683720 merged by jenkins-bot:

[operations/mediawiki-config@master] Prepare for new configuration option

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

Mentioned in SAL (#wikimedia-operations) [2021-05-03T23:18:51Z] <urbanecm@deploy1002> Synchronized wmf-config/InitialiseSettings.php: 230ef5716b34ca83348667f289180313b76ce8a3: Prepare for new configuration option (T277951) (duration: 00m 57s)

Jdlrobson removed Edtadros as the assignee of this task.
Jdlrobson moved this task from Code Review to QA on the Web-Team-Backlog (Kanbanana-FY-2020-21) board.
Jdlrobson added a subscriber: Edtadros.
Jdlrobson added a subscriber: LGoto.

Just frontend remains here. @LGoto possibly need to reach out to editing for support here.

Change 683717 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Use more inclusive language in reduced config

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

Change 683738 merged by jenkins-bot:

[mediawiki/extensions/MobileFrontend@master] Use more inclusive language in frontend code.

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

Jdlrobson added a subscriber: Esanders.

Thanks @Esanders and @phuedx
This should now be ready for sign off. Note it couldn't be completed 100% due to T254649 and T254650 - but a separate task has been opened for that situation.