From b86dbc756cf27dc11e9d7dfdea96c292fec9a142 Mon Sep 17 00:00:00 2001 From: Jon Robson Date: Mon, 14 Mar 2022 11:49:23 -0700 Subject: [PATCH] Address some code FIXMEs - Remove references to the removed wgVectorUseWvuiSearch configuration - Remove mw-body qualifier on Indicators component. - Drops some cache related FIXMEs Change-Id: I6823b9c5bf19a067b56badf29f874a7127867a09 --- includes/Hooks.php | 3 +-- .../VectorResourceLoaderVirtualConfig.d.ts | 4 ---- resources/common/components/Indicators.less | 19 ++++++++----------- .../components/LanguageButton.less | 5 +---- .../components/VueEnhancedSearchBox.less | 3 --- .../skins.vector.styles/layouts/screen.less | 3 +-- 6 files changed, 11 insertions(+), 26 deletions(-) diff --git a/includes/Hooks.php b/includes/Hooks.php index b072d88db..8ef9c2edf 100644 --- a/includes/Hooks.php +++ b/includes/Hooks.php @@ -126,8 +126,7 @@ class Hooks { } // Tell the `mediawiki.page.ready` module not to wire up search. - // This allows us to use $wgVectorUseWvuiSearch to decide to load - // the historic jquery autocomplete search or the new Vue implementation. + // This allows us to use the new Vue implementation. // ResourceLoaderContext has no knowledge of legacy / modern Vector // and from its point of view they are the same thing. // Please see the modules `skins.vector.js` and `skins.vector.legacy.js` diff --git a/resources/VectorResourceLoaderVirtualConfig.d.ts b/resources/VectorResourceLoaderVirtualConfig.d.ts index d86fa6aea..33b7bc3c3 100644 --- a/resources/VectorResourceLoaderVirtualConfig.d.ts +++ b/resources/VectorResourceLoaderVirtualConfig.d.ts @@ -1,8 +1,4 @@ /** See Vector\Hooks::getVectorResourceLoaderConfig */ interface VectorResourceLoaderVirtualConfig { wgVectorSearchHost: string; - /** - * The name of the ResourceLoader module that contains search. - */ - wgVectorUseWvuiSearch: boolean } diff --git a/resources/common/components/Indicators.less b/resources/common/components/Indicators.less index 86fd7ce0e..98a3f7fd2 100644 --- a/resources/common/components/Indicators.less +++ b/resources/common/components/Indicators.less @@ -1,14 +1,11 @@ @import '../variables.less'; -// FIXME: Is specific `.mw-body` even needed? Does `.mw-indicators` exist outside? -.mw-body { - .mw-indicators { - font-size: @font-size-base; - line-height: @line-height-base; - position: relative; - } - - .mw-indicator { - display: inline-block; - } +.mw-indicators { + font-size: @font-size-base; + line-height: @line-height-base; + position: relative; +} + +.mw-indicator { + display: inline-block; } diff --git a/resources/skins.vector.styles/components/LanguageButton.less b/resources/skins.vector.styles/components/LanguageButton.less index 342b696e7..01a8fae5c 100644 --- a/resources/skins.vector.styles/components/LanguageButton.less +++ b/resources/skins.vector.styles/components/LanguageButton.less @@ -2,8 +2,7 @@ @import '../../common/variables.less'; @import 'mediawiki.mixins.less'; -// TODO: `#p-lang-btn` Can be changed to `.mw-portlet-lang` when languages-in-header is the default. -#p-lang-btn { +.mw-portlet-lang { // FIXME [review whether margin-top is needed] center vertically in heading. margin-top: 2px; .box-sizing( border-box ); @@ -24,8 +23,6 @@ // Remove opacity on language button (it applies to more menu because of label color). opacity: 1; - // FIXME: `span:not` rule can be removed when cache has cleared. - span:not( .mw-ui-icon ), .vector-menu-heading-label { // Special treatment for language button, based on Vector font-size font-size: @font-size-base; diff --git a/resources/skins.vector.styles/components/VueEnhancedSearchBox.less b/resources/skins.vector.styles/components/VueEnhancedSearchBox.less index 64296517c..dbcd37346 100644 --- a/resources/skins.vector.styles/components/VueEnhancedSearchBox.less +++ b/resources/skins.vector.styles/components/VueEnhancedSearchBox.less @@ -42,9 +42,6 @@ } // Only apply the following WVUI-related rules to clients who have js enabled. -// TODO: .skin-vector-search-vue class can be removed when $wgVectorUseWvuiSearch is no longer supported -// OR .vector-search-box-vue is in cached HTML. -.client-js .skin-vector-search-vue, .client-js .vector-search-box-vue { // Derived from @size-search-figure in WVUI // https://gerrit.wikimedia.org/r/plugins/gitiles/wvui/+/e32b54f3b8d1118b6a25cdc46b5638d6d048533e/src/themes/wikimedia-ui.less#21 diff --git a/resources/skins.vector.styles/layouts/screen.less b/resources/skins.vector.styles/layouts/screen.less index a0816d16b..a95a77881 100644 --- a/resources/skins.vector.styles/layouts/screen.less +++ b/resources/skins.vector.styles/layouts/screen.less @@ -111,8 +111,7 @@ body { .mixin-clearfix(); } -// TODO: Can be changed to `.mw-body .mw-portlet-lang` when language-in-header feature is default. -.mw-body #p-lang-btn { +.mw-body .mw-portlet-lang { float: right; }