Commit graph

777 commits

Author SHA1 Message Date
Bartosz Dziewoński e9f5819d92 Fix replying when comments with the same name have different transclusion data
Follow-up to bfe6a36514.
We should only check the transclusion data for `comment.name` when
the data for `comment.id` is undefined, not when it's false.

Bug: T297850
Change-Id: Ia47462a7727edd551db88ec18b5b07017f669d2b
2021-12-16 01:23:58 +01:00
jenkins-bot eb0ca647ef Merge "Ensure highlighted comment is defined before we try to show auto topic sub popup next to it" 2021-11-29 19:24:05 +00:00
jenkins-bot 0e81c8520d Merge "Ensure we won't set 'seenautotopicsubpopup' pref when not showing the popup" 2021-11-29 19:24:03 +00:00
jenkins-bot 1cb8fb6e99 Merge "Don't try to load 'mobile.init' on non-mobile" 2021-11-29 19:24:02 +00:00
Bartosz Dziewoński b3b28dd1ab Ensure highlighted comment is defined before we try to show auto topic sub popup next to it
This was a logical merge conflict between 4912a1bf5c and 9ded06a655
that I didn't notice when rebasing the latter. Waiting for the
'mobile.init' module to load changes the order of operations if we're
highlighting the new comment after reloading a page, which we also do
after creating new talk page with the new topic tool.

Bug: T295945
Change-Id: Ief4810cc67c1bda9256585da1e2140b3a222dc5e
2021-11-18 16:01:00 +01:00
Bartosz Dziewoński 0110fe8b8d Ensure we won't set 'seenautotopicsubpopup' pref when not showing the popup
Change-Id: I20f1672bb40b07672474e81e7e59a440bf1f068b
2021-11-18 16:01:00 +01:00
Bartosz Dziewoński 3265b649cd Don't try to load 'mobile.init' on non-mobile
Change-Id: Ib988740e898f4163a1b97ba35a251c4275f44e80
2021-11-18 16:01:00 +01:00
Bartosz Dziewoński 72f806829c Ensure form tokens are not longer than allowed
Bug: T295940
Change-Id: I4e3fd5d3ef21274b104c4d22e3bab11043d61334
2021-11-17 23:53:38 +01: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
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
jenkins-bot 640f9cac65 Merge "Handle window resize in debug mode" 2021-11-10 19:55:02 +00:00
Ed Sanders dbe900b08c Handle window resize in debug mode
Change-Id: I1fdefd40b02a7d188c09b754b76aa658e7a18b76
2021-11-09 13:38:48 +00:00
Ed Sanders 7c3e583bec build: Update eslint-config-wikimedia to 0.21.0
Change-Id: I72de463d5a878e555eeed0e7ce2772e1d3a46f06
2021-11-08 19:03:40 +00:00
jenkins-bot 779c5acd4f Merge "Fix layout of [subscribe] links on desktop Minerva" 2021-11-05 23:29:41 +00:00
Bartosz Dziewoński 9daf5e1202 Fix layout of [subscribe] links on desktop Minerva
This is the minimal fix, they still look out of place, but they don't
break layout of the whole page.

Bug: T292241
Change-Id: I1538962dd266fb455051e4dfe2680e47c4d1bb4c
2021-11-05 23:24:28 +00:00
Bartosz Dziewoński 578be2f91e ReplyLinksController: Update teardown code
Follow-up to de4d4bfb21.

Change-Id: Ibc3293a43befbbb0af400b197993135d4492fe35
2021-11-05 20:21:22 +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
Bartosz Dziewoński 2d5af9608a Fix saving edit mode on mobile in reply tool
When this code was added in 5feb69612f,
it was inside the `if ( this.modeTabSelect ) { … }`, because switching
was an experimental option and could have been unavailable.

Switching is always available now, but the `modeTabSelect` widget
doesn't exist in the mobile version (because switching interface is a
part of the toolbar there), so this line should be outside the `if`.

Bug: T270536
Change-Id: I7c5959281e77558bfe82bd39d38ba4dda36d590c
2021-11-04 18:19:30 +00:00
Bartosz Dziewoński 4912a1bf5c Reload the page after posting a comment on mobile
MobileFrontend does not use the 'wikipage.content' hook, and its
interface will not re-initialize properly after we update the page
contents with the new comment. Reload the whole page instead.

Bug: T270536
Change-Id: I3f81e4d77faed367606e47678b8896051982359d
2021-11-04 18:19:06 +00:00
jenkins-bot f2bd9e84b4 Merge "Support reply tool on mobile" 2021-11-04 17:06:32 +00:00
jenkins-bot 9a677a9da0 Merge "UsernameCompletion: Disable fragment auto-select" 2021-11-04 16:57:20 +00:00
Bartosz Dziewoński d0f8794388 Handle JS exceptions in API error logging
When an exception is thrown by our code elsewhere, and caught by the
promise mechanisms, it bubbles up here in the `code` variable, and
`data` is undefined.

