Commit graph

3916 commits

Author SHA1 Message Date
gerritbot 5a51c63687 Update UserOptionsLookup's FQN
User-options related classes are being moved to the MediaWiki\User\Options namespace in MediaWiki Core; reflect that change here.

Bug: T352284
Depends-On: I9822eb1553870b876d0b8a927e4e86c27d83bd52
Change-Id: Iaf161106c323461929abe9b8a021bbb3e34c4ae7
2023-11-30 17:35:15 +00:00
Bartosz Dziewoński 978d2c54a4 Tweak CSS to deal with Parsoid's <section> tags
* The :first-child pseudo-selector to suppress top border of the first
  div.ext-discussiontools-init-section ends up suppressing top borders
  of all these divs since they are the first child of a <section> tag
  in Parsoid's HTML.

  Add `.mw-parser-output >` to these selectors, so that they don't apply
  when <section> wrappers are present in Parsoid's HTML.

* Re-implement the logic for suppressing top border with new selectors
  that work correctly with Parsoid's <section> wrappers.

  Note that one of the cases requires using the :has() selector, which
  is not supported by all browsers yet. This should not be a big deal
  in practice, as that case should be rare on Wikimedia projects.

* This can be reverted if T333031 decides to strip <section> tags
  from Parsoid's read view HTML.

Bug: T333031
Bug: T341010
Change-Id: If513c90033e9a77c8885b3b1c937e016064cc5ba
2023-11-30 18:15:35 +01:00
Bartosz Dziewoński 8271401e73 Compatibility with styles for new heading HTML
(split off from I5ab9d3373a6911c1456c30d844b66576b278a1b5)

Bug: T13555
Depends-On: I44587461582d648b56ef0c9c7ae0c322895c69c2
Change-Id: Ia32d3b3ac0de2f17401fc1a26c1fe451f273c688
2023-11-30 18:13:31 +01:00
Ed Sanders bd8793ba99 Apply slim button styles to all inline buttons
Prevents the yet-to-be-used overflow button from affecting
the line height.

Change-Id: I2f76e397f6205edd52a33a87ef1445e5752b16e2
2023-11-30 16:33:58 +00:00
Translation updater bot a03f1d945f Localisation updates from https://translatewiki.net.
Change-Id: I88706c7bcfc69f72d15ecca4b3d7f3edf112534a
2023-11-30 09:37:52 +01:00
Translation updater bot 6eb29f94bf Localisation updates from https://translatewiki.net.
Change-Id: I3e02147cceb3ef1c202dab7ce061ec98a104b07b
2023-11-29 08:30:54 +01:00
jenkins-bot fdfc9a266e Merge "Remove small pieces of unused code from PageHooks class" 2023-11-28 20:22:10 +00:00
jenkins-bot da2e527840 Merge "Work around Parsoid's messy handling of some extensions" 2023-11-28 20:17:36 +00:00
Ed Sanders f2f0ec2f65 build: Update linters and fix
Change-Id: Iec16f3330f94d38bb50492b7dcc9207786b964a4
2023-11-28 16:10:47 +00:00
thiemowmde 12e7fba827 Remove small pieces of unused code from PageHooks class
Change-Id: I557bfb0f688d3e9455b5187df3cbbe67697fbd55
2023-11-28 15:39:20 +00:00
thiemowmde 00ad50c673 Use upstream Title::inNamespace() instead of manual comparisons
This might be a matter of personal preference. Not sure if it's
worth it. Both is well readable. On the other hand, the method
exists. Why not use it?

Change-Id: Id66fc6c888db6ae1cf28e60a51f90d9ae2cdb6ee
2023-11-28 09:49:00 +01:00
Subramanya Sastry bea2b1478d Work around Parsoid's messy handling of some extensions
* See T351461#9358034 for details

Bug: T351461
Change-Id: If438e99284018e3b78f4c2fc22ce714322877cf7
2023-11-28 03:00:27 +00:00
jenkins-bot 8ab8831db7 Merge "Revert "ParserOutputPostCacheTransform: Don't reprocess content"" 2023-11-27 17:34:41 +00:00
Translation updater bot cd44ce34fa Localisation updates from https://translatewiki.net.
Change-Id: I2712ad0fecab605b66d113d0e7bfb56b5ab731d4
2023-11-27 08:32:11 +01:00
Subramanya Sastry e42450cd4f Revert "ParserOutputPostCacheTransform: Don't reprocess content"
This reverts commit 7aaaf51dfd.

Reason for revert: This is not right and doesn't work either.
See T351461#9358034 for why this strategy will not work right now.
We need a different strategy to prevent duplicate transforms if
they continue.

