Commit graph

3285 commits

Author SHA1 Message Date
Bartosz Dziewoński 5ad0a7bfcb Add comments about unwrapping Parsoid sections
Follow-up to c9deff179f.

Change-Id: Ib32442020749103012ec508d870d40b7b96f05a0
2023-01-27 17:07:56 +01:00
jenkins-bot e97d9c3dfa Merge "Don't rely on ParserOutput::getTOCHTML() to determine if ToC is present" 2023-01-27 10:13:37 +00:00
C. Scott Ananian 086ce6550f Don't rely on ParserOutput::getTOCHTML() to determine if ToC is present
ParserOutput::getTOCHTML() is being deprecated, and all skins are now
generating the TOC from the TOCData returned by
ParserOutput::getTOCData().  The SHOW_TOC flag was introduced in core
to determine if the TOC should be shown, but Vector-2022 *may* begin to
use other heuristics to determine whether to show the TOC (T315862).
We're conservatively going to process the TOC as long as there is
TOC present to process.

Bug: T328072
Change-Id: I38b439c6752157dbee9b09c9f5443a740dbaabf4
2023-01-27 09:58:47 +00:00
Translation updater bot cf10fb1566 Localisation updates from https://translatewiki.net.
Change-Id: I7d3496310e708d0af4e10b8002f5ceef70de28c3
2023-01-27 08:36:01 +01:00
Bartosz Dziewoński c9deff179f ApiDiscussionToolsEdit: Unwrap Parsoid sections before parsing
Otherwise, when a transclusion covers a section boundary, both whole
sections are considered to be transcluded.

We already use this method everywhere else (by way of
HookUtils::parseRevisionParsoidHtml), and VisualEditor also applies
the same transformation (mw.libs.ve.unwrapParsoidSections) before
opening the page for editing.

Bug: T327704
Change-Id: I9d8288e2740d816edb9cbc01d7e5642d52c610d3
2023-01-26 19:26:14 +00:00
Bartosz Dziewoński ff77db5ef4 Temporarily disable failing test
Bug: T328072
Change-Id: I6613cb8c2673be82ccd030639015bb626b2fe21b
2023-01-26 20:25:23 +01:00
Translation updater bot 3224d23c95 Localisation updates from https://translatewiki.net.
Change-Id: If1da3c196fa978bcfe11fa987469d5a4fe453902
2023-01-26 08:51:21 +01:00
Bartosz Dziewoński 06919f9444 Always reset ReplyLinksController before re-initializing
Previously we only did it when re-initializing after saving a reply
using our tools, but it could happen for a different reason, such as a
NWE edit.

Bug: T317035
Change-Id: Ia8152fc83f74689802f8dbbc20607c9026a2a5ab
2023-01-24 16:42:43 +01:00
Bartosz Dziewoński a5a026ceba Restore autosave for new topic when only title was provided
Bug: T315730
Change-Id: Ib68ebd23d3c4ef8e577023465236b4391b00bf2c
2023-01-24 14:28:17 +01:00
Bartosz Dziewoński 1fb67ef63d Fix summary when topic title is changed after restoring from autosave
Previously, we would restore the title and the summary generated from
it, but we wouldn't restore `prevTitleText`, so we would lose track of
the fact that it was automatically generated, and stop updating it
because of that.

Instead of adding it to the stored data, let's instead stop storing
automatically generated summaries, and tweak the code to support
generating them when restoring.

Bug: T315730
Change-Id: I96420bc0a3e34373190d2c2c0db2e2175ad3156d
2023-01-24 14:28:17 +01:00
Bartosz Dziewoński f292c703ca Remove some px font-size overrides on topic metadata and buttons
After T314714, they are no longer needed for Vector, MonoBook etc. –
the elements will just use the normal body font size.

This changes the font size slightly on some skins (MonoBook, Timeless),
but I think that's okay.

We still want to customize the font-size for mobile (Minerva), and
we can do that with `em` now.

Bug: T325104
Change-Id: I3fab8588b1b0e3a43aac4c32a3610f64fb3d3fb3
2023-01-24 10:21:31 +00:00
Translation updater bot ada5c68b7c Localisation updates from https://translatewiki.net.
Change-Id: I0595d4f1e8052a944108313d463332a17964b38a
2023-01-24 08:48:32 +01:00
Bartosz Dziewoński 88e4956711 Hide "Add topic" footer on talk pages when empty state is shown
We already have code to hide it (added in a98cd369ba),
but this code (added in b132522fa9) made it reappear.

I think this rule was added in the development of that
change when the class was placed on a ButtonWidget,
to override `display: inline-block` on it, but it was
then moved to another element, removing that need.

