Commit graph

84 commits

Author SHA1 Message Date
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
jenkins-bot abd6c2fedd Merge "Enhance Echo user talk edit and mention notifications" 2021-09-24 02:17:57 +00:00
jenkins-bot 02a214d928 Merge "Put all checks for enabling the empty state for talk pages in one place" 2021-09-21 15:43:11 +00:00
Bartosz Dziewoński 4a824abd0d Apply page transformations only when viewing pages
Follow-up to e634701460. We didn't need
this previously, because we relied on the ArticleParserOptions hook
only being called when viewing pages.

Context from code reviews a year ago:
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/DiscussionTools/+/641837/comment/15ee0218_e4ab602f/
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/DiscussionTools/+/641837/comment/b62d4327_5ebc2e02/

Bug: T291459
Bug: T291460
Change-Id: I64f0be170719d874f5460934462917f4f13af6c1
2021-09-21 10:19:42 +02:00
Bartosz Dziewoński ca17555a67 Put all checks for enabling the empty state for talk pages in one place
They were spread across several places, and some of them were checking
different things, causing us to show the view mode on some
action=edit&redlink=1 links but without showing our empty state.

Bug: T291085
Change-Id: Id1864e58c47dbd22abb41d48e31f81318d9f94f9
2021-09-20 23:15:00 +02:00
jenkins-bot 152a663fb6 Merge "Always apply DiscussionTools page transformations" 2021-09-20 17:30:43 +00:00
Bartosz Dziewoński 435b0c65c7 Enhance Echo user talk edit and mention notifications
If the user talk edit or mention coincides with exactly one new comment:
* Change the primary link to be a direct link to the comment
* Add a text snippet to notifications that don't already include one
  (user talk edits that are not new sections).

This is done for all such notifications, regardless of whether anyone
has topic subscriptions enabled.

Bug: T281590
Bug: T253082
Change-Id: I98fbca8e57845cd7c82ad533c393db953e4e5643
2021-09-20 15:05:42 +02:00
David Lynch 46b6d76433 Enable email delivery for our notifications for new users by default
We're using the same approach as Echo is for its new-users-only settings

Bug: T287547
Change-Id: I1d8fff364da919caaf86af94cf5f0c6e40b67ff9
2021-09-15 23:54:30 -05:00
Bartosz Dziewoński e634701460 Always apply DiscussionTools page transformations
Bug: T273072
Bug: T280599
Change-Id: I0b39ef2f9ede15905951a54c043dd228bd5ace9f
2021-09-08 00:16:30 +02:00
Bartosz Dziewoński ce899aaadd Inject services in hook handlers where possible
Change-Id: Ie5c36cabd90412d2299b00d2b0c3c3bdf9ffc6d6
2021-09-07 22:51:35 +02:00
Bartosz Dziewoński 23d2255111 HookUtils: Remove unused variable
Change-Id: I3f8aec349a5845b3ea4d08d3257937467497f2a2
2021-09-03 19:13:34 +00:00
David Lynch 21600231d9 Empty states for anon/IP user talk pages
Bug: T287779
Bug: T288556
Change-Id: I9d01d1ac04c0cc443c4cbfe94d301db16f5b1ef6
2021-08-26 22:11:13 +02:00
Bartosz Dziewoński 3e19fce67a Load styles in ParserOutput too
We load them in OutputPage, because we need that to handle the
query parameter 'dtenable=1', but do it here as well just in case
the pages are somehow shown without involving OutputPage.

Per code review:
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/DiscussionTools/+/713681/1/includes/Hooks/ParserHooks.php#90

Change-Id: I3f287a9e146de7fd4d37c47dfa47eeb03eeb8cf1
2021-08-20 18:49:04 +02:00
jenkins-bot ccd2769b17 Merge "Remove remnants of the cookie hack for loading unavailable tools" 2021-08-19 16:32:10 +00:00
jenkins-bot 52ff6ef77e Merge "HookUtils: Simplify check for your own talk page" 2021-08-19 16:32:07 +00:00
Bartosz Dziewoński c8fa10770a Remove remnants of the cookie hack for loading unavailable tools
Follow-up to ee524d6bd6.

Change-Id: I1b4dc587e6b629b05ca0581dcd384a2bc7f01d2a
2021-08-18 20:45:02 +02:00
Bartosz Dziewoński 75d63bb056 Remove repetition in "Discussion pages" preferences
Bug: T289187
Change-Id: Id6c90546e4b57754e13b55f7c61610b51de87966
2021-08-18 20:20:34 +02:00
Bartosz Dziewoński 4aca61990a HookUtils: Simplify check for your own talk page
This approach is used in our new topic tool empty state code and is
much nicer. Also fix typo in a comment nearby.

Change-Id: I80755ef0960a172b0f370c36c1979a86498d6fa9
2021-08-17 22:22:15 +02:00
Bartosz Dziewoński ad04b24ffd Create a hidden revision tag for talk page comments
Bug: T262107
Depends-On: I21159d03eebaf46ad94f4273ba698a59b8019185
Change-Id: Iceddfaf6a4bcc5e8b5c85c8cd5638bf14aa7db03
2021-08-16 15:42:51 +00:00
vladshapik 613b0a9b27 Avoid using deprecated ParserOptions::getUser
Bug: T287858
Change-Id: I13ef6ef128a8316f699c6e038adf82d18bf81b96
2021-08-10 16:43:11 +03:00
David Lynch 93f2e64f3f Only show the empty state on talk namespaces
This should only affect some edge cases like the project namespace (e.g.
Wikipedia:Village_pump isn't a talk page, but does get discussiontools.)

Bug: T288317
Change-Id: I509101063a1d64d09cff71a84bf48c69ab7a8c08
2021-08-06 16:04:23 -05:00
David Lynch 91af0594b5 Apply an empty-state to pages with the new topic tool enabled
This includes the dtrepliedto URL functionality from
I3f81e4d77faed367606e47678b8896051982359d.

Bug: T274831
Bug: T274832
Bug: T277329
Change-Id: I035d04f30c8312b0cb42902d3bf940df1482ffb3
2021-08-04 18:46:28 -05:00
Bartosz Dziewoński cfbf437d9d Allow the new topic tool to handle URLs like action=edit&section=new
Depends-On: Ib9302e2fda7dadf1edc43c0107db7234eb4bdf7a
Depends-On: Ic7dd677ea219938969f60bab91387c2e03ebdbe6
Bug: T282204
Change-Id: I2e7b2682da7beb3c1c469bb784a9a8ec3998aeb9
2021-07-30 09:25:21 +02:00
libraryupgrader b0884b177c build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 36.0.0 → 37.0.0

npm:
* postcss: 7.0.35 → 7.0.36
  * https://npmjs.com/advisories/1693 (CVE-2021-23368)
* glob-parent: 5.1.1 → 5.1.2
  * https://npmjs.com/advisories/1751 (CVE-2020-28469)
* trim-newlines: 3.0.0 → 3.0.1
  * https://npmjs.com/advisories/1753 (CVE-2021-33623)

Change-Id: I7a71e23da561599da417db3b3077b78d91173bbc
2021-07-22 16:29:04 +00:00
David Lynch ae0aeff3a3 Allow dtenable=0 to disable DiscussionTools
Bug: T285578
Change-Id: Ic722285d51ea1a51593ab63fac516b4f992eb1c8
2021-06-29 21:20:35 +00:00