For the Revise Tone Structured Task, we want to close the Visual Editor when the user declines the initial Tone Check shown to them (see T405173: Revise Tone: Decline suggestion UX).
While that works as expected on desktop, there is an error on mobile and our steps after closing VE are failing to show. Given that mobile is our main target audience for this project, this is not great.
Looking into the technical interfaces for that, it becomes clear that the problem is VE/MobileFrontend.
In VE, the tryTeardown method on MobileArticleTarget is not returning a Promise like the method on ArticleTarget that it overrides (LSP violation):
ve.init.mw.MobileArticleTarget.prototype.tryTeardown = function () { this.overlay.onExitClick( $.Event() ); };
We depend on that Promise to know when the teardown of VE has finished so that we can show our UI elements.
Based on previous conversations, this seems to be fundamentally an issue with MobileFrontend.
There was already some attempt to improve this 3 years ago (2022), but it fizzled out: