Commit graph

108 commits

Author SHA1 Message Date
Bartosz Dziewoński 02ced052db Disable (instead of hiding) preferences that would have no effect
Keeping them visible avoid the page shifting unpleasantly,
and makes it easier to find the option you're looking for.

Change-Id: I1e37d5d11c5a19beb799346f4e9842e836224d3a
2022-06-01 21:36:30 +02:00
David Lynch b6f554a945 Ready A/B test code for topic subscriptions
Topic subscription test is going to be all logged in users only, no
transitory enrollment conditions, so we can remove the anonymous user
handling and DB writes.

Bug: T302515
Bug: T304030
Change-Id: I5e57bb9b7958576f3a04373748331a86f4626fb5
2022-05-19 01:09:40 -05:00
Umherirrender a979257396 Replace Action::getActionName by IContextSource::getActionName
Change-Id: If681252727a161d62444c8edbcd0cf447df1e765
2022-04-15 22:52:30 +02:00
Ed Sanders 91446d790e Empty state: Use self closing Html generators
Change-Id: I5352b064ac9e71df9f3f8791139944126b321436
2022-04-08 18:30:48 +01:00
Reedy 400d6227b8 Use namespaced VisualEditor traits and classes
Change-Id: I06eefd96068675607ed66a8a307d86c24d21f916
2022-03-29 20:32:44 +01:00
jenkins-bot 6948f0b3f3 Merge "Move cache expiry update from ParserAfterParse to ParserAfterTidy" 2022-03-15 21:44:44 +00:00
C. Scott Ananian 8e09b67c0d Move cache expiry update from ParserAfterParse to ParserAfterTidy
The ParserAfterParse hook will likely be deprecated, as Parsoid can't
properly support it as-is.  Luckily, DiscussionTools isn't doing
anything in ParserAfterParse that couldn't happen in the (supported)
ParserAfterTidy hook.

Bug: T303630
Change-Id: If72feb1e277c09f4ea0df339f2dd097a9b329d71
2022-03-15 12:19:57 -04:00
Bartosz Dziewoński 109f49bb56 Mobile: Only show "Add discussion" button if "New section" tab would be shown on desktop
Bug: T302417
Change-Id: Icd2acf19b8b7e4cf8893bbb37f80eafefe86acbb
2022-02-23 18:05:01 +01:00
Bartosz Dziewoński e11beee2ad Fix check for enabling features on mobile
When 'DiscussionToolsEnableMobile' was false, we were falling back to
the desktop configuration, rather than disabling everything.

When 'DiscussionToolsEnableMobile' was true, we were enabling the
selected features on every page, instead of only discussion pages.

Follow-up to b4f10c5638.

Bug: T302388
Change-Id: Ib4a42d5acd9da528e931c74de7a870d4be513d69
2022-02-23 12:05:00 +00:00
Ed Sanders b4f10c5638 Mobile config: Always enable reply/newtopic tools on mobile, disable subscriptions
Bug: T302326
Change-Id: I64ffc904046f7d9d2fa651c086876add35061e0a
2022-02-22 23:24:28 +01:00
David Lynch 7094cc592c Don't autosubscribe flagged bots
Bug: T301933
Change-Id: Icabee260a16ed2686a95250bad2aa1b92881566e
2022-02-17 11:54:14 -06:00
jenkins-bot 8bcaf75372 Merge "Replace use of deprecated OutputPage::enableClientCache( false )" 2022-02-10 07:01:26 +00:00
Bartosz Dziewoński 8b6ffc945f Don't refer to non-existent fields when using 'hide-if'
Bug: T301317
Change-Id: I40577b41e0c957281a45b71802808ec535b65653
2022-02-09 15:38:47 +01:00
C. Scott Ananian fe35a7324c Replace use of deprecated OutputPage::enableClientCache( false )
Replaced with the more readable ::disableClientCache() method, added
in 1.38.  Minimum MW version for this extension is already at 1.38.

Depends-On: I7c89e20528a0d91173f0edcb997dcae631935ee5
Change-Id: Idf1cf2fac3311f50ed3cbc420f7772b5c71b1992
2022-02-04 14:30:33 -05:00
Ed Sanders 6d655dee0a Remove DiscussionToolsEnableTopicSubscriptionBackend config
This is now deployed on all wikis, and going forward I don't think
we need to make this configurable.

Change-Id: I231976267ba6cdfeec622efaa15983a84c330649
2022-02-04 18:22:10 +00:00
jenkins-bot 5181d099ab Merge "PreferenceHooks: Don't call saveSettings in LocalUserCreated" 2022-01-12 21:58:04 +00:00
Ed Sanders 34011b7a07 Parser: Pass in title of page being parsed
Will be used to parse selflinks in the future.

