Page MenuHomePhabricator

Make use of the mw.libs.confirmEdit.CaptchaWidget in DiscussionTools instead of CaptchaInputWidget
Open, Needs TriagePublic

Description

Summary

In T422913: Rework mw.libs.confirmEdit.CaptchaInputWidget to not always require an input field, the mw.libs.confirmEdit.CaptchaInputWidget class was replaced with the mw.libs.confirmEdit.CaptchaWidget class. The latter supports hCaptcha. We should use CaptchaWidget in DiscussionTools instead of CaptchaInputWidget to allow hCaptcha to be enabled for that interface

Background & Technical details

  • mw.libs.confirmEdit.CaptchaInputWidget relies on the idea that the captcha will always have an input field to be rendered
    • However hCaptcha violates this assumption as it renders it's own widget and does not use a text field for the user to enter text
    • Therefore, the CaptchaInputWidget needed refactoring to support hCaptcha and a rename to make it clear that there will not always be a input field
  • This means that the mw.libs.confirmEdit.CaptchaInputWidget class has been deprecated and DiscussionTools should use the mw.libs.confirmEdit.CaptchaWidget class instead
    • The CaptchaWidget class still supports all the captcha types supported by CaptchaInputWidget, so changing this does not represent a backwards step in compatibility

Acceptance criteria

  • DiscussionTools uses mw.libs.confirmEdit.CaptchaWidget instead of mw.libs.confirmEdit.CaptchaInputWidget

Event Timeline

Change #1277801 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/DiscussionTools@master] [WIP] Use mw.libs.confirmEdit.CaptchaWidget in DiscussionTools

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

Change #1279288 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/ConfirmEdit@master] [WIP] Add SimpleCaptcha::getApiParams

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

Change #1279369 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/DiscussionTools@master] Add tests for ApiDiscussionToolsEdit

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

Change #1279370 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/DiscussionTools@master] [WIP] Pass all CAPTCHA fields to edit API in discussiontoolsedit

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

Change #1279378 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[integration/config@master] zuul: [mediawiki/extensions/DiscussionTools] Add ConfirmEdit dependency

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

Change #1279378 merged by jenkins-bot:

[integration/config@master] zuul: [mediawiki/extensions/DiscussionTools] Add ConfirmEdit dependency

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

Mentioned in SAL (#wikimedia-releng) [2026-04-29T15:49:19Z] <James_F> Zuul: [mediawiki/extensions/DiscussionTools] Add ConfirmEdit dependency, for T424597

Change #1279369 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Add tests for ApiDiscussionToolsEdit

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

Change #1279288 merged by jenkins-bot:

[mediawiki/extensions/ConfirmEdit@master] Add SimpleCaptcha::getApiParams

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

Change #1279370 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Pass all CAPTCHA fields to edit API in discussiontoolsedit

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

Change #1277801 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Use mw.libs.confirmEdit.CaptchaWidget in DiscussionTools

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

Change #1286520 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/DiscussionTools@master] ReplyWidget: Fix bug with CAPTCHA input element focus

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

Change #1286529 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/DiscussionTools@master] dt.ui.ReplyWidget.test.js: Use sinion mocks where possible

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

Change #1285876 had a related patch set uploaded (by Dreamy Jazz; author: Dreamy Jazz):

[mediawiki/extensions/DiscussionTools@master] Surface CAPTCHA rendering errors and log them

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

Change #1286520 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] ReplyWidget: Fix bug with CAPTCHA input element focus

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

Change #1285876 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] Surface CAPTCHA rendering errors and log them

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

Change #1286529 merged by jenkins-bot:

[mediawiki/extensions/DiscussionTools@master] dt.ui.ReplyWidget.test.js: Use sinion mocks where possible

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