Skip to content

Skip new branch name validation for some keypresses

What does this MR do and why?

Whenever the user releases any key while the new branch name field is focused on an issue, the branch name is re-validated, even if no change was made to the value.

This MR excludes keyups for certain key combinations so that copying the branch name, using the arrow keys and hitting escape do not trigger unnecessary validations.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

In the before video below, you can see that the branch name revalidates on every keypress, even for arrow keys or command keys. At the end of the before video, you can also see that the branch name revalidates again when I press escape.

Before After
Screen_Recording_2024-09-20_at_11.11.29 Screen_Recording_2024-09-20_at_11.12.07

How to set up and validate locally

  1. Check out this branch
  2. Visit an issue in the GDK
  3. Click the "create branch" dropdown
  4. focus will automatically move to the branch name input. Use the keyboard to select the branch name and copy it
  5. You should NOT see the branch name revalidate

Merge request reports

Loading