Change-Id: I2bc29d1c5c69cb6309f582f162f9af7d96ce8913
2022-01-12 21:17:59 +00:00
Kosta Harlan f9f1884ac3 PreferenceHooks: Don't call saveSettings in LocalUserCreated
$user->saveSettings() happens in AuthManager after the LocalUserCreated
hook finishes running.

Bug: T199393
Change-Id: Ic661dbe1ffaa3a5438373a33c10ad3053662d932
2022-01-12 19:21:17 +01:00
jenkins-bot 6c5461d858 Merge "Treat user talk subpages like normal talk pages in empty state text" 2022-01-12 17:04:21 +00:00
jenkins-bot 6b31c89159 Merge "Ignore the beta feature setting when enrolling in the A/B test" 2022-01-12 01:59:04 +00:00
jenkins-bot ecd649f6e2 Merge "Allow logged out users to be enrolled in the A/B test" 2022-01-12 01:58:50 +00:00
David Lynch 893290d4b4 Ignore the beta feature setting when enrolling in the A/B test
We realized that any change made to Special:Preferences will set the
beta preference even if they didn't visit the beta tab, so we can't
actually tell if manual intent was involved. As such, we'll enroll
people regardless of their beta setting -- they can disable the feature
through regular preferences if they want, and that'll be respected.

Bug: T291307
Change-Id: I8c1cbf51060012e8e68af252da84944dfcc681d8
2022-01-10 18:10:50 -06:00
David Lynch 2f1e2f80e0 Allow logged out users to be enrolled in the A/B test
For logged out users we store their test state and an anonymous
identifier in local storage. So long as the test is enabled, we include
these in any logging that occurs.

This is done entirely client-side, to avoid any cache issues caused by
state depending on cookies from PHP for logged out users.

Bug: T291307
Change-Id: Ib39e2f2146cdfdac9df5690ee3de75718f0f2731
2022-01-10 18:10:50 -06:00
Bartosz Dziewoński d0dd6b3f73 Treat user talk subpages like normal talk pages in empty state text
Bug: T298454
Change-Id: I0b95f87fe934dcb7d233265b0a41956ed8f3c143
2022-01-03 16:36:08 +01:00
Bartosz Dziewoński d0eec56f6d Show a hint on legacy interface when arriving from new topic tool hint
Bug: T293962
Change-Id: I56823efb4e58839b3f121ff23d576984b86e4e81
2021-12-16 17:43:23 +00:00
David Lynch f24a73a05a Show a hint on the new topic tool to explain that it's new
This shows to users who are logged in and have more than 500 edits

Bug: T293962
Change-Id: Ic47fa897c6a4f43c27d4cfd5571e34f8acb01eb8
2021-12-16 16:01:38 +01:00
jenkins-bot f731b7a575 Merge "Update abtest bucketing for newtopictool usage" 2021-12-13 18:02:09 +00:00
David Lynch d228ca0f67 Update abtest bucketing for newtopictool usage
Trigger off the (absence of the) new preference for tracking topic tool
usage.

Change the name of the bucket preference so anyone who was enrolled in
the prior abtest won't find themselves re-enrolled.

Update the abtest enrollment code so it explicitly sets the preference
for the feature. This is a trade-off -- it does mean that we'll need to
special-case *unenrollment* once the abtest is disabled if we want to
just quietly revert people to the wiki's default, but it also means that
Special:Preferences will be accurate.

Bug: T291307
Change-Id: I659679e05b65fc7db05e249114e5a7de4cf55816
2021-12-13 18:45:37 +01:00
jenkins-bot 7dcb0ef4cf Merge "Revert "Split DiscussionToolsEnableMobile=true into 'behind-overlay' and 'remove-overlay'"" 2021-12-10 16:10:02 +00:00
Ed Sanders c71ca91171 Cache page properties in memory to avoid extra queries
Bug: T297132
Change-Id: I157c85bd905bf518cdf3d9da1d7504b3c0fb1475
2021-12-07 22:54:16 +00:00
Esanders 3cbca26bd0 Revert "Split DiscussionToolsEnableMobile=true into 'behind-overlay' and 'remove-overlay'"
This reverts commit 99b757465a.

Reason for revert: We may never need the 'behind-overlay' setting
and it is untested and probably broken.

