Rewrite dropdowns
In my opinion, this should be done before #20754 (closed), which is currently a ~P1 (which I think should be dependent on this issue resolving).
I've spent a lot of time in the dropdowns and have an OK understand on how it... works. In reality no one should be able to "spend a lot of time" working on the dropdowns and only have an OK understanding of how they work.
gl_dropdown.js
does far too much heavy lifting for what should be a simple base class. Furthermore, all other scripts using the dropdown still do a bunch of heavy lifting. This doesn't make much sense. The labels_select.js
, milestone_select.js
and so on repeat each other a lot and are both as equally as confusing but the only difference is the fact that labels have multiselect functionality.
I agree it is a priority that the dropdown specs need to be in place, but I think we need to face the fact that no amount of refactoring is going to save these dropdowns. From what I understand a few other ~Frontend engineers have already tried to refactor this code and have found no perfect solution. If this is the case and we spend the next couple/few releases working out how to build specs for our current dropdowns, the dropdowns will be a huge source of ~"technical debt" and would shortly after have to be rewritten anyway, which will greatly devalue any efforts writing the specs beforehand as they will have to be re-written to support the new, simpler dropdown logic.
I propose that we rewrite the dropdowns from scratch using vueJS, creating a group of directives/components that are extended from a simple base class.
From what I've seen these dropdowns have been developed over a long long time which is probably why they're currently a mess. Now we understand the full scope and use of the dropdown, building a simple set of directives and specs to match it will take less time than resolving #20754 (closed) alone, which will have to come with a large refactor of the dropdowns beforehand, anyway.