This is a follow-up from T191757: Investigation: Edit existing templates.
Value proposition:
As a user, I want to expand or modify existing template(s) in wikitext so that I can improve the page.
Expected behaviour:
- When user places the cursor within an existing template:
- The immediate surrounding template is used to pre-populate the wizard.
- If the user edits the template and hits Insert, the existing template is updated.
- If the user hits Trash, adds a new template and hits Insert, we insert the new template at the cursor position.
- Note: We don't replace the original template because it is possible that the user never intended to modify the template but add a nested template instead - hence we don't replace anything to be on the safe side.
- The immediate surrounding template is used to pre-populate the wizard.
- When user selects some text
- We internally expand selection to the nearest surrounding template, if one. If none is found, we give them a blank wizard.
- If we found a surrounding template, we populate the wizard with the template.
- If user updates the template and hits Insert, we update the existing template.
- If user hits Trash, then adds another template and then hits Insert - we then ask them what they want to do -
- It seems like you are trying to insert a new template but you have selected text on the page. Do you want to replace the selected text or insert the new template without replacing text?
- Replace the selected text
- Insert template without replacing text -- This option inserts the new template at the end of selected text.
- It seems like you are trying to insert a new template but you have selected text on the page. Do you want to replace the selected text or insert the new template without replacing text?
Needs QA?
Yes.