Split the four Add Link ResourceLoader modules (ext.growthExperiments.AddLink, ext.growthExperiments.AddLink.desktop, ext.growthExperiments.AddLink.mobile, ext.growthExperiments.AddLink.onboarding) into a generic part that's reusable for all structured tasks, and an AddLink specific part. (We might want to keep them in the same module for the sake of keeping startup module size down, but at a minimum the classes need to be split.)
Generic concerns:
- visual / machine editing mode and the related functionality (toolbar icon/label, switch button, removing other tools, warning dialog, hacks for making VE readonly mode behave, autosave hack)
- loading/initialization for this (maybe change mobile.js/desktop.js into classes so that inheritance can be used)
- onboarding dialog, probably
- null edit mechanics and autosin AddLinkArticleTarget
- A/B testing support for task types
- the EventLogging logger (though probably not the schema)
- having a save dialog base class; also adding the extra data to the API call in AddLinkArticleTarget.save()
- maybe save button + having some abstraction for the "some recommendations have been accepted" / "some recommendations have been rejected" checks that save button mechanics are based on? (with some=1 for Add Image) We might want to just auto-open the dialog if the user accepts/rejects though, so this should wait for the final design.
- probably error dialogs like "no suggestions"
Add Link specific concerns:
- everyting to do with annotations
- fragment matching logic in AddLinkArticleTarget
- link inspector dialog + rejection dialog
- skip dialog
- onboarding dialog content
Task to rename message keys: T290040: Add Image: Rename message keys that are not specific to add link