Change-Id: I97efee9197359ecdccdf89a0be850a707a11cc98
2023-11-26 22:06:39 -06:00
Translation updater bot b0def0e553 Localisation updates from https://translatewiki.net.
Change-Id: I4c6f412ffda6789cf4c85e4419dc954cf986158a
2023-11-23 11:56:12 +01:00
jenkins-bot 9699e57275 Merge "SpecialDiscussionToolsDebug: Replace Title::getPageViewLanguage()" 2023-11-22 21:55:13 +00:00
Translation updater bot 6e67252a02 Localisation updates from https://translatewiki.net.
Change-Id: If4020f9eec1036706d65eceacb07ee45d01907dd
2023-11-22 08:19:52 +01:00
jenkins-bot 4f5a91ba52 Merge "ParserOutputPostCacheTransform: Don't reprocess content" 2023-11-21 15:56:14 +00:00
Translation updater bot 15c4455e06 Localisation updates from https://translatewiki.net.
Change-Id: I4cac7e1d4ae2523f7a970a66899181272cef7bbc
2023-11-21 08:28:57 +01:00
Subramanya Sastry 7aaaf51dfd ParserOutputPostCacheTransform: Don't reprocess content
* getText() could be called multiple times on a ParserCache object
  which would fire the ParserOutputPostCacheTransform handler
  multiple times.

  But, I could not track down how this could happen right now.

* As a separate issue, while conceptually there are no restrictions
  against calling getText() multiple times, there is a semantics and
  performance issue if that did actually happen. getText() does a
  bunch of transformations and makes no effort to avoid duplicate
  work. It will accumulate more transformations over time via the
  OutputTranform pipeline and it is preferable for getText() and/or
  the OutputTransform pipeline to guarantee semantics where the
  pipeline won't be run multiple times on the same content. That will
  free both hook handlers (like this) and the transforms themselves
  to avoid checks as in this patch.

  This patch should be reverted once such a change is made to core.

Bug: T351461
Change-Id: If5dfa0954e3fd2b7dbea1ed29b475be07f0f3986
2023-11-20 13:31:43 +00:00
Translation updater bot cbf6cd01a2 Localisation updates from https://translatewiki.net.
Change-Id: I7fdabe97707898826985d5e0664bcf8488b6b972
2023-11-20 08:51:17 +01:00
jenkins-bot 8ac48ff183 Merge "Make hiding of reply links in mw-archivedtalk !important" 2023-11-17 16:21:19 +00:00
David Lynch 0888bf2e27 Make hiding of reply links in mw-archivedtalk !important
This was being overridden by a later rule that only affected reply
buttons on mobile.

Bug: T351542
Change-Id: Iad2f6b703827cccf46ad5909d11fe3912d7023d5
2023-11-17 09:52:46 -06:00
Translation updater bot d0df9aaa09 Localisation updates from https://translatewiki.net.
Change-Id: Ic60a41e28e7f658ef868b1305da62e393fb60914
2023-11-17 08:52:30 +01:00
jenkins-bot 43df071836 Merge "Document generated CSS classes" 2023-11-16 21:03:28 +00:00
Translation updater bot 9d06953315 Localisation updates from https://translatewiki.net.
Change-Id: I5ad26be02fb553e1421f5d368684ccc8583a0e08
2023-11-15 15:43:33 +01:00
jenkins-bot 1cbba98cad Merge "Drop meaningless VisualEditor version number 0.1.2" 2023-11-14 20:57:54 +00:00
Translation updater bot 3f930983c5 Localisation updates from https://translatewiki.net.
Change-Id: Iaa582b024eb9ebcfc8acf47c1c0565214c3384aa
2023-11-13 08:40:45 +01:00
David Lynch 26b63503a9 Only change mobile indicator alignment when enhancements are enabled
This was causing a misalignment on mobile pages that loaded the DT
styles but didn't have visual enhancements enabled.

Bug: T351044
Change-Id: Ib5e392943331467c3d29ee2b10d3bbe4995137d0
2023-11-12 19:43:19 -06:00
Bartosz Dziewoński 90c6e64a49 SpecialDiscussionToolsDebug: Replace Title::getPageViewLanguage()
Bug: T350806
Change-Id: Iaf6d849867af4ce2cdc8210ae4707a6744b271dd
2023-11-10 02:44:34 +01:00
jenkins-bot 89bab42a23 Merge "Notify when we can't find a comment from a reply-link" 2023-11-10 01:19:01 +00:00
Subramanya Sastry a1c5130414 Add ParserOutputPostCacheTransformHook handler for Parsoid HTML
* This patch enables DT to work with Parsoid HTML without changing
  the functionality for legacy HTML.

* The code comments document some of the decisions being made here.
  Some of these decisions are temporary and need better solutions
  but this patch will let us run visual diff tests and expose any
  other latent bugs.

TODO
----
* We need to add new tests to verify CommentFormatter expectations
  for Parsoid HTML. I'll tackle this in a followup patch.

Known issues:
-------------
* Performance: Since the getText() transformed output in ParserOutput
  is not cached, if DiscussionTools is to switch over to Parsoid HTML,
  we have to add some form of caching of the transformed output because
  transformHtml can take a couple seconds in the p99 case which is too
  long to render uncached!

