And a temporary feature flag so we can roll it out in stages.
Bug: T195431
Change-Id: I170840146a197ac381df94434350ae2f0561d147
'watchlistunwatchlinks' => 0,
'watchmoves' => 0,
'watchrollback' => 0,
+ 'wlenhancedfilters-disable' => 0,
'wllimit' => 250,
'useeditwarning' => 1,
'prefershttps' => 1,
*/
$wgStructuredChangeFiltersShowPreference = false;
+/**
+ * Whether a preference is displayed for structured change filters on watchlist.
+ * Works just like $wgStructuredChangeFiltersShowPreference.
+ *
+ * Temporary variable during development and will be removed
+ * @since 1.32
+ */
+$wgStructuredChangeFiltersShowWatchlistPreference = false;
+
/**
* Whether to enable RCFilters app on Special:Watchlist
*
'help-message' => 'prefs-help-watchlist-token2',
];
}
+
+ if ( $this->config->get( 'StructuredChangeFiltersShowWatchlistPreference' ) ) {
+ $defaultPreferences['wlenhancedfilters-disable'] = [
+ 'type' => 'toggle',
+ 'section' => 'watchlist/opt-out',
+ 'label-message' => 'rcfilters-watchlist-preference-label',
+ 'help-message' => 'rcfilters-watchlist-preference-help',
+ ];
+ }
}
/**
}
public static function checkStructuredFilterUiEnabled( Config $config, User $user ) {
- return (
- $config->get( 'StructuredChangeFiltersOnWatchlist' ) &&
- $user->getOption( 'rcenhancedfilters' )
- );
+ if ( !$config->get( 'StructuredChangeFiltersOnWatchlist' ) ) {
+ return false;
+ }
+
+ if ( $config->get( 'StructuredChangeFiltersShowWatchlistPreference' ) ) {
+ return !$user->getOption( 'wlenhancedfilters-disable' );
+ } else {
+ return $user->getOption( 'rcenhancedfilters' );
+ }
}
/**
"rcfilters-watchlist-showupdated": "Changes to pages you haven't visited since the changes occurred are in <strong>bold</strong>, with solid markers.",
"rcfilters-preference-label": "Hide the improved version of Recent Changes",
"rcfilters-preference-help": "Rolls back the 2017 interface redesign and all tools added then and since.",
+ "rcfilters-watchlist-preference-label": "Hide the improved version of the Watchlist",
+ "rcfilters-watchlist-preference-help": "Rolls back the 2017 interface redesign and all tools added then and since.",
"rcfilters-filter-showlinkedfrom-label": "Show changes on pages linked from",
"rcfilters-filter-showlinkedfrom-option-label": "<strong>Pages linked from</strong> the selected page",
"rcfilters-filter-showlinkedto-label": "Show changes on pages linking to",
"rcfilters-watchlist-showupdated": "Message at the top of [[Special:Watchlist]] when the Structured filters are enabled that describes what unseen changes look like.\n\nCf. {{msg-mw|wlheader-showupdated}}",
"rcfilters-preference-label": "Option in RecentChanges tab of [[Special:Preferences]].",
"rcfilters-preference-help": "Explanation for the option in the RecentChanges tab of [[Special:Preferences]].",
+ "rcfilters-watchlist-preference-label": "Option in Watchlist tab of [[Special:Preferences]].",
+ "rcfilters-watchlist-preference-help": "Explanation for the option in the Watchlist tab of [[Special:Preferences]].",
"rcfilters-filter-showlinkedfrom-label": "Label that indicates that the page is showing changes that link FROM the target page. Used on [[Special:Recentchangeslinked]] when structured filters are enabled.",
"rcfilters-filter-showlinkedfrom-option-label": "Menu option to show changes FROM the target page. Used on [[Special:Recentchangeslinked]] when structured filters are enabled.",
"rcfilters-filter-showlinkedto-label": "Label that indicates that the page is showing changes that link TO the target page. Used on [[Special:Recentchangeslinked]] when structured filters are enabled.",