Commit graph

628 commits

Author SHA1 Message Date
Adam Wight e4e6b59306 No-op wiring to get ref "extends" into Parsoid
This doesn't change behavior yet, it's pure wiring to make the
attribute available to Parsoid logic.

Bug: T378567
Change-Id: I6182b601f6fee66a9c32d5006d0a36150eb47e7f
2024-10-31 13:20:02 +01:00
Adam Wight 373ed01123 Parsoid wiring for footnote mark formatting
After this patch, Parsoid-rendered pages will include the same
footnote markers as the legacy parser for custom group markers.

The divergent CSS implementation is left intact, for a soft migration.

Bug: T377454
Change-Id: I576dfff4155fb8c2f91ef0d28a65b319aa5bbb07
2024-10-31 11:16:49 +00:00
Adam Wight 1af67c0416 Prematurely move References test to integration
This isn't needed until patch I576dfff415, but is split into a
predecessor to keep the test and logic changes obviously separate.

Bug: T377454
Change-Id: Iff4a96be77af53a71a1ebe179f31bcc214182bfe
2024-10-31 11:16:33 +00:00
Adam Wight 60fbb32c1a Split apart mark formatting into a simpler labeler
The new mark label renderer is a service and can be called from
Parsoid.

Bug: T377454
Change-Id: I6f4983c4288bf29954ad4e5fa3309f9bdf48215d
2024-10-31 11:16:13 +00:00
jenkins-bot 141b18277d Merge "Expose the footnote mark formatter label method" 2024-10-31 10:41:52 +00:00
WMDE-Fisch 58d1880ae8 [cypress] Streamline the WT2017 tests
Using a bit more methods from the utils to reduce duplication.

Bug: T373787
Change-Id: Iead8ac8ba18370414dda16270c9b26f9c15db743
2024-10-31 07:49:29 +00:00
WMDE-Fisch 5f6403b7bc [cypress] Focus the surface at least once before testing WT2017
Intended as workaround to make sure that the temp account notice is
closed before opening Citoid. But does not hurt in any case I guess.

Bug: T378537
Bug: T378417
Bug: T377666
Change-Id: I4c3bf156cbb7306eda924bcebc2fbed3b5864f8a
2024-10-31 07:49:09 +00:00
Kosta Harlan 5600b1fc47
wt2017Integration.cy.js: Disable flaky test
Bug: T377666
Change-Id: I34de82574e172359a334e8e8c4ef7382a92e5509
2024-10-30 20:05:39 +01:00
Adam Wight 87d1229bf2 Expose the footnote mark formatter label method
Behavior change: previously, an error would be rendered once the
custom markers run out. After this patch there is a graceful fallback
to default group rendering (eg. "lower-greek 1000").
This is a slight improvement, but is user-facing so should be
discussed before merging.

In future work we'll render custom marks programmatically so this edge
case would be unreachable, and since the error message only exists to
nudge editors to extend the custom group symbol sequence, this would
also become wasted effort.

This patch splits out a lower-level method which produces the bare
mark label, with no link or wikitext formatting.  The patch narrows
and simplifies the interface so that the method can be made available
to Parsoid, and will be converted to a service in a separate patch.

Bug: T377454
Change-Id: I719b60b46cdef0be7463d76e9125d75ab4f333ae
2024-10-30 12:14:10 +01:00
jenkins-bot 685fdefd4e Merge "Fix regression to auto-save" 2024-10-29 13:09:52 +00:00
Andre Klapper 41bafe6f2c Use explicit nullable type on parameter arguments (for PHP 8.4)
Implicitly marking parameter $... as nullable is deprecated in PHP
8.4. The explicit nullable type must be used instead.

Bug: T376276
Change-Id: I73a4ce1ecd9b4fe040e5bfd22889e783071fab0d
2024-10-26 14:56:31 +02:00
Adam Wight b3e8737829 Fix regression to auto-save
Cite's MWDocumentReferences included a Document, which caused
auto-save serialization to fail silently on the cyclical reference.

This patch moves the caching to per-instance scope, which was the
better choice to begin with.  The document refs are recalculated after
each change anyway, and caching is only necessary to work around an
awkward control flow in which each ReferenceNode is responsible for
its footnote number.

Bug: T377484
Change-Id: Iebe4befd603fe07d9da2a5bb6126228ec4d5dfea
2024-10-20 11:00:03 +02:00
Umherirrender 411ee7efad Use namespaced classes
Changes to the use statements done automatically via script

