Differentiating between different labels and milestones with same titles
**Update**: Including milestones in the discussion here as well as the solution will be probably be similar.
With this change, https://gitlab.com/gitlab-org/gitlab-ce/issues/51994, labels with same titles that are actually different in the system, display separately in the GitLab UI. How do we handle the situations when users do indeed seemingly the same label multiple times now?
## Current behavior
1. Adding labels to issues, MRs, etc..
User is shown a dropdown with labels of same names. Correct label is saved in the DB because we add labels by `id`. The user though has no indicator of which label is which since we only show label name and color.
1. Filtering by label
The filter dropdown shows multiple labels with the same name but clicking on any of them will do the same thing because we filter by name. Rendering of the label color in the filter bar is also inconsistent because upon page reload it renders the color of the first label it finds with that name which might not be the one the user clicked.
## Some ideas
1. Validate labels so they have unique names in projects and groups.
This is easy to do and the ideas below will not be required anymore. I think existing labels with same names can be left as-is since existing behavior isn't that broken.
1. Showing project or group path for the label in the dropdowns
I think very little backend work is needed for this. More of a UX challenge on how we present that info.
1. Filter by `label_ids` instead of `label_names`
This one requires a larger effort as there are details that need to be discussed. I remember a discussion when I was working on the filters that names were preferred so that the filter token text can be rendered right away from the params and we just do an async call for the extras like label color or avatar for users. There are ways around that and can be discussed in the issue.
issue