Commit graph

765 commits

Author SHA1 Message Date
jenkins-bot 341b180a66 Merge "Don't insert reply tool outside <section> on mobile" 2022-10-22 02:39:44 +00:00
Bartosz Dziewoński d2df103803 Don't insert reply tool outside <section> on mobile
Bug: T319148
Change-Id: I7db0ef1980f4997b77593f3d43d35886ecd8a4ae
2022-10-21 01:20:13 +02:00
Bartosz Dziewoński 8c9a7c451e Retry without RESTBase when the page/revision seems to be missing
Bug: T315688
Change-Id: I2ec0fa20cc1ee36fc521441ac00c5515dc66a37c
2022-10-20 23:06:16 +00:00
jenkins-bot 3c53a489cf Merge "CommentFormatter: Always add the overflow menu" 2022-10-18 16:16:42 +00:00
jenkins-bot 66780457e4 Merge "Add 'wpTextbox1' to parameters that disable new topic tool" 2022-10-18 15:47:21 +00:00
jenkins-bot a9191c49b8 Merge "Ship HTML test files for JS using 'packageFiles' instead of 'templates'" 2022-10-14 16:53:38 +00:00
jenkins-bot bf1b17d34a Merge "Autogenerate list of files for JS test module instead of maintaining it by hand" 2022-10-14 16:53:36 +00:00
jenkins-bot f09d91a29c Merge "ThreadItemStore: Move some work in insertThreadItems() outside transactions" 2022-10-14 16:36:45 +00:00
jenkins-bot d7cf6adb0a Merge "Log page/revision IDs when the page/revision seems to be missing" 2022-10-14 16:34:45 +00:00
jenkins-bot 19e64cd8ee Merge "Use ParsoidOutputAccess when RESTBase is not set up (WMF private wikis)" 2022-10-14 16:34:15 +00:00
jenkins-bot a8bf67c4e9 Merge "Fix '?dtenable=1' on mobile" 2022-10-13 00:00:01 +00:00
Ed Sanders cdad0cc260 Fix '?dtenable=1' on mobile
isFeatureEnabledForOutput already checks if the mobile flag is enabled,
but it also respects the dtenable=1 override.

Change-Id: I95035281bf301b22c1a9ef4c06ec54cdd0cbc85c
2022-10-12 23:53:12 +00:00
Bartosz Dziewoński 361283a332 Ship HTML test files for JS using 'packageFiles' instead of 'templates'
We originally used 'templates' because it seemed like an obvious
choice for HTML files, and because 'packageFiles' requires extra code
to include anything that isn't a .js or .json file.

However, the templates are expected to be HTML fragments rather than
whole documents, and they are parsed in a particular way that takes a
lot of code to clean up (which we needed to do, because we use the
same test files for testing PHP code).

I tried doing it in the 'packageFiles' way, and the extra code doesn't
seem that bad in comparison after all. Moreover, the 'templates'
mechanism (when used the intended way) feels vaguely deprecated in
favor of Vue.js, and I'd rather move away from it.

This makes the tests faster too (probably mostly thanks to the removal
of the clean up code) – on my machine they go from 1800ms to 1500ms.

(Simplify linearWalk tests, as we no longer need to do weird things
with document fragments to get consistent outputs in PHP and JS.)

Change-Id: I39f9b994ce5636d70fea2e935a7c87c7d56dcb26
2022-10-12 22:45:41 +00:00
Bartosz Dziewoński f9903401a6 Autogenerate list of files for JS test module instead of maintaining it by hand
Depends-On: I223f63aab132444833aad7d7c162b27c9e93991c
Change-Id: Ib869b66d9f9155163ad9e0475e5e8a69dac9f55a
2022-10-12 22:41:41 +00:00
jenkins-bot f6e271d781 Merge "Remove all hacks for old HTML in HTTP cache or parser cache" 2022-10-12 14:20:52 +00:00
Bartosz Dziewoński 6276b6ead5 Log page/revision IDs when the page/revision seems to be missing
Bug: T315688
Change-Id: Icb77d62776f26f2daf3be7559f37eea4c6ab6b69
2022-10-09 20:21:59 +02:00
Bartosz Dziewoński 4588ae7d7c Use ParsoidOutputAccess when RESTBase is not set up (WMF private wikis)
This path will also be used on most non-WMF wikis, but that's alright.

