Skip to content

Fuzzy finder: make focusIndex state persistent across blob views

Created by: olafurpg

Steps to reproduce:

  1. Activate fuzzy finder in sourcegraph/sourcegraph
  2. Search for "helper"
  3. Press down arrow
  4. Press enter
  5. Activate fuzzy finder again

Expected behavior: the focused filename should be the second filename in the result list for the query "helper"

Actual behavior: the focused filename has been reset to the first filename in the list.

This bug is caused by the fact that the focusItem state is part of the FuzzyModal component instead of FuzzyFinder.

https://github.com/sourcegraph/sourcegraph/blob/41d2a8c7eb192e2a927ab5147b44bc387ee1ef58/client/web/src/components/fuzzyFinder/FuzzyModal.tsx#L67-L70