Add config to separate out visualenhancements on mobile

Follow-up to d0126ce6de which made them
default-on for all mobile. These two taken together mean that the
mobile visual enhancement features now *only* depend on this config,
rather than on whether the individual features are enabled on desktop.

Bug: T318871
Change-Id: If767753e6d33f19bbc540d4e74273e478198388c
This commit is contained in:
David Lynch 2022-09-28 17:12:48 -05:00
parent f910e54802
commit d5161bf086
2 changed files with 14 additions and 3 deletions

View file

@ -604,6 +604,10 @@
"value": true,
"description": "Enable DiscussionTools on mobile talk pages. Currently this automatically enables 'replytool', 'newtopictool' & 'sourcemodetoolbar' on those pages and disables topic subscriptions on those pages."
},
"DiscussionToolsEnableMobile_visualenhancements": {
"value": true,
"description": "Enable DiscussionTools visual enhancements on mobile talk pages, if DiscussionTools itself is enabled. Currently this automatically enables 'visualenhancements', 'visualenhancements_reply', and 'visualenhancements_pageframe'."
},
"DiscussionTools_replytool": {
"value": "default",
"description": "Override availability of DiscussionTools reply tool. 'default', 'available', or 'unavailable'."

View file

@ -391,9 +391,16 @@ class HookUtils {
// Even though mobile ignores user preferences, TOPICSUBSCRIPTION must
// still be disabled if the user isn't registered.
( $feature === static::TOPICSUBSCRIPTION && $output->getUser()->isRegistered() ) ||
$feature === static::VISUALENHANCEMENTS ||
$feature === static::VISUALENHANCEMENTS_REPLY ||
$feature === static::VISUALENHANCEMENTS_PAGEFRAME
// Even though mobile ignores user preferences, VISUALENHANCEMENTS must
// still be disabled if is unavailable on the wiki.
(
(
$feature === static::VISUALENHANCEMENTS ||
$feature === static::VISUALENHANCEMENTS_REPLY ||
$feature === static::VISUALENHANCEMENTS_PAGEFRAME
) &&
$dtConfig->get( 'DiscussionToolsEnableMobile_visualenhancements' )
)
);
}