Skip to content

Search results in code tabs makes initial impression of serving unrelevant results

Problem to solve

Initial impression after looking at search results is that nothing relevant was found:

  • some tag endings are highlighted with a different background,
  • object methods and language keywords are highlighted as bold,
  • class that I was looking for was not highlighted at all.

Example of search results below:
https://gitlab.com/search?utf8=%E2%9C%93&search=%22js-projects-list-holder%22&group_id=&project_id=278964&search_code=true&repository_ref=master&nav_source=navbar

Example of search results

Intended users

P. S. Funny that my short name used with friends is also Sasha 😄

Further details

This change may result in better adoption of search and increasing the perceived value for a few of users.

Also, it may reduce risk of making "search not works" initial impression.

Proposal

The minimum valuable change would be to employ existing line highlighting solution with hll class to the lines which contain the search query: Minimum valuable change to highlight rows

Permissions and Security

No permissions would be changed.

Documentation

There is nothing to update, because search in project files feature is not documented.

I've checked here:

Testing

It should be possible to reuse most current tests from a referencing to a line feature.

What does success look like, and how can we measure that?

Acceptance criteria: Software developers would instantly grasp searched string occurrences in code results.

What is the type of buyer?

This is a Core feature.

Links / references

Issues mentioning the same problem: #16257 (closed), gitlab-foss#24475 (moved), #16719 (closed)

Edited by Alex Terekhov