Page MenuHomePhabricator

Improve how Citoid reference context items are defined
Closed, ResolvedPublic

Description

@Esanders has proposed some patches to improve how Citoid reference context items are defined. They look good to me but I'd like us to do QA review to confirm that everything works correctly. Someone should also confirm that this doesn't negatively affect ContentTranslation, which has its own hacks on top of our hacks (last discussed in T232330).

Testing

  • In VE, find or create an automatic reference for a book/website/news/journal
  • Check that clicking on the reference in VE shows just one context item of the correct type:

image.png (160×426 px, 26 KB)

Event Timeline

Change 802160 had a related patch set uploaded (by Bartosz Dziewoński; author: Esanders):

[VisualEditor/VisualEditor@master] ModeledFactory: Allow candidates to suppress other candidates when matching

https://gerrit.wikimedia.org/r/802160

Change 802163 had a related patch set uploaded (by Bartosz Dziewoński; author: Esanders):

[mediawiki/extensions/Cite@master] CitationContextItem: Manually suppress the generic context item

https://gerrit.wikimedia.org/r/802163

Change 802166 had a related patch set uploaded (by Bartosz Dziewoński; author: Esanders):

[mediawiki/extensions/Citoid@master] VE: Make CitoidReferenceContextItem a real class

https://gerrit.wikimedia.org/r/802166

Change 802160 merged by jenkins-bot:

[VisualEditor/VisualEditor@master] ModeledFactory: Allow candidates to suppress other candidates when matching

https://gerrit.wikimedia.org/r/802160

Change 804332 had a related patch set uploaded (by Bartosz Dziewoński; author: Bartosz Dziewoński):

[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (78ab52b71)

https://gerrit.wikimedia.org/r/804332

Change 804332 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Update VE core submodule to master (78ab52b71)

https://gerrit.wikimedia.org/r/804332

Change 802163 merged by jenkins-bot:

[mediawiki/extensions/Cite@master] CitationContextItem: Manually suppress the generic context item

https://gerrit.wikimedia.org/r/802163

Change 802166 merged by jenkins-bot:

[mediawiki/extensions/Citoid@master] VE: Make CitoidReferenceContextItem a real class

https://gerrit.wikimedia.org/r/802166

matmarex moved this task from Incoming to QA on the Editing-team (Kanban Board) board.
matmarex added a project: Editing QA.

FYI @Etonkovidova @santhosh – we've refactored some of the code that the fix for T232330 in ContentTranslation depended on. I think everything in ContentTranslation should work correctly without any changes, but we'd appreciate if you could double-check. (You might also be able to simplify the code added in that task using the new suppresses property, but it may not be worth the effort.)

FYI @Etonkovidova @santhosh – we've refactored some of the code that the fix for T232330 in ContentTranslation depended on. I think everything in ContentTranslation should work correctly without any changes, but we'd appreciate if you could double-check. (You might also be able to simplify the code added in that task using the new suppresses property, but it may not be worth the effort.)

CX is sub-classing the template-specific context items and re-registering them with the same name, so it will be unaffected by this change, and also there is nothing to be made cleaner with suppresses (that was for when we were re-registering the parent class and thus breaking the inheritance).

I've tested locally and it works fine. I've also submitted https://gerrit.wikimedia.org/r/c/mediawiki/extensions/ContentTranslation/+/804350 as a minor cleanup, which is not dependent on the changes in this task.

EAkinloose subscribed.

Clicking on the reference shows just one context item of the correct type. See

Screenshot 2022-07-04 at 12.36.12.png (256×876 px, 20 KB)

Screenshot 2022-07-04 at 12.28.40.png (322×838 px, 40 KB)

ppelberg claimed this task.