* Longer-term: Since this hook is called when getText() is
  called, all calls to getText() will now invoke this handler
  (which will return but still has to do a bunch of checks to
  determine this won't apply). Presumably, transformHtml() is
  idempotent because when some other code (other extensions, for ex)
  calls getText(), we will run the transfromHtml() on previously
  transformed content.

  My understanding is that getText() is going the way of the dodo
  and that getText() callers will have to explicit call the output
  transform pipeline code (and presumably this issue of repeatedly
  calling the same transforms on previously transformed content will
  be addressed there).

* Some CSS doesn't apply to Parsoid HTML because intervening <section>
  tags interfere with existing query selectors -- will be addressed
  separately.

Bug: T341010
Change-Id: I9846193656cdc658f5237df0a133d9d4dcc20d00
2023-11-09 18:37:56 +00:00
Ed Sanders 21e60ddeb1 Document generated CSS classes
Change-Id: I4a60e2faa81585b94b485b33ba0052a90d3f618b
2023-11-09 12:45:22 +00:00
Translation updater bot 4613058afb Localisation updates from https://translatewiki.net.
Change-Id: I89576f4164420140c0446885b9d84dd276c361c7
2023-11-09 10:40:35 +01:00
Translation updater bot 9b8088acab Localisation updates from https://translatewiki.net.
Change-Id: Ia58d7ff6e32b099a145bc44c4da419dbdcec6e38
2023-11-08 13:07:29 +01:00
David Lynch b3a838fc38 Notify when we can't find a comment from a reply-link
This requires something like an invalid timestamp, to produce a reply
link whose associated comment ID is going to not be findable.

Bug: T350633
Change-Id: Ib50c11096b9af9961b74309b60524a4b986e04aa
2023-11-07 11:59:03 -06:00
Translation updater bot 61586134a7 Localisation updates from https://translatewiki.net.
Change-Id: I671e3558d72316c5ca6167f9a65e344605af6c78
2023-11-07 09:07:42 +01:00
Translation updater bot a801e65cc9 Localisation updates from https://translatewiki.net.
Change-Id: I951f1b1d2ec091e7eeb05d1e6b89318a5698b522
2023-11-06 08:56:09 +01:00
David Lynch f8954ca466 Fix typo in discussiontools-emptystate-desc-self-temp
I'd reversed the order of "to access".

Bug: T338171
Change-Id: I6c8e8007dd74447230e73f5ccc9be46bfd73a4c9
2023-11-03 21:01:58 -05:00
David Lynch c6dc42ad97 Update temp account copy for empty states
Bug: T338171
Change-Id: Id74bf31ace60afb9ff623bf3c135fcb0c1b5ef76
2023-11-03 18:12:30 -05:00
jenkins-bot e55905ddeb Merge "Use top alignment for buttons on mobile talk pages" 2023-11-03 21:11:32 +00:00
Ed Sanders e0a841fe0a Use top alignment for buttons on mobile talk pages
Bug: T344629
Change-Id: Ic81a146e57fd00f2a9d83686e91d9424c2e404bd
2023-11-03 18:58:19 +00:00
Bartosz Dziewoński 5b1013124d ApiDiscussionToolsEdit: Remove unnecessary checks
According to EventLogging 'editattemptstep' data the error hasn't
happened in the last 90 days, and according to Logstash data the
warning hasn't happened in the last 90 days either.

The problem this guards against shouldn't be possible in a world
without RESTBase, but keep the checks as assertions just in case.

Change-Id: Id7eaf14294f8a7bb877f6a0e00a90976e560fc54
2023-11-03 16:55:06 +01:00
Translation updater bot 3a106cbcf1 Localisation updates from https://translatewiki.net.
Change-Id: Icfc21518eb5c80491614a2944e39628dd6302255
2023-11-03 08:58:48 +01:00
jenkins-bot ad21432602 Merge "Update autocreate warning copy for editors" 2023-11-02 22:12:39 +00:00
jenkins-bot e2f396fc99 Merge "Rewrite ImmutableRange::findCommonAncestorContainer for speed" 2023-11-02 18:41:29 +00:00
jenkins-bot 9db081c8b0 Merge "Document generated messages" 2023-11-02 17:47:18 +00:00
Ed Sanders be02707e10 Document generated messages
Change-Id: If91a32a48055b5f7d408151c7d2845f07ebd5e27
2023-11-02 16:29:54 +00:00
thiemowmde e739e6c4df Rewrite ImmutableRange::findCommonAncestorContainer for speed
While this method is not a huge bottleneck in this codebase it still
sticks out because it calls end() and array_pop() literally millions
of times. (Tested by running the unit test suite, which currently
takes about 30 seconds on my machine.)

Because of the way the method is used in this codebase (see especially
ImmutableRange::computePosition) $a is almost always a sub-element of
$b, or the other way around. It's almost never necessary to go all the
way up to the root element. We can use this additional knowledge and
stop much, much earlier. The extra code is worth it because we know it
will succeed very, very often.

When I measure the runtime of this method alone it goes down to less
than 1% of the previous runtime. The final loop at the end of the
method is almost never executed now (about 30 times in 15,000).

I also micro-benchmarked the final loop and optimized it to work with
passive array-indexes instead of actively manipulating the array with
array_pop().

Change-Id: Iffcaa8848780a85fde38e322649050c687567f29
2023-11-02 13:57:23 +01:00