Bug: T315689
Change-Id: I20de2e2391e45b7ccc9233d6d8306ad47462605f
2022-10-09 20:20:17 +02:00
Bartosz Dziewoński f8d25be872 Remove all hacks for old HTML in HTTP cache or parser cache
Change-Id: I609cbbf5b26eca3a84bae91cc17cbc663925714c
2022-10-09 18:17:35 +00:00
Bartosz Dziewoński a46af344dc Use RevisionLookup methods instead of ApiParsoidTrait methods
Part of my secret plan to delete ApiParsoidTrait.

* Inject RevisionLookup into ApiVisualEditor
* Use RevisionLookup::getRevisionById instead of ApiParsoidTrait::getValidRevision
* Use RevisionLookup::getRevisionByTitle instead of ApiParsoidTrait::getLatestRevision
* Use standard MediaWiki error messages

Change-Id: I7244ee4916fb011fad5faa1d9f837e83f6ac2dc1
2022-10-09 18:17:32 +00:00
Daimona Eaytoy 50874ab4b7 Fix call to wfMessage
Follow-up to I8cf8b6960533718646189263acabc852ea976416, where the ...
was unintendedly removed.

Also switch to a suppression, because the type should be documented in
ParsoidClient, rather than enforced in callers. We will remove the
suppression once the documentation is updated.

Change-Id: I3ee2534959c8375d29f43e8391894f0a2002ae1c
2022-10-09 13:56:03 +02:00
libraryupgrader 154e47a7a5
build: Updating dependencies
composer:
* mediawiki/mediawiki-phan-config: 0.11.1 → 0.12.0

npm:
* grunt: 1.5.2 → 1.5.3
* grunt-banana-checker: 0.9.0 → 0.10.0

Change-Id: I8cf8b6960533718646189263acabc852ea976416
2022-10-09 10:55:34 +03:00
Bartosz Dziewoński cf4b6015a3 Add 'wpTextbox1' to parameters that disable new topic tool
Bug: T316333
Change-Id: Id73af455df97b26334bf8a450bc6d0ac95deb9bd
2022-10-08 20:49:34 +02:00
Ed Sanders e57cf6c60f ImmutableRange: Add surroundContents method
Also adds extractContents method.

Change-Id: Ie81dab12007b4038ebaaae904a1c032f80ef43cb
2022-10-04 16:51:08 +02:00
Bartosz Dziewoński 8ad26730f2 CommentFormatter: Always add the overflow menu
Bug: T318110
Change-Id: I49900e32dc6b5dbca3286a840ce122639e25e9bd
2022-10-02 15:36:45 +02:00
Bartosz Dziewoński 482a2c6dd0 ThreadItemStore: Move some work in insertThreadItems() outside transactions
As suggested in the discussion on T315353.

Bug: T317236
Bug: T317237
Change-Id: I8d9f2e3d4779a2e2f433a8fffea2767ae986bc48
2022-09-29 21:34:15 +02:00
David Lynch d5161bf086 Add config to separate out visualenhancements on mobile
Follow-up to d0126ce6de which made them
default-on for all mobile. These two taken together mean that the
mobile visual enhancement features now *only* depend on this config,
rather than on whether the individual features are enabled on desktop.

Bug: T318871
Change-Id: If767753e6d33f19bbc540d4e74273e478198388c
2022-09-28 17:12:48 -05:00
jenkins-bot 3436684b2c Merge "Only hold on to a Config instead of ConfigFactory when injecting" 2022-09-28 14:22:46 +00:00
jenkins-bot d0126ce6de Merge "Visual enhancement features are now part of the mobile set" 2022-09-28 14:16:02 +00:00
David Lynch 3a42623fef Visual enhancement features are now part of the mobile set
Bug: T318302
Change-Id: I494e4dd6d2133d110499420ffc57f45a29999748
2022-09-27 16:09:05 -05:00
Bartosz Dziewoński 0a5cded42c Fix TODO about ParsoidClient::getPageHtml() params
Depends-On: Id9a450dc8b8eb3e82cf87718b96975e5a3c6180c
Change-Id: I35ce516187fb8dcde24bc35278378496f471e211
2022-09-26 22:50:07 +02:00
jenkins-bot fb7a25ce91 Merge "PreferenceHooks: Avoid referring to the field of disabled feature" 2022-09-24 23:30:44 +00:00
Bartosz Dziewoński 2679fa3b04 Replace VisualEditor ParsoidHelper with ParsoidClient
Depends-On: I21c4a8cd86f8d085e75a601ed6d2509dedd75d42
Change-Id: I9533d7c05047c2d873c8c6ee5944df965e3b379d
2022-09-19 18:00:14 +02:00
Func 8820940dfd PreferenceHooks: Avoid referring to the field of disabled feature
The GlobalPreferences extension would remove disabled fields from
the form, avoid referring to it in the disable-if param.