Change-Id: I0768f296b528c81edd6bd9ac7d76515b15f3da6f
2024-10-19 23:25:16 +02:00
jenkins-bot ebf38366e7 Merge "Rename internal BOOK_REF_ATTRIBUTE constant" 2024-10-07 12:02:13 +00:00
jenkins-bot 4ad9c4c8eb Merge "Use $this->getServiceContainer() in tests" 2024-10-04 21:54:44 +00:00
jenkins-bot 8f60a489bd Merge "Inject MainConfig services into Cite" 2024-10-04 19:34:11 +00:00
Fomafix 53d8aaa04a Use $this->getServiceContainer() in tests
Change-Id: I80a915e773a087a1fa663e0eebe9f0bab9be6d03
2024-10-04 07:40:44 +00:00
thiemowmde 0ed6cafb3b Use more narrow UserIdentity interface where possible
Change-Id: I766eaa904a9eaeb7ac2a32a98289a364b1c25355
2024-10-02 12:56:28 +02:00
WMDE-Fisch 73917d493b [refactor] Move result items rendering to ReferenceResultWidget
The exact rendering of each item should be part of the widget.
This also allows a better application of the sub-ref indent.

Bug: T375841
Change-Id: Ic2c24f40d59f41b316c6d6f362726c1ee68f2102
2024-09-29 20:06:02 +02:00
Fomafix 521f44ede5 Inject MainConfig services into Cite
Change-Id: I24cc3e4965d4a9fe41dcd799dac4cbce762fb068
2024-09-28 22:01:09 +00:00
jenkins-bot 1fea584fc2 Merge "Cypress: Add test for WT2017 integration" 2024-09-27 08:16:47 +00:00
jenkins-bot 3b197da578 Merge "Use dependency injection for References/RefProcessor" 2024-09-25 17:18:42 +00:00
mareikeheuer 326abf110d Cypress: Add test for WT2017 integration
Add e2e test to verify adding a basic ref and a VE-Cite tool template works with the WT2017 editor

TODO: In follow-up work, streamline Cite and Citoid initialization so
that we don't have to `wait` for partially-wired elements to get
their full behavior.

Bug: T373787
Change-Id: Iea41ce8b71e61d2c9868e50ba680d9c9245bb906
2024-09-24 10:19:50 +02:00
jenkins-bot 3beada9643 Merge "Move Reference Previews user preference into the Cite extension" 2024-09-23 10:47:16 +00:00
C. Scott Ananian 7df30e0651 Use dependency injection for References/RefProcessor
This avoids the use of Parsoid's SiteConfig::getMWConfigValue() method,
which is unnecessary when the extension has direct access to MediaWiki
services itself.

This also fixes the omission of CiteResponsiveReferencesThreshold from
the extension.json.

Change-Id: I01b43136b0827f185523f1318253372b09750de4
2024-09-12 11:57:28 -04:00
Adam Wight c7b60735fe Move Reference Previews user preference into the Cite extension
This seems to play well with Popups with and without
Ie8fa1672b9fd .  However, it's not clear to me why this still works
and even gives priority to the Popups implementation when present,
regardless of the order the extensions are loaded in.  Happily, this
is the desired behavior.

Bug: T363162
Change-Id: Ic479c0a381ee16d1abcecfdd5ee48f0afccc1d3f
2024-09-10 15:33:50 +02:00
Adam Wight 6ea3a8c696 Try to always limit our document references to the current fragment
Reverses the previous logic which traversed up from a fragment to get
the full document's refs.  Much other code in VE isn't ready for this
behavior, for example we can see list-defined refs but not inline refs
defined outside of the fragment.

This patch will ensure that we're only looking at refs accessible from
the current fragment, and prevents caching on fragments because the
cache uses `persistentStorage`, which is shared between fragments and
their parent document.

Bug: T374068
Change-Id: Ia38098f8b3e5a9d24c2206e11edab37d60209225
2024-09-10 12:26:32 +02:00
jenkins-bot e26e726cb0 Merge "[refactor] Rewrite context as service" 2024-09-10 08:27:05 +00:00
jenkins-bot 6203ab3d13 Merge "VE include subref count in warning message" 2024-09-09 12:09:26 +00:00
jenkins-bot 25b71720a4 Merge "[refactor] Renaming some fields in SearchWidget for clarity" 2024-09-09 07:26:57 +00:00
mareikeheuer bdcbcc08f8 VE include subref count in warning message
Include subref count in warning messages in VE editPanel dialog and contextItem

