We want to start by designing a data model that can be shared between both the sidebar and the content pane.
- Lists top-level content elements (can be multiple templates as well as wikitext snippets).
- Lists all known parameters.
- Each parameter with a bool flag for the checkbox.
- Unknown parameters can be added any time.
- Search indexes (many TemplateData fields)
- Need to consider the event handling model--possibly a merged data structure is not going to be easy.
- Draw a diagram of the data container(s) and how changes are propagated among components.
We’re worried that the content model is designed to be 1:1 with wikitext, and our model which contains nonexistent parameters will break this assumption.
- Wiring template model to UI: https://github.com/wikimedia/mediawiki-extensions-VisualEditor/blob/master/modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js#L462
- Here is the data model creating event wiring: https://github.com/wikimedia/mediawiki-extensions-VisualEditor/blob/master/modules/ve-mw/dm/models/ve.dm.MWTransclusionModel.js#L232
- How will changes to the data model propagate to each pane?
Updates are currently propagated by add, remove, and replace events. Will we stay in this paradigm? The alternative is to send something like a "change" event, and each pane is responsible for updating itself from the master data store.