Migrate GlSorting to use GlCollapsibleListbox
The GlSorting component uses the deprecated GlDropdown component. It should be migrated to the GlListbox component for better accessibility and UX.
There are three approaches we could take:
- Keep the existing
GlSortingAPI (i.e.,GlSortingItemchildren, etc).- Pros:
- Least amount of work. Work only needs to happen in GitLab UI. No downstream changes necessary, at least initially. We may want to migrate the API to something a bit less verbose in future, i.e., more similar to
GlListbox'sitemsprop.
- Least amount of work. Work only needs to happen in GitLab UI. No downstream changes necessary, at least initially. We may want to migrate the API to something a bit less verbose in future, i.e., more similar to
- Cons:
- Requires some unusual component coding practices. Rough plan:
GlSortingwouldprovideits instance to descendants.GlSortingItems would inject that instance, and call methods on that instance to propagate their option values/labels up toGlSorting, which would pass the resulting structure toGlListbox. Something similar for@clickevents on the children. - Could break downstream test suites that do things like
wrapper.findAllComponents(GlSortingItem), maybe.
- Requires some unusual component coding practices. Rough plan:
- Pros:
- Add a new
itemsAPI toGlSorting. Use ofGlSortingItemchildren would be supported, but deprecated.- Pros:
- Downstream migrations can happen incrementally.
- Cons:
- Would have to maintain two completely different approaches in the component during incremental migration.
- Pros:
- Follow the breaking changes process for
GlSorting, and create a new component with the new API.- Pros:
- We've done this process before.
- Cons:
- Most amount of work. The deprecation process is long-winded and involves several steps both up and downstream.
- Pros:
Edited by Mark Florian