Bug: T327536
Change-Id: I2a162dde93d04d76f6d5540edf6d3c4719a67f92
2023-01-23 21:16:11 +01:00
jenkins-bot 1f342306b4 Merge "Update exception handling for new code conventions" 2023-01-23 15:32:40 +00:00
jenkins-bot b857a61c75 Merge "SpecialFindComment: Use new FormSpecialPage helpers" 2023-01-23 15:27:59 +00:00
jenkins-bot c848386544 Merge "Remove 'DiscussionToolsLegacyHeadingMarkup' config option" 2023-01-23 15:26:59 +00:00
jenkins-bot 615545395e Merge "Hide the Source/Visual tags on DiscussionTools edits" 2023-01-23 15:26:56 +00:00
Translation updater bot 482f8c610d Localisation updates from https://translatewiki.net.
Change-Id: I45b241044f13cadacfd16e03c7366ce1e989c4bb
2023-01-23 08:22:48 +01:00
Bartosz Dziewoński 48fd5e09bb Remove 'DiscussionToolsLegacyHeadingMarkup' config option
Bug: T314714
Change-Id: Ie268d1282f81c81c5a18d5858dcf7023515101b7
2023-01-22 19:24:36 +01:00
Bartosz Dziewoński af68c835bb Update exception handling for new code conventions
Change code to match the documented consensus formed on T321683:
https://www.mediawiki.org/wiki/Manual:Coding_conventions/PHP#Exception_handling

* Do not directly throw Exception, Error or MWException
* Document checked exceptions with @throws
* Do not document unchecked exceptions

For this extension, I think it makes sense to consider DOMException an
unchecked exception too (in addition to the usual LogicException and
RuntimeException).

Depends-On: Id07e301c3f20afa135e5469ee234a27354485652
Depends-On: I869af06896b9757af18488b916211c5a41a8c563
Depends-On: I42d9b7465d1406a22ef1b3f6d8de426c60c90e2c
Change-Id: Ic9d9efd031a87fa5a93143f714f0adb20f0dd956
2023-01-22 18:17:11 +00:00
jenkins-bot 87d67d4a1c Merge "Use localStorage for auto-save" 2023-01-21 09:58:30 +00:00
Ed Sanders 9d331d0c86 Use localStorage for auto-save
Bug: T218663
Depends-On: Idcf50a527e2386122d077c497477057657824646
Change-Id: I514e5340d8bce3dd10a1142e7cced49edee5c9db
2023-01-21 09:25:55 +00:00
jenkins-bot 7d231582fe Merge "Tweaks for new heading HTML structure" 2023-01-20 12:50:50 +00:00
Translation updater bot c181489732 Localisation updates from https://translatewiki.net.
Change-Id: I166b96c6098c562ddfaeef58c42a1384cc8cfbba
2023-01-20 08:41:27 +01:00
Bartosz Dziewoński 66e2042598 Hide the Source/Visual tags on DiscussionTools edits
Bug: T326670
Change-Id: Iffd712dafb2af8d6c90bc8568aa4aa8f229ba352
2023-01-20 07:30:46 +01:00
Bartosz Dziewoński 6d8f92a6b2 Tweaks for new heading HTML structure
Bug: T327328
Bug: T327469
Change-Id: I8c7593e98dc677b28925129dda592dbc24106220
2023-01-20 06:23:23 +01:00
Bartosz Dziewoński cfd76f5eb0 Add test for DiscussionTools TOC additions
We verify that they appear in the action=parse API output.

We should also have a test to verify that they appear in the Vector
2022 skin, but that might have to be done as a browser test.

