Skip to content

Updated dropdowns in cherry-pick commit modal

Ross Byrne requested to merge 388550-improve-cherry-pick-commit-dropdowns into master

What does this MR do and why?

What

This MR is a solution to #388550 (closed), which is follow-up work to changes made in !110012 (merged).

The changes made improve the consistency of the cherry-pick dropdowns by removing the functionality that filters the result of the dropdown by default. The selected item is then pushed to the top of the list. This improves visibility in situations where there are many items, eg. the branches dropdown.

There are also some other small code clean-ups that add consistency to both dropdowns.

Update

Based on the discussion here !112031 (comment 1282371600), the dropdown only pushes the selected item to the top of the list, when the user is not searching.

This MR also implements a fix for #391892 (closed), to stop a long item name causing the dropdown to overflow out of the modal.

Why

As seen in #388550 (closed), these changes were decided based on the discussion: !110012 (comment 1255182921).

The aim here is to improve the UX of the dropdowns by removing the odd behaviour that was introduced as a result of the dropdown component migration. The existing behaviour of filtering the dropdowns by default just doesn't work well with the new Pajamas components.

This is an MVC to help improve UX while waiting for gitlab-org/gitlab-services/design.gitlab.com#1509 to be completed.

Screenshots or screen recordings

I have a number of before and after screenshots which show:

  1. Default items when the dropdown is opened
  2. Dropdown with search results
  3. Dropdown without search results
Before After
Screenshot_2023-02-15_at_13.02.02 Screenshot_2023-02-15_at_13.05.09
Screenshot_2023-02-15_at_13.02.18 Screenshot_2023-02-17_at_09.07.06
Screenshot_2023-02-15_at_13.02.27 Screenshot_2023-02-17_at_09.07.14

Screenshots for the fix to #391892 (closed)

Before After
Screenshot_2023-02-17_at_09.30.25 Screenshot_2023-02-17_at_09.17.57

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Go to the list of commits in https://gitlab.com/gitlab-org/gitlab/
  2. Select Commit
  3. Select Options > Cherry-pick
  4. Click on dropdown "Pick into branch"

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #388550 (closed)

Edited by Ross Byrne

Merge request reports

Loading