Bug: T373023
Change-Id: Ie7d162c4a2291db441846ec338159e8955c206c2
2024-09-09 09:21:06 +02:00
WMDE-Fisch b5a41a62de [refactor] Renaming some fields in SearchWidget for clarity
Should be a no-op. I checked CodeSearch for other usages but seems
safe so far.

Bug: T370875
Change-Id: I4969e93308735f06be3e344616341c1284157c19
2024-09-09 09:03:11 +02:00
Adam Wight 8e4c83bfc6 [refactor] Rewrite context as service
Puts the ReferencePreviewsContext behind a service to improve
testability.

Bug: T363162
Change-Id: I63aa4144081a2625da1b89f4d56adb612741c8fc
2024-09-06 16:26:20 +02:00
jenkins-bot 2890772a9f Merge "Adding some QUnit tests for MWGroupReferences" 2024-09-04 11:46:11 +00:00
WMDE-Fisch f133ad3ead Adding some QUnit tests for MWGroupReferences
Bug: T373854
Change-Id: Ie1ea1016e6e67429b109989bc7995b6dd532f314
2024-09-03 17:00:01 +02:00
jenkins-bot 52dc522cca Merge "Streamlining the MWReferenceEditPanel QUnit test" 2024-09-03 13:19:54 +00:00
jenkins-bot 0f72ad8b05 Merge "[refactor] Finish decoupling search widget from InternalList" 2024-09-03 12:52:26 +00:00
WMDE-Fisch 1507354f93 Streamlining the MWReferenceEditPanel QUnit test
I could add some simplifications to reduce the complexity of the
tests a bit. I also fixed the test for the change handler. Seems
it did not work that way before.

Also some minor random doc fixes.

Change-Id: If1530a815ea126c38c3a55f3d52e3ca482059840
2024-09-03 14:50:51 +02:00
Adam Wight ab0f2ea000 [refactor] Finish decoupling search widget from InternalList
Bug: T370875
Change-Id: I6ed43ea3a5b25c2ef5afc373b5a2523a730fd11e
2024-09-03 12:12:01 +02:00
thiemowmde e8fd6c093f Rename internal BOOK_REF_ATTRIBUTE constant
This has no user-facing consequences. The constant can be renamed any
time again, if needed. It's not used anywhere else:
https://codesearch.wmcloud.org/search/?q=BOOK_REF_ATTRIBUTE

Bug: T373307
Change-Id: Ia4d588e926bb6e75f96048f2d3782c0f23ece514
2024-09-03 09:45:46 +02:00
jenkins-bot 1116cfb9a9 Merge "Allow disabling the alternative backlink labels message" 2024-09-02 19:34:57 +00:00
WMDE-Fisch 31dcf2528e [refactor] Replace InternalList with DocumentReferences in ReferenceEditPanel
Change-Id: Icdb7b80f5ca4284fe77c4905b7a9c98659f9c2b4
2024-08-29 23:43:03 +02:00
jenkins-bot 1bae4d71c9 Merge "[refactor] Update some usages to new refs interface" 2024-08-29 12:23:14 +00:00
Adam Wight 633969300b [refactor] Update some usages to new refs interface
Change-Id: Idfffbe92ad1385e85b078bc4794a529c5f770eae
2024-08-29 13:21:48 +02:00
jenkins-bot 72056c5fd0 Merge "Make use of createNoOpMock in ReferenceListFormatterTest" 2024-08-29 10:21:44 +00:00
jenkins-bot 179e12f4ec Merge "[refactor] groupInput takes narrower parameters" 2024-08-28 08:09:55 +00:00
Adam Wight b69614fc82 [refactor] groupInput takes narrower parameters
Simple parameters hide knowledge and ease testing.

Change-Id: I9a8549199a1de07b437caf274c8d5e842183f570
2024-08-28 05:48:44 +00:00
jenkins-bot 6e6a7ebf2a Merge "Add parameters to Cite error messages in Parsoid" 2024-08-27 11:51:56 +00:00
Isabelle Hurbain-Palatin 3774c86a64 Add parameters to Cite error messages in Parsoid
The Parsoid error messages are missing a couple of parameters, according
to the json i18n files; this patch fixes that issue.

Change-Id: I4232c0b71ecc6d6f1220db3988e67d9cd4eb3d58
2024-08-27 12:01:30 +02:00
jenkins-bot 56ccdd0e48 Merge "Move existing ReferenceListFormatter code closer together" 2024-08-27 09:40:50 +00:00