Bug: T295816
Change-Id: I9e128862271697ece5241d0e98727174b42f54ff
2021-12-06 17:26:01 +00:00
Ed Sanders 8e4f08182e Add missing typehints
Change-Id: Ia25c5bea1834a3fdd26f32a9d5ed097789329824
2021-12-01 14:57:09 +00:00
Bartosz Dziewoński a38e1941e3 Cast 'discussiontools-betaenable' preference to bool
Bug: T296138
Change-Id: Ifff81ec330c3eb447c79f2b176654e7852d671dd
2021-11-22 20:08:55 +01:00
jenkins-bot e479c28459 Merge "First-run experience popup for automatic topic subscriptions" 2021-11-16 01:39:46 +00:00
Bartosz Dziewoński 9adbbccad8 Auto topic subscriptions disabled by default, enabled only for new users when out of beta
Bug: T294398
Change-Id: I909caaebbb976624a16f15361d4ee232007ff506
2021-11-15 23:36:03 +00:00
Bartosz Dziewoński 9ded06a655 First-run experience popup for automatic topic subscriptions
Bug: T262103
Change-Id: I9f9336718ad060d553146c4e27604565ce5822c6
2021-11-15 22:45:42 +01:00
Bartosz Dziewoński 0d57aa9762 Automatic topic subscriptions (on any edit)
Bug: T284836
Change-Id: Ia42ad087218fd91a0cdd1664157d1049738e3c01
2021-11-15 22:45:42 +01:00
David Lynch bd40523843 Set a user preference to record whether the new topic tool has been used
This will be used for an upcoming A/B test.

Bug: T294167
Change-Id: I494b0b3cf3ae568bec2b9cef80aeb22306896769
2021-11-15 10:25:51 -06:00
Bartosz Dziewoński 99b757465a Split DiscussionToolsEnableMobile=true into 'behind-overlay' and 'remove-overlay'
Bug: T295490
Bug: T295491
Bug: T280051
Change-Id: I1b96b0a22eec9e364c2ecbe8b734cebd0d157b96
2021-11-10 22:24:07 +01:00
jenkins-bot 3861aadbb3 Merge "Add links to Special:TopicSubscriptions in preferences" 2021-11-07 12:10:44 +00:00
Bartosz Dziewoński 312cce03db Add links to Special:TopicSubscriptions in preferences
Bug: T294994
Change-Id: Ifd564f435e300232d220896e5a29bd8f43db326c
2021-11-04 19:51:08 +01:00
Ed Sanders de4d4bfb21 Support new topic tool on mobile
* Use featuresEnabled.newtopictool to decide when new topic
  links might exist on the page, instead of relying on
  `#ca-addsection` existing. Change the logic of that feature
  flag to check if __NONEWSECTIONLINK__ is on the page.
* Render the add-topic button locally in a hook to replace
  the one suppressed by onMinervaNeueTalkPageOverlay. Do so
  whenever the newtopictool feature is enabled (see above).

Bug: T270537
Change-Id: I3e3f7403b3b86bb84fcb75a8833919512519b70f
2021-11-04 18:19:40 +00:00
David Lynch 7588a393e4 Use MinervaNeue hook to disable talk overlay if DT mobile enabled
Bug: T280051
Change-Id: I6a52adcfd8030b26649b609ca99902ff840e8fdf
2021-11-04 16:46:42 +00:00
Ed Sanders 900a01772f Support reply tool on mobile
Bug: T270536
Change-Id: I94d04e9cd442f9a4e0c5924da67c43a768417a8b
2021-11-03 17:49:06 +00:00
Bartosz Dziewoński 98bba62e5d Add [reply] link brackets during postprocessing after parser cache
This should avoid them showing up in unexpected contexts where parser
output is used (e.g. API T292345, search T294168, action=render).

Also rename some variables to be directionality-neutral.

Bug: T292345
Bug: T294168
Change-Id: Ibcac44ee10f0842e205d9dd9a7f3a935ce0c690b
2021-10-26 19:55:09 +00:00
Bartosz Dziewoński 884d1f6ec6 Move body classes code to BeforePageDisplay hook
Seems like a better place and it avoids duplication.

Change-Id: I26643c42cb7aa19cf0dfae449347f2fec2f8bc61
2021-10-26 17:42:39 +02:00
Bartosz Dziewoński 695a966a41 Remove unused non-parser-cache mode
Change-Id: Ief9f4153898b09a1ce15ccfdc8656dfad4642269
2021-10-07 17:59:10 +02:00
Bartosz Dziewoński dbb8b00ec7 Remove parser cache splitting ('dtreply' option)
Bug: T280599
Change-Id: I08b52874d575619308b5b83a39acfb6353c5b7b5
2021-10-07 17:59:10 +02:00
Bartosz Dziewoński e3af0bc65b Replace marker comment with limit report data
We always do our processing in the parser now, so we don't need the
marker comment to detect whether we've already processed the page.

Bonus: include the time taken by our processing in the limit report.

Bug: T291831
Change-Id: Ife7ddffbad1b1495b004739212002a98fdebe6c0
2021-10-07 17:59:10 +02:00
Alexander Vorwerk b73f4b1a70 Replace usage of deprecated PageProps::getInstance()
Bug: T289544
Change-Id: Ib4d86c298508b3dc56c44a4fa7314218f8a0d930
2021-09-26 00:48:51 +00:00