Bug: T326677
Change-Id: I81d5ddecd3b244aeee8cba71498f4d65f8e53696
2023-01-19 21:59:50 +00:00
jenkins-bot b7405bb006 Merge "Update generating DiscussionTools TOC additions after parser changes" 2023-01-19 21:37:04 +00:00
Bartosz Dziewoński 228ad6f457 Update generating DiscussionTools TOC additions after parser changes
Depends-On: I8329864535f0b1dd5f9163868a08d6cb1ffcb78f
Depends-On: I1b267d23cf49d147c5379b914531303744481b68
Bug: T326677
Change-Id: Id59b946f4a3618a75dfaaef8a0043423b768b21c
2023-01-19 13:29:16 -05:00
Translation updater bot 327bdb8d13 Localisation updates from https://translatewiki.net.
Change-Id: Ieab8949cd6c895860e5c89b9b75c8d6ab393a25e
2023-01-19 11:31:17 +01:00
Translation updater bot 70afff650e Localisation updates from https://translatewiki.net.
Change-Id: I00d53ed19ee5d2cbde61b36c8be26a65310ead0a
2023-01-18 08:29:17 +01:00
jenkins-bot 3c675b577e Merge "composer: Update mediawiki-codesniffer to 40.0.1" 2023-01-17 15:06:37 +00:00
jenkins-bot 8facd83609 Merge "Improve handling for comment separators" 2023-01-17 11:48:43 +00:00
jenkins-bot 63c236edba Merge "Add another test case for {{tracked}} template" 2023-01-17 11:48:39 +00:00
jenkins-bot ba2f6ac2cf Merge "Flip the reply button icon on RTL" 2023-01-17 11:47:38 +00:00
Ed Sanders f595c9c08a composer: Update mediawiki-codesniffer to 40.0.1
Change-Id: If953d807a0146e6d3cb6113539d826f399b0a6c0
2023-01-17 11:45:27 +00:00
Translation updater bot fce46840a6 Localisation updates from https://translatewiki.net.
Change-Id: I84e1ea651137462cef2f56a8fe6556fd9f5f68fc
2023-01-17 08:07:18 +01:00
jenkins-bot 8b8dba6124 Merge "Test ServiceWiring.php" 2023-01-17 05:53:07 +00:00
Umherirrender ecac4c3bd1 LanguageData: Use special page alias with spaces
The alias stored in the language files is with underscores,
but the value is compared in CommentParser against text with spaces

Affected languages: bjn, hu, id, jv, kaa, tl, tpi, vi, war

Bug: T327021
Change-Id: I8626627d10a240973e631e24508937a9eee9fb14
2023-01-16 22:27:23 +01:00
Translation updater bot 25d555087f Localisation updates from https://translatewiki.net.
Change-Id: I254a2de91119fb8964e3df5d0f687ca7456e3816
2023-01-16 08:28:13 +01:00
daniel 47118f901a Reduce parsoid PC writes to randomized sample
We need to be careful about flooding the parser cache with parsoid
content. For this reason, we currently only write to PC for a certain
sample of edits. This logic is implemented in core in
ParsoidHandler::allowParserCacheWrite and controlled by the
TemporaryParsoidHandlerParserCacheWriteRatio setting.

DiscussionTools triggers parsoid PC writes when handling the
RevisionDataUpdates hook, so it should use the same sampling.

Change-Id: Ic33f57b10ae53f431a3c3484c4853e88bf80f47a
2023-01-13 20:52:05 +00:00
Dreamy Jazz 68ae9555f1 Test ServiceWiring.php
Test ServiceWiring.php using tests copied from CentralAuth. Because
phpunit does not support marking a file as covered, the ServiceWiring
file is ignored for code coverage as the tests fully cover the file.

Change-Id: I7da8d74fec84a5aa9c77bc0678ad8f55b550893a
2023-01-13 12:01:38 +00:00
Translation updater bot 02af2f559c Localisation updates from https://translatewiki.net.
Change-Id: I5b3d8965f14c90c7bfac7e5e64df0d8f9616a9a5
2023-01-13 08:54:55 +01:00
Translation updater bot a96f9607a2 Localisation updates from https://translatewiki.net.
Change-Id: Id86ae61b44b20543f43b930a9a788db3c4163e7d
2023-01-12 08:41:44 +01:00
jenkins-bot 63e6f270f3 Merge "Enable visual enhancements on all talk namespaces" 2023-01-12 00:25:07 +00:00
Ed Sanders 5c5073b5ba Enable visual enhancements on all talk namespaces
Bug: T325417
Change-Id: I099a7d03f059f08595dec43ff0205fd5ba765885
2023-01-11 18:35:51 +00:00
jenkins-bot 029d8d6d66 Merge "Track callers of parseRevisionParsoidHtml." 2023-01-11 18:23:50 +00:00
daniel b15aecc68c Track callers of parseRevisionParsoidHtml.
We are seeing a lot of parser cache writes coming from
parseRevisionParsoidHtml. We should find out what is causing them.

Change-Id: I25440e0d759e19cc9769404beb6911c64d37d3e3
2023-01-11 19:01:45 +01:00
Translation updater bot 8c620473fb Localisation updates from https://translatewiki.net.
Change-Id: I85bdc31125b173661a54d6b8cdfdc0d32ba4f488
2023-01-11 09:01:39 +01:00
Bartosz Dziewoński f7104b350f SpecialFindComment: Use new FormSpecialPage helpers
Depends-On: I14c0ebc017aa7387d03dac1ee0021d52d8ba3d0e
Change-Id: I023a701091afa06ef545e18f672e95ea6ee9b575
2023-01-11 04:30:29 +00:00