[New] Improve search and highlighting #1693
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[NEW] I've created a new PR based on #1640. (Let's finish with it). If there were changes for last two days in the area of this PR please check that I didn't removed them by reverting the revert 😢
Issue: In the previous PR #1598, I've added highlighting feature to the filtered stories. Today filtering is based on
fuzzysearch
lib that simply return true / false if some string matches a provided query. Highlighting was based on just regex. It brings some inconsistency to the code and this bugWhat I did
As @Hypnosphi suggested I've changed
fuzzysearch
tofuse.js
.fuse.js
has a very rich api and ability to return matched indices.Another fact is that
fuse.js
is already used in@storybook/react-fuzzy
Currently I used
@hypnosphi/fuse.js
fork because of thisHow to test
run
cra-kitchen-sink