Background
In T272482: Show/hide advanced toolbar when multi-part content is present the toolbar is hidden when editing a single template. There is a trashcan there which currently lets you delete a template from within the dialog. There is also a trashcan button which shows next to the template name in the main dialog when the sidebar is expanded. Both are removed or inaccessible by the new implementation. This means that the possibility of deleting the template within the dialog is changing from difficult to do to not possible. Instead, we will provide users the possibility of deleting when clicking on the template from editing the article (currently possible by clicking 'backspace/delete' on keyboard).
Requirements
- Implement behind a feature flag with T272354: Add back button to VE TemplateDialog and T272355: Add unsaved changes warning message to VE TemplateDialog
- Remove trash can next to template name in main dialog (if still there)
- Use OOUI component: ButtonGroupWidget (destructive and progressive ButtonWidget) to add a second button with 'Delete' label which removes the template (same as clicking the delete or backspace button when template is selected). This button set-up should match the context menu for tables in VE, which also has a destructive and progressive button group.
- Ensure that CTRL-Z still works as an undo to bring the template back (currently functions)
Mock