Skip to content

search: Distinguish file content matches from path matches in the UI when `select:file` is present

Created by: tbliu98

Stacked on #41296

select:file restricts result rendering to only show file paths. These results can be either:

  1. A match on the literal file path string, or
  2. A file containing a content match, but not necessarily a match on the file path

Regardless, select:file will cause all results to be converted to path matches.

Currently, we always label a result with "Path match" when it is rendered as a path match. This is confusing when a result is a content match that has been converted to a path match, because the label "Path match" implies that the file path itself contains a match, when this is not always the case.

Now that path match ranges are available in the client, we can make the distinction between a "natural" path match and a "converted" path match in the UI in a way that's informative to users.

Before: Screen Shot 2022-09-04 at 6 20 55 PM

After: Screen Shot 2022-09-06 at 11 43 08 AM

Test plan

Visually confirm the change in the UI

Merge request reports

Loading