Skip to content

Run first command on form submit

What does this MR do and why?

Previously in command mode when user submitted the search (pressed Enter) they were navigated to the global search. This behaviour is incorrect. So in scope of this MR I've implemented the following improvements: when in Command mode (FF command_palette enabled and the first char in the input is one of > / @ # &) we display the search scope token in the input - Command Mode, the first command is highlighted and when user presses Enter, the highlighted command is executed.

How to set up and validate locally

👣 Enabled the feature flag

rails c 
Feature.enable(:command_palette)

👣 Click on the Global Search icon in the new navigation (or / shortcut)

👣 Start @user, &project, #recent issue search or use > to execute some default commands or jump to one of the menu items. In project scope you can also jump to project file when input starts with /.

👣 Make sure that you see the search scope, first command is highlighted and run on Enter

Screenshots or screen recordings

2023-07-07_13.10.26

Related to #415464 (closed)

Edited by Olena Horal-Koretska

Merge request reports