WMDE-Design is experimenting with designs for the citation dialog in VisualEditor that show a live-preview of the nested main + sub-ref. The devs are asked to check if the following is technically possible:
Goal
- Integrate the preview into the sub-ref add and edit dialogs.
- Find a good mechanism to update the preview upon change by user.
- Templates eg. Cite* are rendered.
- Dynamic update of content in preview (live update)
- Upon inserting content in the free input field, the preview should be updated to display the details.
Out of scope:
- Correct numbering, this is just about the content
- Swap between the default - edit all - vs edit this one note.
- Links do not need to be clickable.
- When ref is edited through the template dialog.
Feasibility:
- How to get access to the main ref content while editing a sub-ref?
- How to get access to all existing sub-refs while editing the main ref?
- How to get backlink markers that are unique to each.
- Do we have access to the content field in the edit dialog so we can show it as part of the preview?
- Does any of this require a server-side re-parse? (E.g. when the content contains a template?)
- While the user is editing the input field in the edit dialog, is there some kind of change even we can hook into to update the preview every time the user makes changes?
- Consider debouncing, throtteling, immediate update on every keystroke, manual...
Timebox
- 2 engineers
- 1 week
IF ALL FAILS, we stick to the current implementation:


