Commit graph

488 commits

Author SHA1 Message Date
Alexander Vorwerk 397dc2cea5 Replace usages of deprecated wfWikiID()
The global function wfWikiID() is deprecated since 1.35 and it's usages
should be replaced with WikiMap::getCurrentWikiId().

Bug: T298059
Change-Id: Ie878a5479b7427e9ffab7d7f92ee2802997e3161
2021-12-21 01:45:54 +00:00
Umherirrender d32dcfbb3c Use ParserOptions::newFromAnon instead of ParserOptions::newCanonical
ParserOptions::newCanonical is deprecated.

Change-Id: I26667c9102c37d962ceaa81c082566819b503744
2021-12-18 20:15:02 +01:00
jenkins-bot fb16305135 Merge "Show a hint on legacy interface when arriving from new topic tool hint" 2021-12-17 17:30:39 +00:00
jenkins-bot e568c62f85 Merge "Show a hint on the new topic tool to explain that it's new" 2021-12-17 17:30:37 +00:00
jenkins-bot be07ec8cfc Merge "Add Range::compareBoundaryPoints" 2021-12-17 16:48:04 +00:00
jenkins-bot c4fb0f7046 Merge "Change auto topic subs to re-subscribe you if you unsubscribed" 2021-12-17 15:32:40 +00:00
jenkins-bot 0f32a760b4 Merge "Move some helpers from CommentParser to CommentUtils" 2021-12-17 01:02:26 +00:00
Bartosz Dziewoński 12aa136f54 Add Range::compareBoundaryPoints
Change-Id: I7b8b9f196bb1ed95304d8b7755d51246c4515bc9
2021-12-17 00:55:00 +00:00
Ed Sanders 4a88be8084 Move user subscription limit to config
This makes it easier to change going forward, and
configurable on 3rd party wikis.

Bug: T294881
Change-Id: I9e5343cab42cb00ed6b62cf5adf9e02b072481f1
2021-12-16 21:07:40 +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
Ed Sanders d2443f7785 Rename DiscussionToolsAutoTopicSubWhere to DiscussionToolsAutoTopicSubEditor
Better describes that we are checking the editor used to make
the edit, rather than descibing some virtual "location".

Change options to 'discussiontoolsapi' and 'any'.

Change-Id: I3024517e70ed61c738e4bf46a2ac7b58c975d98a
2021-12-15 16:24:35 +00: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
Bartosz Dziewoński ef7274d69e Move some helpers from CommentParser to CommentUtils
Change-Id: I0e323d3b75f47459a5548a13e9684f4c6ff4ba0c
2021-12-13 17:13:41 +01:00
jenkins-bot 43c2a3204f Merge "Add 'legacyPrimary' links to API data for users without DT-enhanced HTML" 2021-12-10 18:03:23 +00:00
jenkins-bot 7dcb0ef4cf Merge "Revert "Split DiscussionToolsEnableMobile=true into 'behind-overlay' and 'remove-overlay'"" 2021-12-10 16:10:02 +00:00
Bartosz Dziewoński a96c52869b Fix PageRecord lookup
According to Daniel it only worked by accident, and stopped working
after de63ad823abe:

getPageByReference() used to do an opportunistic lookup by ID when given
an instance of PageIdentity -- which is correct for EventDispatcher,
but problematic in the general case, causing T296063.

The correct thing to do here is to use getPageById(), since the canonical
association between revision and page is by page ID.

Bug: T297431
Change-Id: Icc1df0c9ca5345e65ef5f8daf0815013d7db0943
2021-12-10 12:46:55 +00:00
Ed Sanders dd896deb45 Add 'legacyPrimary' links to API data for users without DT-enhanced HTML
The 'legacyPrimary' links will take you to the section
the comment is in and should be used when you don't have
access to comment IDs.