Change-Id: I8a0ac49d22d254f353797fc8978871502ae8b9de
2021-11-03 22:21:18 +01:00
Ed Sanders 900a01772f Support reply tool on mobile
Bug: T270536
Change-Id: I94d04e9cd442f9a4e0c5924da67c43a768417a8b
2021-11-03 17:49:06 +00:00
Ed Sanders 54471b5037 UsernameCompletion: Disable fragment auto-select
This causes the username to be selected on mobile, when
we want to place the cursor after it.

Bug: T294616
Change-Id: I29012ecd04cd553bf78ffff477babafacfeabb31
2021-11-02 23:35:29 +00:00
Ed Sanders 9b902bc46a UsernameCompletion: Fix limit parameter
`this.limit` is never set, which mean the API default of 10
was used.

The client limit is actually `defaultLimit` which is set to 8.
Double this so we can filter blocked users and still probably
have some results.

Change-Id: I8184fa0ce1527280f4503bcf638372421287f51a
2021-11-01 17:25:15 +00:00
Ed Sanders 62bc24cb86 UsernameCompletion: Filter out users with indefinite sitewide blocks from API results
Such users will never be able to reply to you on most pages,
so we shouldn't suggest pinging them. The may be able to reply
on their own user talk page, but in that case they will be
included in localUsers.

In the best case they just clog up your search results, in the
worst case they are offensive names which haven't yet been hidden.

Bug: T294783
Change-Id: I2445ed6dc98c10f8580b2c36106dd3e98bb876d6
2021-11-01 17:25:01 +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 9a8e33369b Merge "Allow more flexible overrides for the terms-of-use messages" 2021-10-28 15:05:16 +00:00
Ed Sanders f0149541b0 Update watchlist checkbox when main watchstar is changed
Bug: T294122
Change-Id: If50d5596fd86ed273658a275c9b3be31f39eaad7
2021-10-25 15:27:04 +01:00
Ed Sanders f4c12e120a Define documentable types in eslintrc instead of inline
These types can be passed a parameters to any file without
creating a dependency, so it makes more sense to allow
the globally.

Change-Id: I5504465fd997b46547642e7046993b370b85586e
2021-10-17 14:38:39 +01:00
jenkins-bot aa8ed1d469 Merge "Remove redundant checks" 2021-10-14 16:02:32 +00:00
Bartosz Dziewoński d83816f508 Remove redundant checks
The info in wgDiscussionToolsFeaturesEnabled already includes a check
for user options.

Change-Id: I01377e647b1dd5d06b67d1e0c7ee6940f1617066
2021-10-13 21:59:47 +02:00
jenkins-bot 3df2f3c623 Merge "modifier: Handle empty nodes in appendSignature()" 2021-10-13 17:26:56 +00:00
jenkins-bot a56d1a0a98 Merge "Re-enable wikitext paste conversion in source mode" 2021-10-12 15:19:45 +00:00
jenkins-bot 906cbe2d75 Merge "Compatibility with Microsoft Edge's translation feature" 2021-10-12 13:52:22 +00:00
Bartosz Dziewoński 8c6928aacf modifier: Handle empty nodes in appendSignature()
Bug: T292664
Change-Id: I0003528076e3981d639d337affcccbf394f59224
2021-10-11 22:17:46 +02:00
Bartosz Dziewoński 384fc2aa8d Re-enable wikitext paste conversion in source mode
The current experience (implemented in T282789) is unobtrusive and
maybe even helpful.

This reverts commit 35e97c24fe.

Bug: T281009
Change-Id: I0514e8f8960600edf12b51fff6de305e46cf8c34
2021-10-09 03:38:11 +02:00
Ed Sanders 605e7322b8 eslint: Lint root folder with server rules
Change-Id: I372eef293983bff0c79ad8aa0da1c7e5d07b1e44
2021-10-07 17:37:52 +01:00
Bartosz Dziewoński 59cba79c85 Compatibility with Microsoft Edge's translation feature
Bug: T292675
Change-Id: I7bc4dded7fdd522167d473dce4843d666c6e88fd
2021-10-06 21:01:10 +00:00
jenkins-bot c7d82f4ddc Merge "Remove uppercase of first character of auprefix" 2021-10-05 20:57:58 +00:00
Bartosz Dziewoński 11566e4b27 Allow more flexible overrides for the terms-of-use messages
Bug: T284097
Change-Id: Ibacd9397a40ffcc8a8127ec543cb2f7300ce5464
2021-10-05 17:58:37 +02:00
David Lynch 4211494ed7 Make reply links more robust so Google Translate won't break us
Normal link: `<a>reply</a>`

Google Translate: `<a><font><font>reply</font></font></a>`

Using jQuery's `closest` method to make sure we go up if the event
target isn't the data-mw-comment element should avoid problems.

Bug: T245563

Change-Id: I19ffb9a5b91617b98b0f00e4d185c01bcde093b0
2021-10-05 01:07:36 -05:00
jenkins-bot 268b704b48 Merge "Add a link to preferences within the Reply and New Discussion Tools" 2021-09-28 16:34:59 +00:00
Bartosz Dziewoński 4be0751517 Fix almost all errors codes being logged as http-0
Follow-up to b52699ad35.

Bug: T290514
Change-Id: If82f10c58872d990b9dfa7cbdc9b784454a5fa46
2021-09-28 13:14:29 +02:00