gitlab-ce~9594407 since GitLabbers use issue templates, and use it across many different departments for different GitLab business processes.
Description
Currently changing issue templates will replace content without warning even if the template has been edited.
Proposal
If a user tries to apply a template and the have not manually modified the content of the description field (added or removed text), the chosen template should automatically replace that content without asking for confirmation. For example, if the user has not changed the original description template (“Before raising an issue to the GitLab Community Edition…”), it should be automatically replaced with the chosen template.
If a user tries to apply a template and they have indeed modified the content of the description field (added or removed text), an alert should be shown asking if they want to apply the chosen template (which will discard their changes) or cancel:
@lbennett I actually saw that in your MR but I thought it's a feature because I remember there was an issue related with this which is when user change template type their content will be lost. So is this a bug really?
Maybe we can replace the description with the selected template if there was no change to the default description (if the textarea is “pristine”). If the user has changed anything in the textarea, this should append. What do you think?
I personally don't think it should be appending and perhaps we can save what the user has written in a drafts template if they decide to change templates so that the data is still saved.
And if we do decide to append, it should only append once and not multiple times of the same template
I don't think it should append. Simplest solution to me is to show a message saying their content will be lost if they change templates. More complex solution is to build out drafts for issue descriptions. cc @awhildy
I agree with @tauriedavis's proposal. Let's start small and easy. I'd only show a warning if the user has changed something in the default description. Otherwise, the content gets replaced instantly.
@ClemMakesApps the drafts solution sounds great. A “boring” solution would be to mimic the way comment drafts work today. If you close the browser when creating an issue for a specific project the data gets saved as a draft. When coming back to create a new issue for that project, it would recover the saved data. The same thing when editing. Shall we create another issue to discuss this? Edit: I've just noticed that new issue data is already being recovered when you come back to create a new issue. Nevermind!
@ClemMakesApps I think replacing the text is even more simple and boring though. ;)
@pedroms We do use modals in some places, also oddly, browser alerts in some other places. I think we wanted to avoid modals where possible but this is a UX decision at the end of the day and it makes sense for a hard user confirmation. I've opened an issue regarding alert consistency. gitlab-ce#23494
On merge conflict resolution, we have this alert for when a user toggles back to interactive mode or clicks the Cancel button, they are prompted to confirm that they want to discard their changes.
Do we think people will want both templates in one issue? If not, I think we could have a similar as the merge conflict resolution here.
When first choosing a template, the original help filler text (Before raising an issue to the GitLab Community Edition...) should be removed automatically without asking for confirmation.
If a user tries to change a template and has not added anything to the template, the template should automatically switch to the other template without asking for a confirmation.
If the user tries to change a template after having added some text to the current template, we should ask if they want to discard changes and change templates.
Quick question about the flow details: Let's say I'm currently on a Bug template, and I've added content. I try to switch to the Feature Proposal template. I assume the alert appears when I click on 'Feature Proposal' in the dropdown. I expect the dropdown to close, but revert to 'Bug', and the alert show up. If I click on 'Discard changes' on the alert, then would we automatically change you to the Feature Proposal template, and your content is gone. 'Cancel' would just keep you in the 'Bug' template on the dropdown. Was this what others were thinking?
I agree with the @tauriedavis's flow suggestion, it's pretty intuitive. However, I think the alert is too subtle for this particular situation. For me, the user's intention is a blocking situation because he has made it clear that he wants to use or change the current template, and going forward with this can lead to data loss. The way the alert is presented makes it look like you can ignore it and continue to edit the issue, which seems counter-intuitive. This is not a small notice like the “add an SSH key if you want to push changes”, which the user can ignore. I would only present it like this if it was a undo notice like the one you see in Gmail and other apps (i.e. you can revert damages/changes). For these reasons, I think it should be presented in a small modal. Of course, feel free to disagree
@pedroms: Great to think through this and I understand your concerns.
I would only present it like this if it was a undo notice like the one you see in Gmail and other apps (i.e. you can revert damages/changes).
At the time you see the alert, you actually haven't lost any data. We blocked you from changing your template. So while it isn't explicitly an 'undo', it is a 'double check' things are ok before you make this change. You don't need to revert damages/changes because at the point of seeing this alert, there aren't actually any changes made yet.
Also, I don't feel like the alert will be too subtle for two reasons:
The text in the dropdown and the content in the description will not change as you would have expected. For example, you expanded the dropdown, clicked on 'Feature Proposal', and the dropdown where you may be looking returned to 'Bug'
Space has to be made for the alert. This entails shifting a large part of the page down (ideally with a subtle animation as motion is a great way to focus attention).
My concerns with a small modal are:
It takes you out of context, in a case where context might help you figure out what you wanted to do. Did you have content in the description you want to make sure you don't lose?
While I understand there is some potential for data loss here, I'm not sure the risk passes my bar for what we should use a modal for. I know you understand the concerns of overusing modals, making it so their importance gets diminished. It is likely we are talking about a paragraph of text or so that you would lose vs. popping a modal if you are about to delete a project or group, etc. While losing that paragraph would be frustrating, it is minutes of work instead of months+ of work.
we used to replace the text but whatever was written would be deleted after the user changed templates
@ClemMakesApps Did people actually complain about that? All this alert/popup/drafts stuff seems way overcomplicated, imho. :) I know there's a theoretical concern, but if people weren't running into the problem, why "fix" it?
Any chance we could make cmd-Z undo the template change so if we do overwrite their changes, they're just a keystroke away from restoring it?
I used to be able to switch to the bug or feature proposal templates but now I have to make sure I delete the placeholder text before changing the templates (which still seems like a bug to me)
@ClemMakesApps Sorry, I was unclear. I'm totally in agreement with you. I absolutely am complaining about the current behavior where picking a template leaves the help message at the top, etc. :)
I meant complaining about the original behavior months ago, when switching templates would wipe out everything, including anything you might have started typing.
@alfredo1@DouweM suggested that we merge a temp fix beforehand so this discussion and implementation has time to conclude properly without pushing back a fix.
@awhildy Thanks for posting such a thorough response to my comment. I agree that context is important in this case, so it might me better to use an inline alert.
@tauriedavis What do you think about having a more “informative” background color in the alert? Or is gray good enough since we are fading it in?
@tauriedavis I'd prefer a warning color, to call the user's attention. Also rephrased the description and button to read “Applying a template…” and “Apply template” — I think it makes more sense to “link” the situation and the action. And re-ordered the buttons so that the first action is “neutral” (cancel) and the second action is “destructive” (apply).
Maybe this is too strong? Now that I think about it, maybe having the “Apply template” button in red is enough…
I think the contrast is a good idea, esp since there is a lot of discussion over the use of grey tones all throughout gitlab. Maybe we can tone it back a little, and go with something in the middle? Feel free to edit further
I think we should keep this open to be resolved since the description states the correct proposal and it hasn't been implemented yet. I don't see a reason to create a new issue with the same description.
The linked MR looks like it was only a temporary fix.
It's a little confusing because the issue description talks about how the template should stop appending while at the same time (based on discussions), it looks like the issue is a ~"feature proposal" for the UI @pedroms has described.
I think we either need to edit the issue description or create a new issue that is listed as a feature proposal
Taurie Davischanged title from Template is appending rather than replacing to Issue templates remove content without warning
changed title from Template is appending rather than replacing to Issue templates remove content without warning
Any chance we could make cmd-Z undo the template change so if we do overwrite their changes, they're just a keystroke away from restoring it?
I agree. You don't really need an undo button if you play nice with the browser's undo stack. See gitlab-ce#31336. I'm not against an undo button, but I think cmd-Z should work first.
@tauriedavis I've experimented with the placement of the undo functionality and it's always pretty intrusive with the kind of layout we have today, where every element is relative to one another, stacking and pushing things aside:
We should push forward the snackbar/toast pattern for this kind of interaction. What do you think? /cc @dimitrieh since we were chatting about this
@andr3 : Would this be a medium-ish sized effort, primarily on the FE side? Also scope wise, I think we should do both issue and mr templates together, if we were to do this issue.
@victorwu I'd say medium sized effort (weight around 3), mostly to get the interaction right (and tested) according to:
Quick question about the flow details: Let's say I'm currently on a Bug template, and I've added content. I try to switch to the Feature Proposal template. I assume the alert appears when I click on 'Feature Proposal' in the dropdown. I expect the dropdown to close, but revert to 'Bug', and the alert show up. If I click on 'Discard changes' on the alert, then would we automatically change you to the Feature Proposal template, and your content is gone. 'Cancel' would just keep you in the 'Bug' template on the dropdown. Was this what others were thinking?
@tauriedavis (I think you did the design for this) would you consider this UX ready or do you think we need to go in a different direction with this? It might be a candidate for an undo toast
@andyvolpe I think this would be a good place to use an alert. What are your thoughts on using the warning alert, but with two action buttons? If you look at the current mockup in the description, there's the Apply template button and Cancel. I think a Cancel button is necessary here and is clearer than just the x that I see in the alert specs.
@annabeldunstone I agree! I say give it a shot with a cancel button and see how it feels. Placement and size might also be subject to change but I don't see that as a big deal! If it works out we can update the documentation to include a second button.
@annabeldunstone I see. Maybe Cancel looks a bit off here because there are 2 secondary buttons? Perhaps a primary CTA works better here for Apply template?
I was also thinking about the wording here. It might help to qualify the warning text with what might happen if the user applies the template and has changed the description. Maybe something along the lines of: "Applying a template replaces the issue description and removes your changes. You may lose your work as a result."
@andyvolpe good point about the two secondary buttons. What do you think about this?
Regarding the text, I did tweak it a bit but I think "Applying a template replaces the issue description and removes your changes. You may lose your work as a result." seems a little redundant
@annabeldunstone this looks good! I think we should update the component description with a case where 2 cta are needed. I don't mind doing that since I practically have it memorized by now.
The language is a bit redundant now that I read it more carefully. I would highlight the fact that any changes already made will be lost, however.
You are all overthinking this...just move the dropdown out of title label. This way it looks like a category! Place it before the title with a label that makes it clear it is an optional step to select a template (e.g. "start with a template for:").