Bug: T317526
Change-Id: I6ec177a1f20855c90eb4ea17bb6625c75e5b9617
2022-09-13 09:32:09 +00:00
jenkins-bot 936883572c Merge "CommentFormatter: Fix TOC info being repeated for subsections" 2022-09-06 22:23:51 +00:00
jenkins-bot 0632bfc92e Merge "Refactor thread summary getters" 2022-09-06 22:17:26 +00:00
jenkins-bot 014ff9f8da Merge "Hooks: Inject VisualEditorParsoidClientFactory to ParsoidHelper" 2022-09-06 21:28:24 +00:00
Bartosz Dziewoński d7b6100c28 CommentFormatter: Fix TOC info being repeated for subsections
(And don't display it for empty top-level sections)

Bug: T309463
Change-Id: Icc69a248bca0be4945e07051e667b87af28927f7
2022-09-06 23:19:13 +02:00
Ed Sanders e24550fae9 Refactor thread summary getters
Replace getThreadSummary with individual getters that call
calculateThreadSummary once.

Change-Id: Ie8a8b4d7cb5121847b78dbc20bca2c8d48c7d857
2022-09-06 23:19:13 +02:00
Derick Alangi 5168005373 Hooks: Inject VisualEditorParsoidClientFactory to ParsoidHelper
Since it will be made a required field in VE, just inject it.

Change-Id: If682af406c0fc7a9eca106eb3ebd95e6c14baddd
2022-09-06 21:15:13 +01:00
Ed Sanders 09d9b179f7 Content*Item: Use more specific Content*Item classes within functions
We can't use these is class method function signatures, but we
can use within the functions themselves.

Change-Id: Ic24e47d6647226172a3bfacd81398d26143d98e4
2022-09-06 20:00:55 +00:00
jenkins-bot 23a5647ff4 Merge "Hooks: Remove injecting MainConfig to ParsoidHelper" 2022-09-06 17:53:11 +00:00
jenkins-bot 1c624210f4 Merge "Table of contents style tweaks" 2022-09-05 21:43:06 +00:00
Derick Alangi c1c1cee267 Hooks: Remove injecting MainConfig to ParsoidHelper
Will fallback to MainConfig gotten from services in VisualEditor.
VE will remove this complete soon.

Depends-On: I787c0afb227308aab56770d14d62e08eb0084a6c
Change-Id: I4b9e7362a1bf1b4f224c8c652d40851a18c19824
2022-09-05 14:36:25 +01:00
Ed Sanders 5c7cf02457 Table of contents style tweaks
* Make "X comments" appear on a new line deliberately
* Remove parentheses around "X comments"

Bug: T309463
Change-Id: I803eee9db59c633f129f15e436242a12bcc627f0
2022-09-05 12:57:31 +01:00
jenkins-bot f5b7f72a38 Merge "Inject services into API classes" 2022-09-05 11:44:04 +00:00
jenkins-bot 2ce1822484 Merge "Use cheaper getRawVal/getCheck instead of getVal where possible" 2022-09-03 05:33:08 +00:00
Thiemo Kreuz 62ddb8bceb Use cheaper getRawVal/getCheck instead of getVal where possible
getVal/getText can be expensive because they do Unicode normalization.
We can skip this when we know we aren't going to do anything meaningful
with the value anyway.

Change-Id: I9d939a44df6b67bcd8429096d89600ce1566ca39
2022-09-03 05:27:20 +00:00
Bartosz Dziewoński 14b01e101a Only hold on to a Config instead of ConfigFactory when injecting
The config is currently unused in some classes, but this is okay since
it might be used in the future.

Change-Id: Ie25fc52cc5d3476c9445e182975d229991316bd3
2022-09-03 00:39:51 +02:00
Bartosz Dziewoński dc07d802a9 Inject services into API classes
This replaces the remaining uses of MediaWikiServices::getInstance()
in API classes.

Change-Id: I5f602a7e7b5a21a7d40023571018604528ea8edb
2022-09-03 00:23:41 +02:00
Ed Sanders 664d5d041a Fix fetching of oldest comment in a thread
The implementation in Parser doesn't descend into sub-thread.
Re-use the getThreadSummary method in ThreadItem and traverse
the thread properly.

Bug: T298617
Change-Id: I318d9012eb83f37ccbe463923524ef2e9f995ced
2022-09-01 21:22:09 +00:00