Skip to content

Search bar first iteration

Clement Ho requested to merge search-bar-first-iteration into master

2016-12-12_12.48.19

What does this MR do?

Replaces the existing dropdown filters and search input used in the issues page with a filtered search input bar (as seen in the gif above). As the user focuses on the search input, a hint dropdown will appear with the available commands/tokens (eg. author:<author> where <author> is where the user should type the username of the user). After the user types specific tokens such as author:, a different dropdown will load and appear with the available options (same options as the existing dropdown filters). As the user types after the token's colon (:), the dropdown will filter based on what was typed. If the user wishes to search for something that spans multiple words, the user will have to enclose that term with either double quotes or single quotes. In order for a valid search to occur on tokens, the tokens must include it's corresponding tokens (if any). For example, author:@clemmakesapps is valid while author:clemmakesapps is invalid. Likewise, label:~frontend is valid while label:frontend is not. There are a few edge cases where this rule does not apply such as label:none but they only exist for a few filters. These symbols are the same as the ones used in markdown. If the filter has no corresponding symbol in markdown, it will not require a symbol (eg. weights). It is recommended for the user to click on the dropdown to select their filters as that will automatically populate the correct term in the search input. Pressing the enter key while typing in the search bar will perform a search of the contents written in the search bar.

Known Issues (But we will go forward with it for this iteration)

  • Label searches are case sensitive (when you type out the exact label)
  • Search term will always end up at the end of the input field after a search
  • Search term will be combined after a search if they are in between different tokens
  • Clearing the search results by selecting x does not perform an empty search
  • Search terms will not save if the user switches to a different state tab (Eg. Going from Open issues tab to Closed issues tab)
  • There is currently no no matching results message for the search filter dropdowns
  • Searching for a term containing the other token symbols (@,#,%,~) does not work
  • (Existing bug in the search filter API) when searching for author using one character (and the character) is part of one of the names/username, all the available authors are returned
  • (Existing bug in the search filter API) when searching for author using all two letter capital letters found in one of the names/username. Eg. OT (all results are returned)
  • Selecting any existing tokens will open the corresponding filter dropdown

Remaining Tasks

  • Search the filter dropdown using multiple words (Labels starting with a single or double quote and does not have an ending quote will have weird side effects - @jschatz1 says its acceptable for now)

What are the relevant issue numbers?

Closes #21747 (closed)

Merge request reports