Bug: T296018
Change-Id: I944feb90e7c3a69f81366f42fa110c58cac26dbb
2021-12-09 15:20:26 +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 d3a7476cef Change auto topic subs to re-subscribe you if you unsubscribed
Bug: T295950
Change-Id: I7d3136c8bd7042b03487d85decea30a56dc3cde6
2021-11-29 21:37:11 +01:00
jenkins-bot 38c38b8201 Merge "Cast 'discussiontools-betaenable' preference to bool" 2021-11-24 12:56:05 +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
David Lynch 17a3ac295e Fixes for talk_page_edit logging
* Add a N/A value for edit counts from anonymous users
* Only oversample with $wgDTSchemaEditAttemptStepOversample if the edit
  is from DiscussionTools
* Consider $wgWMESchemaEditAttemptStepOversample for oversampling

Bug: T286076
Bug: T295995
Depends-On: Ieb3f6c6e1775c1ef53747c37003b17e3634d1c44
Change-Id: I91245a61dfbde8b5ec9b2893b9170cc4d73f7b0a
2021-11-19 17:02:15 +00: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 90283b3a7e Update the [subscribe] buttons when auto-subscriptions are added
When our interface initialized on a page that the current user
recently edited (using the reply tool, the full-page source editor,
or any other way), check if any new automatic topic subscriptions
were added and update the interface to reflect that.

This requires doing some API requests after the page is loaded,
because adding auto-subscriptions happens asynchronously in a
DeferredUpdate (potentially after the user is already viewing
the page with their comment saved), and depends on the contents
of the edit.

(When using the reply tool, we could avoid this API request and
replicate the logic, but that's not implemented in this commit
to keep it simple.)

Bug: T284836
Change-Id: Ic0fabda0de4ebbc5e424f49641e6b03ebb4b7e6a
2021-11-15 22:45:42 +01:00
Bartosz Dziewoński 8d3cf30f60 Automatic topic subscriptions (only for reply tool and new topic tool)
Bug: T284836
Change-Id: I0f98c26c997f66b7a43cd4b971fe72a37d12db5d
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
jenkins-bot 9fbf2b3177 Merge "Avoid splitting about-groups starting with an empty <span>" 2021-11-15 21:38:56 +00: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 83ba496919 Avoid splitting about-groups starting with an empty <span>
Usually this isn't a problem, because the comments are marked as
template-generated and we don't allow replying to them. But we had a
special case where we were trying to skip over some invisible
elements, which was causing us to skip into the middle of the
about-group in some cases. When Parsoid sees that, it serializes the
contents twice.

Bug: T290940
Change-Id: I9fe0b8d43ab874ccef371990799f77bfc46bc954
2021-11-15 16:03:38 +00: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
Ed Sanders 0fba9b0048 Suppress events from comments that are more than 10 minutes old
Bug: T290803
Change-Id: Ic0e23f439eef8a1b785f408d4557bec0abe9104b
2021-11-09 16:37:46 +00:00
Ed Sanders a86d308d66 CommentItem.php: Store timestamp object instead of string
We do something similar in CommentItem.js with a moment object.
The object can be converted to a string when required.

Change-Id: Id7221e9201db0d89c3b771574634c878c9515ca0
2021-11-09 16:37:45 +00: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
jenkins-bot 10111ea872 Merge "Generate form tokens in the client to prevent double posting" 2021-10-29 22:32:47 +00:00
Ed Sanders 6022982eb9 Generate form tokens in the client to prevent double posting
Store used tokens in session storage.

Bug: T286409
Change-Id: I88c81689d9cf3447f6cc77c849a84d52c8b2c0db
2021-10-29 00:17:14 +01:00
jenkins-bot 37397e1769 Merge "Logging for new comments" 2021-10-28 21:54:38 +00:00
David Lynch df47f9fda3 Logging for new comments
Bug: T286076
Change-Id: Ic78a49aedcb03d160d74ba3fa9660f3583f0e568
2021-10-28 21:50:23 +00:00
jenkins-bot 5bccc9452c Merge "TopicSubscriptions: Rename 'actions' column and unframe button" 2021-10-28 21:05:43 +00:00
jenkins-bot 93e7f10e68 Merge "TopicSubscriptions: Hide broken "Topic" sort" 2021-10-28 21:05:40 +00:00
jenkins-bot 9a8e33369b Merge "Allow more flexible overrides for the terms-of-use messages" 2021-10-28 15:05:16 +00:00