Fix usability problem for file template
Problem to solve
The templates picker UI is confusing and has usability problems due to double terminology used for example .GitLab-ci.yml templates.
See https://gitlab.com/gitlab-org/gitlab/uploads/5a5228d8850278508b9678898d7c3702/image__34_.png
Intended users
Further details
This problem has been surfaced through the baseline experience recommendations effort of 2019 Q2: gitlab-design#518 (closed)
User thoughts:
There is a template option with the same name which I can apply. It is not clear if it has been applied already yes or no. Though the file seems empty.
Apparently this is for choosing different template types... Are those immediately related to setting up gitlab-ci?
UX Proposal
- Move the dropdown for choosing a template
Choose type
next to the file name input field. - Update the button labels, dropdown, and interaction as per acceptance criteria below:
Scenario 1: Acceptance criteria
- User leaves the input field blank, and clicks the dropdown button. A dropdown displays a list of template types available.
- The dropdown button should have the label updated from
Choose a type
toSelect a type
. Select means to carefully choose, so let's adapt the language here. - Remove the
close
button from the dropdown. We don't have this dropdown variation in Pajamas, and the fact that the user triggers a dropdown and aclose
option is available is odd. The default behavior of the dropdown is to be dismissed upon click anywhere outside the dropdown body. - Remove the
Choose a template type
dropdown header. - Once the user selects an option in the dropdown, the dropdown should close. The button label should remain
Select a type
. The input field should be populated with the template type selected. For example:.gitignore
- Once the user triggers the dropdown again, the latest selection should be identified with a
check
icon placed in front of the item name.
- The dropdown button should have the label updated from
- After a type is selected, a new button should be displayed. The button label should read
Apply a template
.- Clicking the button should trigger a dropdown.
- Remove the
close
button from the dropdown. - Remove the
Apply a template
dropdown header. - Fix the dropdown section header. Right now it is displayed in a small grey text, but we should display it in a bold, dark text. See Pajamas guidelines.
- Once the user selects an option in the dropdown, the dropdown should close. The button label should remain
Select a template
. - Once the user triggers the dropdown again, the latest selection should be identified with a
check
icon placed in front of the item name.
- After making the final selection, a TOAST component is shown to display the system message, replacing the inline message.
Scenario 2: Acceptance criteria
- User enters .gitignore in the input field, before choosing a template type.
- gitignore should be then selected in the first dropdown menu (choose type). The Apply a template button is shown.
- The Apply a template dropdown is filtered by the templates that match the previous type selected.
- After making the final selection, a TOAST component is shown to display the system message, replacing the inline message.
Click me to collapse/fold the first proposal.
- Move closer to the 2019-08-30_00.15.55 and consolidate towards one button for template picking. - It should be positioned next to the file name input like so: