Define and estimate the work required to implement and ship the Minimum Viable Product of VisualEditor in Flow.
Requirements to define and estimate:
- VE is the default for Flow entry fields.
- There are toolbar icons in the entry field; see Pau's mockups below.
- There's an icon to switch to wikitext. This is a sticky hidden preference, so anyone who switches to wikitext will stay on wikitext for all subsequent Flow posts, until they change back.
- The wikitext entry field won't have a toolbar, except for an icon to switch back to VE.
Spike results (I have thoughts on story point estimations, but we may want to estimate them together).:
The first pass is done (pending review). There are some known issues, discussed below:
- We need to use the relevant MW-specific features from VE (e.g. link support with autocomplete). The issue is that the VE parts intended for MW integration also assume it's a normal page, so we need to figure out how to refactor/extract the relevant parts. @Catrope indicated he might be able to help with this, but not for a while. (T90760: R1. Spike: Add relevant MW features to VE on Flow )
- We should improve our change detection for VE (see mw-ui-enhance.js) (T90761: Change detection for VE in Flow).
- When opening a VE editor, we're currently deserializing it from HTML to wikitext (on the server) (this step is done for wikitext editing too). Then, we re-serialize it to HTML to open VE.
When the user is done editing, we then deserialize the HTML (which the user just entered in VE) to wikitext using a network round-trip to Parsoid, post wikitext to the server (to submit the form), then reserialize it to HTML on the server (this last step is again done for wikitext editing too).
This is really inefficient and needs to be fixed (T90681: T8. Eliminate unnecessary serialization and deserialization (Parsoid HTML <-> wikitext)). We need to think about how to handle the related no-JS issues. This is also related to and will help with fixing T73474: R5. Flow uses synchronous XMLHttpRequests (VE+Flow).
- Need to sync up more with the VE team. They'll have feedback, and we should start working on it.
- Sometimes the toolbar gets stuck in the upper left, until you resize the window (T90762: Sometimes VE toolbar gets stuck in upper left until reflow/resize window).
- Implement switching (without losing content) back and forth (T90763: S6. Flow: Switching from VE to wikitext and back without losing content).
- Make it look more like Pau's mockups (T90764: S5. Flow: Integrate VE toolbar in Flow entry fields ).