Inconsistent behavior between Web IDE and Single File Editor when choosing file templates
Release notes
Problem to solve
As a user I expect the same behavior form different modules in the product. Currently when editing files, you can choose from preset file templates. When you do this from the Repository -> Edit view (also known as the Single File Editor), the templates are grouped nicely together in categories. Using this same functionality in the Web IDE results in an un-grouped list of templates that can be hard to navigate.
Intended users
User experience goal
The experience of choosing a file template should be the same whether you are using the Web IDE or the Single File Editor.
Proposal
The problem is rooted in how the pages are built. In the Single File Editor, the templates are grouped on the backend and set as a data
attribute in the HAML application. The Web IDE, however, relies strictly on the results from the API endpoint to build the list on demand.
The solution would be to:
- Update the endpoint to include the grouping
- Make sure other places using the same endpoint are not impacted negatively
- Update the template picker component in WebIDE to employ the grouping
Further details
More discussion can be found in this MR comment: !18337 (comment 615017545)
When you edit the .gitlab-ci.yml
template from setup CI/CD button in the repo you get this page
If you create a new gitlab-ci.yml template form the WebIDE you get this page
The experience is not consistent and neither is the search
In the setup CI/CD the search is better because it shows the template and it's parent, for example html is under pages
In the new gitlab-ci.yml from WebIDE, the search just returns a list of templates without context, for example html