Page MenuHomePhabricator

Add an image: onboarding dialog does not handle Esc key on Minerva
Open, LowPublicBUG REPORT

Description

List of steps to reproduce (step by step, including full links if applicable):

  • Open an Add Image task in Minerva on desktop, with a user who does not have the "always skip onboarding" user preference
  • When onboarding opens, press Esc

What happens?:
The keypress event is passed through to VisualEditor, which exits into read mode. The dialog stays open so the change is hard to notice, which makes the behavior even more confusing.

What should have happened instead?:
Capture the keypress and close the dialog.

Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc:
Chrome.
This doesn't affect other skins (desktop mode) where the Esc key is handled properly and the dialog is closed; nor real mobile, as there's no Esc key. People do use Minerva on desktop, though.

Event Timeline

Restricted Application added subscribers: Masumrezarock100, Aklapper. · View Herald Transcript
Sgs moved this task from Triaged to Current Sprint on the Growth-Team board.
Sgs edited projects, added Growth-Team (Current Sprint); removed Growth-Team.
Sgs moved this task from Incoming to In Progress on the Growth-Team (Current Sprint) board.

This is also reproducible on Vector skin. I think the issue is not related with the skin but with the fact the the last rendered window by the WindowManager is the RecommendedImageToolbarDialog and this dialog is "stealing" the focus from the StructuredTaskOnboardingDialog. If we click inside the on-boarding dialog to regain focus and then press Esc key it works as expected.

Investigating ways to fix this, I wanted to try:

A) Instruct toolbar dialog to not steal focus (if possible) and then use $returnFocusTo config option in on-boarding dialog to return the focus there after on-boarding steps are finished / dismissed.
B) Regain the on-boarding modal focus after the toolbar dialog opens then use $returnFocusTo config option again.

Maybe think option A) would be better but I haven't been able to tell how WindowManager (from VE) is handling this, if there's some order or precedence rule or specific focus handling code?
For option B) I'm missing is where are we instructing the toolbar dialog to open, I can see the call to this.getSurface().executeCommand( 'recommendedImage' ) but it's not directly triggering the dialog opening, as far as I can tell.