Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New] Improve search and highlighting #1693

Merged
merged 2 commits into from
Aug 20, 2017

Conversation

igor-dv
Copy link
Member

@igor-dv igor-dv commented Aug 20, 2017

[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 bug

What I did

As @Hypnosphi suggested I've changed fuzzysearch to fuse.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 this

How to test

run cra-kitchen-sink

@codecov
Copy link

codecov bot commented Aug 20, 2017

Codecov Report

Merging #1693 into master will increase coverage by 0.39%.
The diff coverage is 56.77%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1693      +/-   ##
==========================================
+ Coverage   20.88%   21.27%   +0.39%     
==========================================
  Files         251      252       +1     
  Lines        5631     5710      +79     
  Branches      684      690       +6     
==========================================
+ Hits         1176     1215      +39     
- Misses       3927     3973      +46     
+ Partials      528      522       -6
Impacted Files Coverage Δ
addons/centered/src/vue.js 0% <0%> (ø) ⬆️
...les/ui/components/left_panel/stories_tree/index.js 100% <100%> (+1.47%) ⬆️
lib/ui/src/modules/ui/containers/left_panel.js 25.71% <42.85%> (ø) ⬆️
lib/ui/src/modules/ui/libs/hierarchy.js 48.8% <52.27%> (+3.35%) ⬆️
...s/left_panel/stories_tree/tree_decorators_utils.js 45.23% <54.28%> (ø)
lib/ui/src/modules/ui/libs/filters.js 47.36% <60.71%> (-5.97%) ⬇️
...ponents/left_panel/stories_tree/tree_decorators.js 33.33% <70%> (+1.04%) ⬆️
app/vue/src/server/config/babel.js 0% <0%> (-100%) ⬇️
app/vue/src/server/babel_config.js 0% <0%> (-83.88%) ⬇️
... and 30 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f15490e...a62beca. Read the comment docs.

@igor-dv igor-dv requested a review from Hypnosphi August 20, 2017 05:14
@igor-dv igor-dv assigned igor-dv and unassigned Hypnosphi Aug 20, 2017
Copy link
Member

@Hypnosphi Hypnosphi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

@Hypnosphi Hypnosphi merged commit e38e98f into master Aug 20, 2017
@Hypnosphi Hypnosphi deleted the improve-search-and-highlighting branch August 20, 2017 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants