Summary
When we know that hCaptcha should be displayed before the edit is started, we need a way to render the hCaptcha widget in the dialog used to enter a edit summary and submit the edit.
Background
- ConfirmEdit (CAPTCHA extension) has a hCaptcha VisualEditor plugin that handles displaying the hCaptcha challenge in the edit summary window
- This is displayed if the visualeditoredit fails with a captcha requirement being hcaptcha
- Therefore, the user will have to press "Save changes", then complete hCaptcha, and then press "Save changes" again
- This is not an ideal flow, and instead we want to be able to display the hCaptcha widget earlier in the flow
- We can only do this if we know if the widget should be displayed before the user starts their edit
- In T407146: hCaptcha VisualEditor: Load hCaptcha secure-api.js when user interacts with edit form, we handled loading hCaptcha in this situation
- We can now render the hCaptcha widget as soon as this is possible once loading is finished
- Because we will need to be able to display the widget near the edit field, we may have to wait for the "Save changes" dialog to be opened to be able to render hCaptcha
- We can now render the hCaptcha widget as soon as this is possible once loading is finished
Technical notes
We need to either:
- A way to render the hCaptcha widget outside the dialog and then be able to move it inside the dialog once the user opens it
- Render the hCaptcha widget when the dialog is opened
Additionally, we need to make sure that the save changes dialog persists the hCaptcha widget. If it does not, we may need to ensure that this rendering is triggered again if the user closes and reopens the dialog.
Acceptance criteria
- When a user opens the VisualEditor "Save changes" dialog and it is known before the edit starts that a hCaptcha captcha will need to be completed, the hCaptcha widget is loaded either when or before the "Save changes" dialog is displayed